question

CSN avatar image
0 Likes"
CSN asked CSN commented

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

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

FlexSim 23.2.3
socket
1718437912093.png (82.7 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Logan Gold avatar image
0 Likes"
Logan Gold answered CSN commented

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.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

CSN avatar image CSN commented ·

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

0 Likes 0 ·