LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving and plotting acquired data

I've changed the original program slightly to try and acquire data from multiple channels. I've got 2 pressure transducers connected up, and using the test panel within measurements and automation i can get a good signal from each channel while testing them separately. When i actually run the program to create the TDMS file of results only 1 of the channels is working properly, the one called pressure2. Pressure1 isn't giving results which are anything like they should be. The only thing i could think of was that maybe I have the timing setup incorrectly? If someone could have a quick look over the program and see if they spot a reason why its not working i'd be really grateful
Download All
0 Kudos
Message 21 of 34
(1,585 Views)

Robbo13,

 

Please post sub vi Cont Acq&Graph Voltage - Set File Properties (TDMS).vi

0 Kudos
Message 22 of 34
(1,572 Views)

when ive opened it on other computers i normally just navigate to it. It's normally in program files > National Intrumets > Labview 8.x > Examples > DAQmx > then look at the path it's trying to find and navigate to that.

If you don't have the examples installed I can post the file later when I have access to it

0 Kudos
Message 23 of 34
(1,563 Views)

Robbo13,

 

I don't seem to have that particular example.  Any chance you changed the original name?

0 Kudos
Message 24 of 34
(1,558 Views)
I'm pretty sure i didn't change the name. I normally have to open Measure Voltage.llb (in the analogue in folder) then find the file in there. It's not where you would expect though, if you go down to the other Cont Acq&Graph files it isn't with those, you have to carry on scrolling down until after the break then it should be there
0 Kudos
Message 25 of 34
(1,549 Views)

Robbo13,

 

I did finally locate the sub vi.  Monday AM   DUH  !   I can't find anything in your vi that would keep it from working.  Suggest that you double check connections to sensors.  You could also graph the waveform that is being written to the TDMS file and make sure it looks ok before the file write.

Message 26 of 34
(1,545 Views)
Thanks for having a look Wayne. I'll double check everything but it was definitely picking up a signal ok from both transducers when i tested each channel seperately. I could send you the TDMS file it recorded if that would help with finding the problem? I would've just attached it but it said .tdms isn't an accepted file format for these boards
0 Kudos
Message 27 of 34
(1,538 Views)

In your VI you are collecting 2 channels, but in your TDMS Display VI you are trying to read 3 channelsfrom the TDMS file. Obviously this won't work, and you will get an error.

 

For your TDMS Display VI:

 

  • The event structure will not work like that. It has to be in a while loop. Please read the documentation on how to use the event structure.
  • The button control should be placed in the event case so that the event case can reset the value after it has been read.
  • You do not need multiple TDMS Read VIs. You only need one, and you simply need to specify an array of signal names.
0 Kudos
Message 28 of 34
(1,522 Views)

Hi again smercurio_fc. Sorry that was confusing I had been trying to work on 2 different things at once and at the time they weren't very closely related. I've attached the actual program which I will be using to load, format and display my results. I've used the state machine structure to build this, and have based it on my 1st program so hopefully its not a million miles away from being workable.

 

This program is going to run a mathscript simulation, and plot the results. These can then be compared to the results obtained from the TDMS file. At the moment this program is trying to extract 3 channels of data, whereas the daq program is only collecting 2 channels, as you said. I will eventually change the DAQ program so that it collects 3 channels aswell, however at the moment it isn't working properly when trying to collect 2 channels.

 

So the areas i'm stuck with are currently:

 

Within my DAQ SM mod.vi (version from post #21):

  • Running the program while connected to 2 pressure transducers the channel 'pressure2' is acquiring data and saving it to the TDMS file perfectly, however the 'pressure1' channel isn't collecting proper results. When i inspect the TDMS file it's pretty much just noise on this channel. However when using the test panel in measurement and automation to check each channel seperately I can get good results from both channels. I've had the program checked over and there don't appear to be any problems

 

Within the deceleration1.vi program (i've not tried actually loading a .tdms file yet so havent come across the 3 channel error yet)

  • with the TDMS read VI how do I split up the data output into the 3 channels so that I can display it on separate charts? I tried to use the unbundle function but couldn't get this to work
  • do i need to further split up each of these channels to perform calculations on them? For example with the data in the acceleration channel I want to be able to divide the voltage values by a calibration factor to convert the voltage into a value in terms of 'g'. I don't want this calculation to affect any times which might also be on this channel.

 

I'm so nearly finished now thanks to all you helpful people, i just need to sort these last few errors out. The sad thing is our PDA hasn't been delivered yet so we might not get any actual data from the car to include in our project report if that doesn't arrive this week.

Download All
0 Kudos
Message 29 of 34
(1,513 Views)

I don't have your hardware so I can only run your code using simulated DAQ hardware. Using this, I could see that it was collecting (2 channels) and saving the data correctly.

 

As for your "Deceleration" VI:

 

  • The TDMS Read returns an array of waveforms. To pull out a specific waveform (or all of them), just use Index Array.  A waveform can be wired directly to the numeric functions as one of the terminals, and a simple scalar for the other terminal. The output of the numeric functions will be a scaled waveform. 
  • I think the main problem you have with displaying the data is that you're using the wrong kind of graph. The TDMS file is a snapshot - it's not streaming data. Thus, I think a waveform graph (not chart) would be more appropriate. 
0 Kudos
Message 30 of 34
(1,492 Views)