hans17
2006-11-28 01:40:17 UTC
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
Special Chars.seq:
http://forums.ni.com/attachments/ni/330/13393/1/Special Chars.seq
String Passing.vi:
http://forums.ni.com/attachments/ni/330/13393/2/String Passing.vi
Special Chars.seq:
http://forums.ni.com/attachments/ni/330/13393/1/Special Chars.seq
String Passing.vi:
http://forums.ni.com/attachments/ni/330/13393/2/String Passing.vi