11-04-2010 06:44 AM
Hi,
I'm using a SCXI-1000DC with a SCXI-1600, a SCXI-1531 and a SCXI-1163 to receive an analog signal from an accelerometer and send a digital signal.
I have two "while" loops to constantly monitor each one of the signals. With the program like this, I don't have the two signals sincronized, and I need it, to in the end have a waveform graphic with the two signals.
Can this be done in software? I analised some trigger examples, but I don't understand them at all!
I'm using a 25k rate and a 12,5K samples per channel on DAQmx Timing.
I hope you can help me.
Thanks
Silvia
11-04-2010 07:20 AM
You can sync them on the hardware level when you use the same refernece clock (ai:ReferenceClock). You can set this for the DO using a DAQmx timing property node.
However instead of wrinting 1 sample to the AO, you need to write the same number of samples as you read in the ai loop. (not sure about this, propably it also works with different number of samples, but 1 would be too slow).
See here for some examples:
http://zone.ni.com/devzone/cda/tut/p/id/3615
Fig 5 shows the shared reference clock.
You do not need a start trigger, as the reference clock will start running once you start the ai task (just start the do task before).
Felix
11-04-2010 10:05 AM
Hi Felix,
First of all, thanks for your help.
I made some changes in the program, but I still have some doubt.
How can I put the same number of samples of an analog input in a digital output? Is this possible?
Another thing, this error appear when I stop the program, "Error -200077 occurred at Property Node DAQmx Timing (arg 1) in DAQmx Timing (Sample Clock).vi". It seams that digital output don't like sample clock!
Thanks
Silvia
11-04-2010 10:38 AM
How can I put the same number of samples of an analog input in a digital output? Is this possible?
Just use the Initialize Array prim with the 'samples' terminal as input and get an array of appropiate size with all values T or F.
About the error, I'm not familiar with your device. You need to check that your DO is capable of digital waveforms. If it is an PFI channel, it's possible that it's only capable of static DO. Do you have a diffrent chanell available that isn't PFI?
Felix
11-05-2010 09:57 AM
Hi,
I think it's only capable of static DO, because it said that should be "On demand" in the error.
Another thing, it's possible to have the waveform in order to the time, instead of the number of samples?
Thanks
Silvia
11-05-2010 10:02 AM
Hello Sreis,
What device do you use to comunicate with SCXI.
Task synchronization between your analog and digital
is done by your communication card. Some cards do not support the
generation of digital pattern, but simply on request "("on demand").
It appears that your card can not do digital pattern generation, I invite you
to check if your card allows for the buffered digital generation.
Best regards,
Rémi D.
National Instruments France