NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing carriage return and other special characters in a TestStand variable and passing to LabVIEW

I am using TestStand step to call a LabVIEW VI that writes commands to a serial device.  The device expects a carriage return at the end of the command.  I can create a constant string in TestStand with the carriage return, e.g., "ATA\x0D" and pass that to a LabVIEW string control which shows ATA\r and the VI works properly.

To provide consistency and flexibility in my code, I want to store the terminator character(s) in a TestStand variable.  However, when I try to use an expression to create the command string, i.e. "ATA" + "Locals.Terminator", where Locals.Terminator is set to "\x0D", my LabVIEW VI string control shows "ATA\\x0D" which doesn't work.  And when I try Locals.Terminator set to "\r", the LabVIEW string control shows "ATA\\r" which doesn't work either.

Is there a way to store special characters in a TestStand variable and pass them to LabVIEW as special characters?  I saw in another post that if you edit the TestStand variable by pressing Cntl-Enter, it will store  the newline \n properly and it can be sent to LabVIEW - that works for me as well for \n.  But  I need to send a carriage return.

I've attached my test sequence and the corresponding LabVIEW VI with a string control.

Hans
Download All
0 Kudos
Message 1 of 3
(3,806 Views)
Hi Hans, 
 
Thanks for your detailed explanation and examples.  In TestStand, change the String parameter's String Type to Binary String instead of ASCII.  Then it will pass the desired value.
Cheers,

David Goldberg
National Instruments
Software R&D
0 Kudos
Message 2 of 3
(3,787 Views)
Thank you David.  When I went to the Specify Module window for the TestStand step and changed the Type for the string input parameter from ASCII String to Binary String, my LabVIEW VI saw the special characters properly.

Thanks again,
Hans

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