Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

CO.PulseDone oddity

I programmed USB-6251 board to generate finite pulse trains on digital start trigger similar to the example http://decibel.ni.com/content/docs/DOC-4131, the difference being that I use DO to output byte arrays of the same length as the finite counter pulse train.

 

I am reading CO.PulseDone property to make sure that train went through before sending new DO data, and the behavior of this property is odd - once out of every 50-100 cycles it would not show the "TRUE" state at all, even though I could clearly  see the pulse train on the scope. Moreover, if I slow the program down, i.e. via "highlight execution", it always read "FALSE". It seems like it stays TRUE for short period of time right after train is complete, and if there's any delay in the software, it misses it?

0 Kudos
Message 1 of 7
(6,220 Views)

Hi Fedor,


I reviewed the example and I see a couple of different things that could be going wrong.  Would it be possible for you to post your code?  I think you may want to use, the DAQmx Wait Until Done VI instead of reading that property.  Regardless, if you post your code I would be happy to look at it to see if I could help.

 

Regards,
Dustin D

0 Kudos
Message 2 of 7
(6,201 Views)

Here's a sample sub vi. It uses counter 0 to output 83 pulses on a rising  edge of the PFI15 line. Port 0 is configured to use the counter as a DO clock. It works for 30-80 cycles, than it gets stuck on the while loop inside the for loop.

 

 

0 Kudos
Message 3 of 7
(6,193 Views)

Hi Fedor,


I noticed that your data array to output is 100 x 83 bytes in size.  I may need more explanation about what you are trying to do so maybe I can suggest the best way to accomplish it.

 

Regards, 

Dustin D

0 Kudos
Message 4 of 7
(6,167 Views)

Dusting,

 

The code is just for demonstration of the problem I encountered with the   CO.PulseDone property. 

 

What I am trying to to is to issue 83 bytes from the port0, do a measurement (not shown in the code, since it's not relevant), then go to the next cycle and issue next 83 bytes. I was trying to use CO.PulseDone property to make sure the counter finished with the pulse train and ready to receive the next trigger.

 

 

100x83 array is to make the for loop repeat 100 times with different data packets for testing

0 Kudos
Message 5 of 7
(6,162 Views)
P.S. By the way, I tried using "Wait Until Done" on the counter task inside the loop instead of reading the property, and it does not return until it times out. I guess re-triggerable task is not considered to be "done" at any point?
0 Kudos
Message 6 of 7
(6,128 Views)

Fedor,

 

I'm able to have the Wait Until Done execute on my system after a trigger is received and the pulses have completed generation.  I do have a problem getting the way your data is setup to output in the manner your're expecting.  Do you receive errors from those VIs if you run in highlight execution mode?

 

Regards, 

Dustin D

0 Kudos
Message 7 of 7
(6,111 Views)