Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Gen Digital Pulse Train - Finite wait until done behavior

With the Gen Digital Pulse Train.vi example modified to use High and Low time instead of Frequency and Duty Cycle, I notice that with Idle state as Low, and High time = 1 sec, Low time = 4 sec, that with 1 pulse its Wait Until Done vi returns after 1 sec (i.e. after only the High time has expired, not the total complete 5 sec of the overall pulse.  With 2 pulses, Wait Until Done returns after the expected 10 sec.  Is this related to one counter being used when one pulse is generated and two counter used for more than two pulses ?
 
LabVIEW 7.1 with DAQmx 8.0
 
Steve
 
0 Kudos
Message 1 of 8
(5,205 Views)
It does have to do with the two counters as opposed to one. If you generate a retriggerable single pulse, the initial delay applies to the first pulse and on each subsequent pulse the counter will wait for "low time" seconds before generating and the pulse done (or task done for non-retriggerable) will fire when the "high time" for the pulse has completed.  If you are generating retriggerable finite pulse trains, in order for subsequent pulses to have the correct waveform, the counter will not report pulse or task done until both the high and low times have expired.
 
If you're looking for a different behavior than this, I might be able to help you get something set up.  Just respond with your desired behavior.
gus....
0 Kudos
Message 2 of 8
(5,192 Views)

Hi there,

I have read the use of Pulse done function to check whether the finite pulse been generated. I have some problem in using this function. I am using Visual Basic 6.0 to write a program to generate a pulse and the output of the pulse acts as a input for the trigger. Before generating the second pulse by the program itself, I would like to check whether the first pulse been completed, if that s true , generation of second pulse will get started. The function is working fine, but quite unstable. It crashes the program repeatedly, is anything to be setup before using that function? Any help would be appreciated.

Thanks

 

0 Kudos
Message 3 of 8
(4,896 Views)

Hi Rajaram,

I've never seen a crash caused by this property before.  I've got a list of questions that may help us uncover some clues.

  1. What operating system are you using?
  2. Which version of the DAQ driver are you using?
  3. Does the program always crash when the pulse is at a particular state? (ie, does it always crash when the pulse is finished?)
  4. Does the entire VB environment crash, or is it just your program?
  5. Is there an error dialog when it crashes?

Hopefully this will give us some insight.

Luke
Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(4,875 Views)
Hi Luke,
 
Program crashes when I have used Pulse done function, So I have changed the function to wait until done function which solve that issue. But I can answer the questions you have asked
 
1) Operating System : Windows XP
2) DAQ driver: DAQmx 8.3
3) Program is having some unstable behaviour when I used Pulse done property, It crashes when I am trying to close the form, stop the task and start it again, or even when the pulse is getting generated. At the same time it works fine at some point of time. So I changed to Wait Until task done property
4) Vb environment got crashed
5) Just a dialog box to send error report to microsoft or not.
 
 
I have another question, Could you tell me the equivalent functions in DAQmx for
DIG_IN_LINE
DIG_OUT_LINE
DIG_CoNFIG_LINE
 
Thanks
0 Kudos
Message 5 of 8
(4,867 Views)

Hi Rajaram,

While they are not exactly the same, I'd go with:

DIG_IN_LINE>>DAQmxReadDigitalLines

DIG_OUT_LINE>>DAQmxWriteDigitalLines

DIG_LINE_CONFIG>>DAQmxCreateDIChan/DAQmxCreateDOChan
Luke
Applications Engineer
National Instruments
0 Kudos
Message 6 of 8
(4,858 Views)
I'd also recommend that you look at "Transitioning from Traditional NI-DAQ to DAQmx Using Ansi C."
Luke
Applications Engineer
National Instruments
0 Kudos
Message 7 of 8
(4,855 Views)

Hi Luke,

Thanks for your response, I tried these functions and it works fine.

 

Regards

0 Kudos
Message 8 of 8
(4,851 Views)