Details
-
Type:
Bug
-
Status: In Progress
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: ts_main_telescope
-
Labels:
-
Story Points:2
-
Epic Link:
-
Team:Telescope and Site
-
Urgent?:No
Description
TCP/IP module can not run multiple instances at the same time. It will fail if I use the asynchronous call to run multiple instances of TcpServer.runServer.vi. At DM-37368, I tried to run two instances at the same time, one for SAL and the other one for GUI. However, only one of them can construct the TCP/IP connection successfully, which depends on which instance I run first.
The following references are useful for this use case:
1. Reentrancy: Allowing Simultaneous Calls to the Same SubVI
2. Asynchronously Calling Multiple Instances of a VI for Parallel Execution
3. Combining Option Flags into a Single Option Value
My use case is to run two different TCP/IP servers (with SAL and GUI) clients at the same time. Therefore, another option might be allow to listen multiple ports at the same time. The client will need to add the field in the header to identify its role. But I felt this option might make the code complex. We could discuss first to have a good and easy solution if you like.
Attachments
Issue Links
- is triggered by
-
DM-37368 Support the M2 Cell TCP/IP Interface with Json Packet in Phase 8
- Done
I tried to reproduce the problem. After modifying the execution configuration on several VIs like TcpServerBase.runServer.vi and others, I realized this way will complex the code too much, so I need more time to debug and find a solution for this bug. I will prioritize other tickets before continuing with this ticket. I will leave some notes here for my acknowledgment only and future changes:
I had to set the TcpServerBase.runServer.vi with Shared clone reentrant execution option selected, because reentrant VIs can only have dynamic dispatch terminals if they share clones between instances. After that, the run arrow broke, and the error message recommended to me: “you must either change the terminal in the connector pane to not be dynamic or edit VI Properties to modify the reentrancy behavior.” Then, when I set the Shared clone reentrant execution option, this message appeared: "You have changed priority, execution system, or reentrancy. These changes may break other implementations of this method in the hierarchy. Would you like to make all the implementations match the priority, execution system, and reentrancy of this VI?". I clicked yes. Now the arrow is solid.
TcpServerCmd.runServer.vi and TcpServerTel.runServer.vi inherited this property, except TcpServer.runServer.vi.
With this configuration, I can run two instances of TcpServer with different ports, and I can construct two connections from two TCP clients. However, I have problems with the GenRead user event sending generic user events when the connection is closed in any TCP Client. (End of my notes)