From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

CO Pulse ticks problem

Hi all,

 

I have PCMCIA type 6036E card. I am trying to generate pulses in response to encoder signal. Pulse generation worked properly at the beginning, but it just stopped generating pulses randomly. Once it stopped, it never came back to operation. I had to rerun the program.

My code is attached to this post. Encoder signal is received through PFI2 and pulse ticks are generated using counter 0. I used counter 1 to count the number of pulses generated. 

Have you guys come across similar problems before?

 

Thanks.

0 Kudos
Message 1 of 3
(3,253 Views)

Hi hyperimage,

 

Have you tried taking a look at one of the example VIs for generating continuous pulse trains to see if the same behavior occurs? This would be a good debugging step. 

 

A good example to try running on its own would be the Gen Dig Pulse Train - Continuous which can be found by navigating in the Example Finder to Hardware Input and Output >> DAQmx >> Generating Digital Pulses. Also, what connector block are you using to wire the signals externally? Are you sure you have connected the signals properly?

 

You also mention that the pulses are being generated in response to an encoder signal, but I don't see anything in your code that indicates that you are using a trigger controlled by an encoder signal. How does the pulse generation respond to the encoder signal?

 

Regards,

James D.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,235 Views)

Hi hyperimage,

 

How long does the program run before it stops working?  I noticed that your top loop does not have any execution timing so your code is polling for errors as fast as the computer will run.  Also, I would replace the DAQmx stop task with a DAQmx clear task and add a DAQmx wait until done VI before checking for errors.  

 

counter.png

Cole R.
National Instruments
Software Engineer
Message 3 of 3
(3,231 Views)