LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To synchronise timing for data acquisition

I have written a code to generate a certain voltage say 10 volts and switch it off after a certain time interval. I want to measure voltage from another source for the same time as the voltage is switched off. How do i trigger the DAQ assistant to read and record the measurement only for the time when the output voltage goes from 10 volts to 0volts to the time when the output voltage goes from 0 volts to 10 volts, that is the time when the output voltage is switched off , i want to acquire say 100 samples, how do i synchronise my data reading time.
0 Kudos
Message 1 of 9
(3,528 Views)
Can you describe more details about your application? Will it be software timed? If so, you can do this with some simple programming in LabVIEW. You will have to create another task to do the acquisition. This means adding another DAQ Assistant to the block diagram and choosing Acquire Signals, etc. You could then use a sequence structure and a loop to first generate the voltage for a certain amount of time, acquire for a certain amount of time, and then loop back around and start over.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 2 of 9
(3,491 Views)
I have creat 2 DAQ assistant - one to generate voltage and another to measure the voltage. I have chosen the internal clock for teh timing. I want the code to run in such a way that the voltage generation and voltage measurement takes place at the same time without any delay. For example i generate 10 volts for 2 secnds and switch off the voltage for 5 seconds , i want to measure the input voltage for that 5 seconds when the output voltage is zero. I have been successful in switching on and off the output voltage and also read/measure the input voltage but my problem is i am not able to synchronise the timimng of measurement of the two DAQs. I need to record the data immediately after the output voltage switches to zero and stop recording immediately after the output voltage switched on to 2 volts. Please help.
0 Kudos
Message 3 of 9
(3,482 Views)
Were you able to try my suggestion above using sequence structures? What exactly is going wrong when you say they are not synchronized? Can you post a screenshot of you code so far? Maybe this can help us better help you.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 4 of 9
(3,452 Views)
Please have a look at the following attached code i have written for my requirement. I have written a code to generate output voltage and ameasure voltage simultaneously, for this i have used a common sample clock. However it doesnt work in the sense that when i set the AI sample clock as dev1/ao sampleclock the code doesnt run properly. In the second code i have tried using a shared start trigger but there also seem to b some problem. My requirement is that i need to generate a certain output voltage with some noise (say a square wave of amplitude 10 with noise) for 10 seconds and then want to switch off only the square wave for another 10 seconds but have the noise still. I also want to measure the input voltage at the same time when the output voltage just switches off till the time it switches on. So i need to first synchronise the time for output voltage and input voltage and then use a trigger vi to trigger the input voltage vi to read data n record just when the output voltage goes to zero. Please help.
Download All
0 Kudos
Message 5 of 9
(3,445 Views)
Amber,

The timing that you have implemented in you VI only affects whether the waveform you are simulating is on or off and does not affect when that waveform is actually written to the device.

If we have a sample rate of 1000 Hz this means that we will have 1000 samples per second. We can then set the Samples To Write setting to 10000 samples, which will generate the signal for 10 seconds. We can use this to our advantage to generate or acquire for a certain amount of time. I have created a simple example to show how this is done.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 6 of 9
(3,425 Views)
I have labview 7.1 and apparently u have written the code in 8.5 version and i am not able to open it. Could u kindly send me the code in a lower version please?
0 Kudos
Message 7 of 9
(3,405 Views)
I have labview 7.1 and apparently u have written the code in 8.5 version and i am not able to open it. Could u kindly send me the code in a lower version please?
0 Kudos
Message 8 of 9
(3,405 Views)
Sorry about that. Here is the code for LabVIEW 7.1.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 9 of 9
(3,367 Views)