NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving waveform data stored in MS Access database created by Teststand

I've just started playing with the Database options in Teststand and have managed to create a database to store test data. I can easily retrieve single point data measurements, but have not figured out how to pull out waveform data from an oscope that is stored in the database. Does anyone know of an easy way to accomplish this?
Thanks
0 Kudos
Message 1 of 6
(4,271 Views)
Hi,

Just to verify, you have already saved the waveform information to the database and now trying to get that information out?  If so, take a look at the link below.  It has examples on how to get this information out of the database.  Let me know if you have any questions.

Database
0 Kudos
Message 2 of 6
(4,255 Views)

I am also yet to figure out how to retrieve any array that TestStand stores to a database; I’m using MS SQL.  To clarify I have already written a waveform and an array of U16 to the db and have not been successful in retrieving them. 

 

Does anyone have an example that is more up-to-date than the one mentioned above, preferably in LabVIEW and/or TestStand?

 

I will also settle for ideas and suggestions.

 

From what I can tell the array data is stored as a binary that needs to be parsed depending on the representation used to store it.  Also doing a quire from the SQL management studio it appears as though endianness is going to come into play. 

 

I have attached an array of the data that was stored as an R8 that has a total of 100 elements that first value is 0 last value is 99, between first and last values increment by 1.  The binary data was returned in hex form in the SQL manager query.

 

Thanks

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 3 of 6
(3,867 Views)

Hi Herrlin,

 

You might want to check out the Database Connectivity Toolkit for LabVIEW - (http://sine.ni.com/nips/cds/view/p/lang/en/nid/209060

This video gives a brief explanation of how to setup a database (although it’s Access) for TestStand (http://zone.ni.com/wv/app/doc/p/id/wv-555)

This is also an older example, but I don’t think too much has changed from TestStand(http://zone.ni.com/devzone/cda/tut/p/id/3604)

What versions of TestStand and MySQL are you using? Maybe I can come up with better examples.

 

Regards,

 

Michael Miracle

NI Americas | AE

NI.com/support | 1866-275-6964

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

Michael

 

Thank you for the reply, but my question was way more specific then the material you referenced.  I have no problem setting up a db or having TS log to a database.  My problem is getting array information back out of database once it is logged.  Anyway I have figured out what I need to do in order to get the array data back out in a form I can use, I will post my approach in a couple of minutes. 

 

Also just as a FYI I am using TS 2010 f1 (4.5.0.330) (when is TS 2011 dropping) and Microsoft SQL Server Express Edition (SQL Server 9.0.5000) not My SQL.

 

Thanks

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 5 of 6
(3,835 Views)

So I was able to make use of the array data that TS stores as a binary (image) in my database by doing the following three things.

 

 

  1. Create Stored Procedure - grabs the binary array data from a record and chunks it up into 8 bytes at a time.  It then feeds 1 chunk at a time into two functions that I have created. The results from the functions are feed into a temp table and returned to the user.  The end result is a table with a Y column that represents the array data in a usable form, a double or in SQL terms Float(53).
  2. Create Function 1 - changes the TS little endian to big endian
  3. Create Function 2 - converts the 8 byte binary to a float ( I got this function from http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81849 )

 

See functions and stored procedure attached

 

Something to consider

  • This only works if you have TS setup to store arrays as R8 in the database, see Configure, Database Options.  If you wish to store it as something else the approach would be the same but the conversions would have to change
  • If you wish to use my approach you will have to modify the stored procedure to point to your database and table.
  • I am not a SQL expert and I am not confident that this is the most efficient approach

 

I have not gotten into what it would take to pull the arrays back into TS or LV as it is currently outside the scope of my project.  But if I ever venture down that path I will try and post an update

 

 

herrlin

 

 

 

 

Herrlin

Just trying to spread the LabVIEW love.
Message 6 of 6
(3,830 Views)