LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading/writing mutiple charts from binary file

I am having problems in reading the binary file generated by Signal_Monitor_Write_Binary_mod_3ch.vi (3 different
sinwaves are gen'd by create sinwave.vi)
 
A data-type error is generated for binaryreader_3ch.vi, it is coming back with incompatible datatype errors. What
on earth is going on here?
 
The vis are attached, what am I doing wrong?
 
many thanks
 
Javed
 
 
0 Kudos
Message 1 of 6
(3,269 Views)

Finally making progress!

The way I am now attacking this problem is using datalog files. In the Write VI I am firstly stripping only 1 channel from the 3 channel DAQ converting this from Dynamic Data to a waveform of type Double, this is the second element of a cluster I have created. I store a timestamp string in the second element of the cluster. Then the output cluster is written to a datalog file.

I can read the datalog file back using code based on the example Read_Datalog_File_Example.vi which seems to output a portion of the waveform each time you click next record. My next problem is trying to graph the data in one go. I have tried using the Chart.VI but currently having problems with datatypes, second element of waveform double is accepted fine but the first element the timestamp it states it is a scaler. Working on how to sort this.

Best regards

Javed

0 Kudos
Message 2 of 6
(3,248 Views)
Hey Javid,

Is there any reason why you are generating the three sine waves with different lengths? Can all the arrays be of same length but the higher frequency sine wave(s) have more cycles within the array?

See what happens with your current implementation:
0 Kudos
Message 3 of 6
(3,228 Views)
0 Kudos
Message 4 of 6
(3,226 Views)
Well spotted, i just used the sin wave as simulated inputs to show the code in operation the actual signals are volatges all sampled at the same rate and
for the same time.
 
I have gone away from writing/reading mutiple charts and will now split the dynamic array into 3 and store each of these 3 waveforms into 3 seperate
datalog files.
 
The data as I have stored it is 2 element clusters, the first cluster is a timestamp of format %j%H%s%4u that is day no, hour, second, fractional seconds (I just noticed
that I forgot the minutes) and the the 2nd element is the actual waveform stored as a 1d array. Now I can read this back using Nat Ins example program Read Datalog File Example.vi but it only displays snippets of the waveform and I need to keep clicking next record to show the whole waveform. Anyway of charting all the data in a datalog file
in one go.
 
I have tried writing to an array then using waveform but datatype incompatibilty rears its head.
 
The datalog file and read vi is attached, any guidance greatly appreciated.
 
Regards
 
Javed
0 Kudos
Message 5 of 6
(3,219 Views)
Hi Javed,

Refering to your orginal post,

To read the binary file you wrote you must use the exactly the same fromat to read as you use to write.  when using dynamic data (navy blue wire) it is hard to recreate the same data type.  This is because it contains so much data.  

An easy way to recreate the data control is to drag your graph from your write vi to read vi, change it to a control and wire it to your data type inpue in your read binary file vi.

See vi attached and reply with any further questions.

Regards,

Seamus

AE NIUK
0 Kudos
Message 6 of 6
(3,205 Views)