Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Syncronising analog output to continous input loop

I work with a M Series PCI card and already developed serveral applications before where I syncronize several inputs and outputs (RTSI and PXI systems).
I now have a syncronized analog and digital inputs in continous aquisition mode, that should keep running all the time.
In certain situations, I want to generate a signal on my analog output. In this situations, I would like to have a sycronisation to the inputs. That might be something like starting the output pattern at the same time the next bunch of input data is aquired or to know which aquired samples correspond to the output pattern. My tests placing the Start/Stop operation for the output in the input loop showed so far, that I'm at +-10 data points timed at 3kHz. But I will go up to 250kHz later on, so that timing won't be too great.

Any ideas appreciated.

Felix
0 Kudos
Message 1 of 9
(3,750 Views)
Hello Felix,

Before I can give any specific answer, I need to ask a few questions:
1. What hardware are you using?
2. Which version of Labview and drivers do you have?
3. You are reading at 3 kHz, but how many samples do you send to the application at a time.

Please correct me if I'm wrong, but here is what I understand:
You are acquiring analog and digital inputs continuously at 3kHz.
When your data arrives in your application, you check it to see if a pattern has been received.
If yes, then you want to generate an output that starts when the next group of inputs arrives from the buffer.

If the application is small, could you send me a screenshot or the VI so that I can have a better look at it?

Best Regards,
0 Kudos
Message 2 of 9
(3,700 Views)
Hi,

Hardware is a PCI-6281, LabView is 7.1., the drivers are up-to-date (less than half a year after the installation of the lasted drivers).
The aim is to go up to 250 kHz (2 AI multiplexed).
The idea is:
* Analog Signal 1 (ai0) and Digital Signal (DI) are correlated and I'm interested in the AC-part of ai0. So I need to have them aquired simultanously. That works fine.
* In addition I want to continously monitor DI.
* In normal operation, the analog output (ao0) is set to a fixed value (Working point).
* To find the working point, a voltage ramp is applied to ao0 and in addition to ai0, ai1 is measured as well.

I'll get you a screenshot with comments as soon as time allows.

Felix
0 Kudos
Message 3 of 9
(3,691 Views)
Ok,

a picture is worth a thousand words.


Felix


Message Edited by F. Schubert on 04-24-2008 05:32 AM
0 Kudos
Message 4 of 9
(3,685 Views)
Hi Felix,

looking at your image, I don't exactly understand what should be synchronized.
The way that you start your analog output, it will be sampled with the same clock, but will start when you press the button in the second loop. As you can see,
there is a time delay in that loop, which means that you will only read the button at most every 10 ms.

You may want to read what is sais in this thread. Some of the ideas I think apply to you too:
http://forums.ni.com/ni/board/message?board.id=250&message.id=24851&requireLogin=False

Best Regards,
0 Kudos
Message 5 of 9
(3,667 Views)
What is missing on my code shown (already tried other aproaches as well) is the syncronisation between ao and both ai.

For the ao-loop, don't care about the 10 ms wait, thats just for testing.
About the sample clock, I'm unsure if you're right that it will be the same. It's just at the same rate, but there is also an ao/SampleClock available. Furthermore, I can't route the ai/SampleClock in the same way I do with the di-Task, as it starts running when I set the StartTask operation for the ai task.

More important is, that I want to process the signal of ai0 and ai2 for the time I applied the ramp-pattern to ao. One idea was to generate a sync'ed trigger signal along with ao and have a 2nd di-line for trigger detection. Another idea was to do it the other way round and send a kind of clock signal each time the aquisition loop iterates, so the output could start exactly when the sampling starts.

So what is missing here is the point of my second post:
* To find the working point, a voltage ramp is applied to ao0 and in addition to ai0, ai1 is measured as well.

I hope I could clarfy my thoughts a bit.

Felix
0 Kudos
Message 6 of 9
(3,658 Views)
Hi Felix,

Thanks for the additional information. In order to synchronize the input and output, you can simply use the AI sample clock as the clock for the AO also. In that way, you can be sure that they will be synchronized point for point.
This however does not help to know exactly which written point corresponds to which read point. I am still looking into how you could best synchronize the timestamps of the input and output, but I wanted to give you this information already before the week-end.

My thoughts at the time would be to try to read in the output data and see how it synchronizes with the rest of the input. Of course there would be a delay of at least the DAC and ADC conversions and propagation, but that should be relatively constant and be calculated back out.

Also consider this. Have a counter running constantly and synchronously in the background. You can then read the counter state in input and output sequences to compare them.

I hope that you can find something useful here.

Have a nice week end.
Best Regards,
0 Kudos
Message 7 of 9
(3,649 Views)
Hello Felix,

I just wanted to know if any of the ideas I gave last week have helped. Have you been able to make some progress with your application?

Best Regards,
0 Kudos
Message 8 of 9
(3,612 Views)
Hi,

as I still miss some hardware to generate the real-wored signal and some other issues went to the top of my priority list, so I didn't look further into that.
I have several workarounds in my mind that I will test when the setup is complete. Propably I will repost my ideas again, or someone else stumbles over that discussion with a new input. But this issue is not mission-critical, so I'll see if I find time then. At least, I increased my understanding of the abilities of DAQ, and that's a joyful way of earning money 🙂 .
Thanx for your help anyway.

Felix
0 Kudos
Message 9 of 9
(3,603 Views)