From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP connectionID not working inside the SubVI

Hi everyone,

 

 

I am working in an TCP server - client structure. Here multiple clients connect with the server. Using the TCP listener, I club 3 client TCP connectionID into an array. 

 

When I pass this Array of TCP connectionID into subvi, put a for loop and extracting every single connectionID to read or write data, it is throwing an Error 1. But when I do the same thing inside the Main VI, both read and write operation is working perfectly. Couldn't find the way to solve.

 

Solutions welcome.

0 Kudos
Message 1 of 4
(2,662 Views)

Can you attach your VIs or a screenshot of them?

 

I have implemented multiple client architectures with passing the TCP connection ID into SubVIs which are called asynchronously and I haven't had any problems with the references being invalid inside the SubVI.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 4
(2,654 Views)
Are you sure the error isn't coming from somewhere further upstream, and you just don't see it until you hit the TCP functions? On the subVI, is the TCP ref array input set to required? That can help catch miswiring problems, maybe the array of references isn't actually connected to the subVI correctly.
0 Kudos
Message 3 of 4
(2,633 Views)

Extremely sorry to every one. Its just a whacky mistake. Every single time, I am sending the excessive index value (like array size is 3, but am sending 4 to index array) to an index array. So it returns the empty element from the array, that does the error. 

 

 

Thanks sam_sharp and nathand for your suggestions.

0 Kudos
Message 4 of 4
(2,605 Views)