NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

tab character problem between TestStand and LabView 8

I performed a search on my actual problem.
Found lot of possible answers but nothing that works for me right now.

Here is goes:

I have a LabView VI with String control set as (\ Codes Display).
My actual problem is that I read a string from a an Access DB with \t in the string.
Once it gets to LabView I have \\t in the string instead of \t as I would have expected.

But on further investigation, I was able to have the same problem inside TestStand 3.5
Using a local string variable, if I insert \t in the string under the view content it gets read as \\t in the LabView vi.
(Same thing if I insert \n, I get \\n but it works if I do Ctrl-Enter in the box.)

Do I need to do something to the local variable to interpret Control characters??

Just to confuse me more, if I hard code a string in the module description of Test Stand for my LabView vi with \t in the string, IT WORKS....
(Hence copying the content of the local variable directly to the Module properties field worls flawlessly)

Does this implies that there is a difference between a parameter string and a local variable string???

Thanks for the help

EG
 
0 Kudos
Message 1 of 2
(3,123 Views)

EG,

First off, there is a difference between a parameter string and a local variable string when entering the data.  If you edit the string of a local variable from the locals tab, you are entering in the exact string.  When you type "\", you are really place "\\" in your string.  When you place the string inside the parameter, you are passing an expression.  For example "Jesse\tO" would pass Jesse\tO and not Jesse\\tO. 

You can tell you are passing an expression because, when entering information into a parameter string you can enter Locals.myString.  You could not place this expression inside a local variable string and expect it to retrieve the data from another variable.

Alternatively, when you specify the local variable to use in the parameter string section you can specify the type as 'Binary String'.  This allowed me to type Jesse\tO in the local variable and have it pass correctly.

Finally, LabVIEW will display the data that it is sent.  It does not add formatting to the data.  If you are reading from your Access database, and you are seeing "\\t" instead of a tab, I would expect Access to be sending "\\t" to LabVIEW.  If you are unable to get Access to send the proper \ codes, you could always use the search and replace vi in LabVIEW to format the data properly.  I would also look into how the data is being stored in the database and if the \ codes are correct there.

Regards,

Jesse O.
Applications Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 2 of 2
(3,098 Views)