How to close or hide the node view opened during socket connection

How to close or hide the node view opened during socket connection

supportPHJ4A
Collaborator Collaborator
443 Views
2 Replies
Message 1 of 3

How to close or hide the node view opened during socket connection

supportPHJ4A
Collaborator
Collaborator

[ FlexSim 23.2.3 ]

Hello , I referred to previous socket examples and when I want to monitor in real-time if there is any data being transmitted to FlexSim, I usually need to create a “TimerObj” treenode and use createview to open the view for that node. However, this will keep a view open until I disconnect, and I can only close it after that. Is there a way to close or hide this node's view while still ensuring normal signal reception?

1718437912093.png

0 Likes
Accepted solutions (1)
444 Views
2 Replies
Replies (2)
Message 2 of 3

logan_gold
Community Manager
Community Manager
Accepted solution

Hi @CSN, you can hide a window with the windowshow() command, where the second parameter will be a 0, like this:

windowshow(windowfromnode(view), 0)

You'll need to replace view with the reference to your created view.

Alternatively, since you're just using the window to set up a timer, you can instead use Delay.realTime() in some sort of loop alongside your logic to monitor the status of the socket connections. That way you don't need to worry about creating the view, and the logic isn't tied to events in the model, which is always nice since sockets aren't really connected to events in the model either.

0 Likes
Message 3 of 3

supportPHJ4A
Collaborator
Collaborator

I tried using Delay.realTime() and it achieved what I wanted. Thank you very much.

0 Likes