LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized AO and Digital pulse train

I modified the Sync AO and DO to output a DC value synced with a digital pulse train. The idea is that AO channel takes a step and digital port fires a synced pulse train for every step. Unfortunately, when inside a for loop, I am not sure how to stop the task and make the AO take the next step. Right now, it just takes the first value and cannot trigger again since the task is still running. Placing the DAQmx stop task vi anywhere in the loop doesn't work. Will appreciate any help.

 

Thanks,

Rahul 

0 Kudos
Message 1 of 4
(2,439 Views)

rahulfx16-

 

You can place a while loop inside the foor lop and set it up to run one iteration for each of the triggered events. Or you can use sequence structures inside a for loop. You could also use queues to do this too; but I think a good example to look at is:

 

http://decibel.ni.com/content/docs/DOC-8473

 

🙂

Sam S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,410 Views)

Thanks Sam for the advice.

 

I was able to get it to work by feeding the whole waveform directly but changing the data rate to a integral value of the digital waveform. Since timing is not the biggest issue, it suffices for now. Here is the working version. I also wanted to output two analog outputs in a similar manner instead of just one but when I include both the AO channels it gives me a error (Error -50103) while the single AO channel version works. It will be great if both analog outputs worked. I do not understand the discrepancy since everything is similar.

Download All
0 Kudos
Message 3 of 4
(2,402 Views)

Gooood Morning rahulfx16-

 

Error -50103 Is a resource error http://digital.ni.com/public.nsf/allkb/485201B647950BF886257537006CEB89?OpenDocument

Typically I means you are trying to write or read from the same resource without properly closing the refernece. 

 

Here are some examples of dual AO

http://decibel.ni.com/content/docs/DOC-3457

http://decibel.ni.com/content/docs/DOC-4969

 

I think this should get you going 🙂

Sam S
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,389 Views)