NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Select Serial Port Batch Mode

I have a TestStand 3.5 script that uses the batch model to test up to five UUTs.  It first prompts the user to hook everything up for the test (OneThreadOnly batch synchronization).  Then it runs the tests on each UUT in Parallel Batch Mode via a dedicated serial port for each UUT.  The commands are sent to a LabView VI that sends the command to the specified serial port.  Therefore, each test socket will be mapped to a serial port (USB-to-serial convertors) on the TestStand PC.  For example, test socket 0 will be mapped to COM1, test socket 1 to COM2, etc.  My problem is that I can't figure out how to a) determine the test socket b) map that socket to a serial port and send to the VI.

I have attached an example TS script and the VI.  Thanks.

Download All
0 Kudos
Message 1 of 6
(4,776 Views)

TestSockets are 0 index based.  They are stored at the lookup string RunState.TestSockets.MyIndex as a numeric value.  Since you want to TestSocket 0 to be COM1 then you will need to add 1 to the TestSocket Index.  I am attaching a simple example that pops up a message with a string of the COM ports. 

Basically, just pass the following to your VI:

"COM" + Str(RunState.TestSockets.MyIndex + 1)

Let me know if you have any more questions on this as multithreading can be tricky.

Here's a TIP: When dealing with the Batch or Parallel models and you have multiple finished execution windows open then click Ctrl-D to close them all at once.

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6
(4,773 Views)

Here's a link that talks about the Resource name in the Specify Module dialog: http://forums.ni.com/ni/board/message?board.id=330&message.id=4673&requireLogin=False

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 6
(4,770 Views)

jigg -

Thanks - very helpful.   I have your first response working, but I am having/ trouble with the second.  The link you provided noted I should be able to uncheck the "Default Value" box and fill in the "Device Name" ASCII field.  It is grayed out and can not be modified in my example.  I'm stumped as to why.  I've attached a screen shot for reference.

B.
0 Kudos
Message 4 of 6
(4,746 Views)

Hey Bolinger,

Yeah I notice that too now that you mention it.  So what you can do is create a local variable of LabviewIOControl type.  Then in your pre-expression or in an expression step before the LabVIEW call set that datatype with the values and pass it to the LabVIEW module.  I'm attaching an example with a Local that demonstrates what I mean.  Basically I have a local called VISAName and I set up it's sup properties in the expression step.  You could do the same in a preexpression for your LabVIEW step.  Then you will be able to pass that, which is basically a cluster/container, to your LabVIEW code.  I attached an image showing how to do this.

Let me know if that helps.  This is the best way I know how unless someone else has a better suggestion.

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Download All
0 Kudos
Message 5 of 6
(4,741 Views)
jigg -

That worked - you are a genious.  Thanks!

0 Kudos
Message 6 of 6
(4,734 Views)