NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing One Serial Port Between Two UUTs in Parallel Model Sequences- Can it be done rock solid?

Dear Teststand Forum,  

 

My customer wants to run two UUTs in parallel  24 x 7 365 days per year.   The communication interface has a USB connection going in but appears in windows device manager as a serial port #4 .     The two sequences running side by side in parallel sequence model - are completely asynchronous once launched.  Here are the details:

1) The sequences are duplicate of each other in the parallel sequence model

2) The sequence has 6 different calls to the UUT through the COM4

3) The sequence must execute in under 22 seconds

4)  The Com port is first initialized in the Setup part of the sequence, and COM4 passed to a file global in a string

5) Each UUT is addressable - so a command is sent to the UUT with that address in the command header. 

6) I use the variable "My Index"  in the UUT  loop to identify the test bed I am trying to talk to. 

CONCERNS:  I am worried about race conditions,   and about how long it will take for the steps in the loop execute.

SOLUTIONS?   Use File globals ?  Queues?

 

note:  I have 20 years experince writing LabVIEW code and will have this run in  a UI. 

 

I appreciate your suggestions.  Thanks! 

Single Com Port between to parallel UUTs

Brad Whaley
LabVIEW Certified Engineer
0 Kudos
Message 1 of 3
(3,168 Views)

The issue maybe when reading\writing simultaneously to the COM port by both sockets(UUT).

 

If you can add a lock mechanism around the write/read to COM/USB functions in your code you should not face race condition issue.

 

I feel the solution has to be within the code rather than TestStand. ( you can use TestStand lock feature but it may be ineffecient).

 

Hope this helps.

0 Kudos
Message 2 of 3
(3,150 Views)

You will likely need to use the locking feature of TestStand and/or lock steps to protect access to the COM port so that only one thread/socket is using it at a time.

 

-Doug

0 Kudos
Message 3 of 3
(3,139 Views)