NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Property loader with an array of number using a database

Using TestStand 3.5 and Access 2003 Database with MS ODBC Driver

I am currently updating  my property loader to use a n Access database instead of the text file i am curently using.
Everything was working while using the text file even the arrays.

The transition to a database doesn't seem to work correctly.

1) The first symptom is when trying to export an array to a database using the Tool>Import/Export command
The column get created with the ArrayIndex (Mode0, Mode1, Mode2, Mode3,...) but nothing gets exported.
The array is an array of number with default value of 999 inside. The export result show an empty record for that column.

The same is true  when performing the import (or running the sequence) , nothing gets read from those column.
All the arrays members keep the original values.

2)  While doing  the Create Column from the Tool>Import\Export, the array members get the type VARCHAR even if they are numbers.
I even tried to create the table manually with all the array element as column with the type integer without success.
The Import, Export or running the sequence won't read those values.

Any other values from the table that are not Array work flawlessly.

So, How can I use a database on a local variable that is an array of numbers???

Thanks
EG

0 Kudos
Message 1 of 5
(3,691 Views)
Howdy Gig52 -

I'd like to make sure that I understand your problem completely.

When you export using the import/export wizard to a database, are you exporting an array to a single entry in the database as a string (with delimiters), or are you attempting to just popeulate a column in the table (populating multiple records at once)?

What is your SQL statement that is being used within the import export wizard?

That being said, I have attached an example to help get you started.  This example shows how to use the Property Loader to retrieve values into a TestStand array from an Access database. After you have created a sequence file and defined an array, the steps to create the database and export the initial array values include:

1) Create the Data Source Name (DSN) and the database.
2) Open the Sequence Editor.
3) Select Tools >> Import/Export Properties...
4) Select Database for Data Location.
5) Click on Select Data Link...
6) Click New...
7) Enter a Data Link Name.
😎 click Build...
9) Select your database provider. This example uses Microsoft OLE DB Provider for ODBC Drivers.
10) On the Connection Tab, choose "Use data source name" and select the DSN you created in step 1).
11) Click OK until you get back to the Import/Export Properties dialog.
12) On the Properties tab, select the sequence of interest and define the Step Name Column.
13) select the array(s) you would like to export. Notice that the array index has a question mark in it. You will need to select the array one time for every element in the array you would like to export and replace the question mark with the appropriate index value.
14) At this point, you can click on Create Columns and let TestStand create the needed table and columns in your database.
15) Click on Export.


Thanks for posting and have a great day!

Regards,
Andrew W || Applications Engineer
National Instruments


0 Kudos
Message 2 of 5
(3,672 Views)
Hi Andrew,

I currently have an XML error when trying to read your database into the array.
The SQL statement worked since 3 values were extracted and the report show the text correclty but TestStand fails to import them.
I have attached the report if this coud help you decipher this problem.

Playing with your DB, I tried the following with success:
    Loading the Array0_Number value to a temporary Local number variable.

From your example, it looks like you were using TS 2.0 and 3.0.
Would the fact that am I currently using TestStand 3.5 a factor??

Thanks
EG


 
 
0 Kudos
Message 3 of 5
(3,654 Views)
Gig52 -

Thanks for the update.  I'll take a look into the specifics of the error with the example. The example may just need to be updated to the current TestStand version.

In the meantime, have you seen this post: http://forums.ni.com/ni/board/message?board.id=330&message.id=9837 ?

Regards,

Andrew W || Applications Engineer
National Instruments


0 Kudos
Message 4 of 5
(3,631 Views)
A workaround was found for this problem since it seems that this is a defect with TestStand 3.5.

Instead of using the property loader for array elements on a DB, you need to use a Data Operation from the Database Sequence step.
This step wil allow using the current record to update the array subscript variables with their appropriate columns.

The attached code as the proposed workaround solution.

Thanks

Eric G



0 Kudos
Message 5 of 5
(3,593 Views)