NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Property loader in .csv Format : Error with list of Numbers

Hi,

 

I need to change property files from the .xls format to the .csv format so that I won't need to install Ms Office on the Test Station PC.

 

Everything works is .csv format except for variales containing lists of numbers.  Here is an example.

 

This variable contains the channel list to send to a Digital Multimeter.  A string containing all channel numbers seperated by comas (The DMM model is Agilent  34070A). 

 

I create a variable named ChannelList of type string containing : "101,102,103,104,105"

 

When exporting to property file (Using Tools-Import/Export properties), TestStand will write the following line is .csv format :

 

ChannelList,"101,102,103,104,105"

 

When trying to import this property value with a property loader I get the following error :

 

Runtime Error Occured

Error evaluating expression:Runstate.Sequence.locals.ChannelList = (""101")

Unexpected Token: 101

 

What puzzles me is that teststand is not even capable of reading its own exported property within a newly created file.

Any ideas?

 

TestStand 2013

 

Thanks in advance

Nien

0 Kudos
Message 1 of 6
(4,635 Views)

Nien,

 

what happens if you remove the quotation marks in the csv file?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(4,610 Views)

Hi Norbert,

 

I should have answered that question in the first place, it's the first thing I've tried.  If I remove the quotation marks, TestStands considers the first coma to be a field delimiter and even though I don't get any error when using the property loader, the content of the string will only be "101" instead of "101,102,103,104,105" after the importation.

 

Regards

Nien

0 Kudos
Message 3 of 6
(4,598 Views)

Other tests also :

 

TestString,'101,102'

will result in : 

"'101" (Notice the ' in front of 101)

No error

 

TestString,"101"+"102"+"103"+"103"+"104"+"105"

will result in :

"101102103104105"

No error

 

TestString,"101"+","+"102"

will produce error

Unexpected Token ""101"+"

 

TestString,"101"+chr(34)+"102"+chr(34)+"103"

will result in:

TestString,"101102103"

No error

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

Nien,

 

This is a known issue and we are looking into this issue in future version of TestStand.

 

There are couple of approaches for fixing the problem:

 

1. Use a different character for comma in the property loader file. After importing the data, replace the character with comma using TestStand expression in the sequence file.

 

2. Use Tab Delimited Text format instead of CSV format.

 

3. We can see that, property loader is using expression to update the value of the property (The exact expression is specified in the error message you have posted). In a text editor, update the csv file to have the value as

ChannelList,101""+Chr(44)+""102""+Chr(44)+""103""+Chr(44)+""104""+Chr(44)+""105

This will create the expression such that, the value of ChannelList property will become 101,102,103,104,105

Note: This is just a workaround and you should use this approach with caution.

 

Thanks,

Shashidhar

0 Kudos
Message 5 of 6
(4,581 Views)

Thank you very much for this very precise answer!

 

Nien

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