Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Anologue input logging more than 100 points to text file in component works/Visual basic 6

I am using the Visual Basic 'Data Logger' script in the component works examples and I am recording 8 AI's over minutes (24Samples/S using 6030EDAQ Card) and would like to record all the dataplots to a file (not just the 100 in the buffer). Does anyone have any example script or any ideas showing me how I can record all the plots
0 Kudos
Message 1 of 4
(3,296 Views)
You can't retrieve data from the graph once it has been plotted. It is decimated for display by the graph and the original data is not kept by the graph. So, you would have to maintain the data in a variable in your program and you can write it when ever you want. The Data Logger example writes the data to the buffer each time a Data Acquired event is fired. It can be setup to keep appending the data to the file or overwrite the data with each acquired buffer.

If you don't want to write the data on every Data Acquired event, you don't have to, but you do have to keep a variable with the historic data available for logging when you want to log.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 4
(3,296 Views)
In what form do I write this. I have tried the following statement and it just tells me I have a type mismatch

Private Sub CWAI1_AquireddData(ScaledData as Variant, BinaryCodes As Variant)
txtOutput.Text = txtOutput.Text &ScaledData
End Sub

I think the problem is I don't know where the information is coming out from. I am quite new to this measurement studio. If I could just get to each single plot or to the buffer (in the form of an array), something I can manipulate then I would be happy.

Thanks for your help any more information would be so appreciated

dave
0 Kudos
Message 3 of 4
(3,296 Views)
It IS an array. In VB everything is put in a VARIANT so you don't have to mess with data types. The data in the variant ScaledData is a double safe array. You can manipulate it with array functions. You are getting an error because you are trying to set an array VARIANT (ScaledData) equal to text. If you look at the code of the Data Logger example, it shows you exactly how to convert the data into text and put it in a text file.

Chris
0 Kudos
Message 4 of 4
(3,296 Views)