NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to include a carriage return in a TestStand string variable

Is there anyway to add a carriage return to a TestStand string variable. I am sending commands to an instrument using the Rs232 serial bus and they need to be terminated with a carriage return ie "\r". I know you can creat a DLL and return the string variables to TestStand but is there a beter way ?
0 Kudos
Message 1 of 5
(8,678 Views)

Hi Paul,

Use an expression similar to this:

Locals.MyString =Locals.MyString +\\r

Replace Locals.MyString with your variable Lookup string.

You can put this expression in the PreExpression of your step.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 5
(8,671 Views)
Hi Ray,
 
Many thanks for that but I don't seem to be able to get it to work. When I put
 
Locals.SIU_WRAP = Locals.SIU_WRAP+\\r
 
In my Pre Expression I get the following Error
 
Syntax error in pre expression:
Unexpected token: \
This value will cause a run-time error.
 
any idea
 
Regards Paul.
0 Kudos
Message 3 of 5
(8,664 Views)

Hi Paul,

Sorry about that, just noticed I left off the "" in my last response.

Try "\\r".  that should solve it.

Regards

Ray Farmer

Message Edited by Ray Farmer on 09-15-2005 09:14 AM

Regards
Ray Farmer
0 Kudos
Message 4 of 5
(8,660 Views)
Actually probably just "\r" (just one backslash). Depends on whether you want your string to contain the two characters backslash and 'r', or whether you want the actual carriage return character in your string.

-Doug

Message Edited by dug9000 on 09-15-2005 10:20 AM

Message 5 of 5
(8,651 Views)