05-18-2012 03:01 PM
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.
05-21-2012 07:45 PM - edited 05-21-2012 07:46 PM
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,
05-21-2012 10:36 PM - edited 05-21-2012 10:37 PM
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.