取消
显示结果 
搜索替代 
您的意思是: 

Converting data stream for database insert

This might seam like a rudimentary question, but what is the simplest way to prepare the data stream coming out of the DAQ Assistant so that it can be inserted into a database using the DB Tools Insert Data vi?  I am trying to stream one voltage channel from a CompactDAQ voltage card into a database and keep getting a type mismatch error from the DB VI.  When I set the table create to true, the function runs but inserts the text "Long binary data" of type "OLE Object" inserted into the rows of the database.  From the examples it looks like I need to use an array or a bundle but I'm not quite sure how to do this.
 
 
 
 
0 项奖励
1 条消息(共 11 条)
5,077 次查看
Hi ControlAutomation,
you can tranform your "dynamic data" into an array of waveforms, or an array of double values. Transform these values into string, this should work to insert it into your database.

Hope it helps.
Mike
0 项奖励
2 条消息(共 11 条)
5,055 次查看

Thanks Mike,

What function would I use to transform the output into an array of floats?  Would I use "build array"?  I'm not exactly sure what format the data stream coming out of the DAQ Assistant is.  I'm used to dynamically allocated and sized arrays in VB or C++.  All of the examples and tutorials I have looked at speak to fixed-sized arrays that are represented on the front panel.  Do you know of an example that takes the output from the DAQ Assistant and puts it into a database?

Mike V.

0 项奖励
3 条消息(共 11 条)
5,048 次查看
Hi Mike V.,
this should work for you.
 
 
Mike
4 条消息(共 11 条)
5,026 次查看

Forgive my Labview ignorance, Mike.  But could you indentify the functions in this bitmap?  Also, will this work with more than one channel coming out of one DAQ Assitant block or do I need to create one DAQ Assistant for each channel that I want logged?

 

Thanks,

Mike V.

0 项奖励
5 条消息(共 11 条)
5,015 次查看
Hi Mike V.,
it´s possible with more than one channel, i confogured to channels. The first vi is the DAQ assistent, convert dynamic data, number to fractional string and then to variant.
 
Hope it helps.
Mike
6 条消息(共 11 条)
5,011 次查看
Thanks Mike,
 
That is getting me closer.  What conversion type should I use for the "Convert From Dynamic Data" control?  Since I have four channels coming out of the DAQ assistant, I chose "2D Array of Scalars - Columns are Channels".  I still get one column of data in my database where each record in the table reads "Long Binary Data".
 
Any ideas?
0 项奖励
7 条消息(共 11 条)
4,984 次查看
Hi Mike v.,
normally "2d Array..." should work. Please see the attached example.

Hope it helps.
Mike
0 项奖励
8 条消息(共 11 条)
4,982 次查看
I tried the string conversion - same result in the database - "Long Binary Value".  The attached VI inserts the timestamp fine (Column 0) and then shows "Long Binary Data" for each of the four channels (Columns 1-4).  I must be missing something obvious.  Any further ideas?
0 项奖励
9 条消息(共 11 条)
4,979 次查看

Hi Mike,

Thanks ! You have been most helpful !  I managed to get this working by splitting the DAQ Assistant output data stream into 4 channels, then converting each dynamic channel to a single scalar, then feeding each of these into an element of a bundle (with one node of the bundle coming from the real time clock) and then into the DB.Insert.  This worked, however insertion speed was limited to about 200-300 records per second.  This can't keep up with my 32KHz requirement so I have had to resort to using a TDMS file to buffer the incoming data.  Now I want to read the TDMS file back into the database.  I thought the output data stream from the TDMS read was the same as the DAQ Assistant output but when I perform the same conversions, my data is all zeros when it hits the database.  Any idea what I might be missing?

Thanks,

Mike V.

0 项奖励
10 条消息(共 11 条)
4,958 次查看