LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Retriggerable Problem

Solved!
Go to solution
Hello folks,
 
I am quite a new to LabView and would be glad to use some help and advices from more experienced people. Basically I am trying to make a vi that produces a square pulse of given width whenever the trigger is activated. The pulse width is the parameter that I can change from one trig to another or keep the same in which case whenever I launch the trig the pulse of the same width is produced.

Running through examples that I found on this forum and NI support I managed to make a vi that almost work.
http://forums.ni.com/ni/board/message?board.id=170&thread.id=267677
http://digital.ni.com/public.nsf/allkb/82C9F3C15F62974E86256EBA0058CAF5?OpenDocument

As you can see on the picture in order to change the pulse width I use "Pulse Width (ms)" local variable associated with While loop that checks if "Pulse Width (ms)" has been changed and if so, after the trig, makes the pulse with the new width. This part of program works.
The one that doesn't work is when no change in pulse width has been made. When I start a vi I can trig a pulse once but cannot re-trig it, unless I change the pulse width (I can change it to some new value then put back the old value and it will work but this is not convenient).
For some reason my task is not retiggerable when the False case occurs (ie. no change in "Pulse Width (ms)"), though the Start.Retriggerable parameter in property node is set to be True. Again, it works well in the True case, when there is the change in Pulse Width (ms) variable.
Could you please point out what mistake I am making and what to do to make False case retriggereable as well.

Thanks in advance!

(PS: I am using USB-6211 card.)
0 Kudos
Message 1 of 3
(2,910 Views)

Hi foruc,

 

Have you tried removing the case structure for no change in pulse width? This would mean it would just put the current pulse width through every time and not worry if it was the same as the previous.

 

Let me know if this works,

 

Thanks,

Owen.S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,878 Views)
Solution
Accepted by topic author foruc

Thank you for your reply Owen.

 

I found the error I was making. The variable "Pulse Separation" that feeds "CO Pulse Time" DAQmx event was set to 50 seconds (I didn't divide it by 1000 to make it in milisecond units). That means that even if I retrig for a new pulse immediatly after the first one, the new pulse would't show before the period of 50 seconds has elapsed (and I never waited for so long as my pulses are more in milisecond range).

 

Now it seems like a stupid error (and it probably is) but I thought that this variable was important only in the case of the multiple-pulse event (as set-up by "Timing: Implicit" DAQmx event). Actually, even if the "Number of pulses" is set to 1 (which was my case), it seems that though the retriggering works one won't see a pulse before "Pulse Separation" time has elapsed and that looked to me as if the retriggering did't work...

 

Anyway, thank you for your time Owen!

 

Cheers!

0 Kudos
Message 3 of 3
(2,868 Views)