Hi,
I have a PXI-6221 that I'm trying to use to generate pulsetrains but running into issues.
Objective: generate 3 different continuous pulsetrains from PXI-6221 and output two 3 separate PFIs.
Problem: when I run the LabView example "Counter - Continuous Output.vi", I can see the pulsetrain generated. However, sometimes I see what looks like old tasks still running. Specifically, this is what I do and see:
- Set counter to ctr0 on PXI-6221
- Set output terminal to PFI0
- Set freq and duty cycle to 10 Hz and 0.5
- Run program, see correct pulsetrain on PFI0
- Stop program, set output terminal to PFI2
- Run program, see the correct pulsetrain on PFI2, but the pulsetrain is also being generated on PFI0. I expect PFI0 to be low at all times.
Troubleshooting:
- If I stop the program and change the counter selection, and then re-run, I see the pulsetrain generating only on a single channel again (expected behavior).
- As soon as I try to stop the program, switch the channel but NOT the counter, re-start, I get back to the same error state as previously encountered.
Questions:
- Am I neglecting to clear out a cache or something here? Do I need to do something special to clear out / restart the counters that I'm not already doing.
- Tangentially related - will I be able to generate three different pulsetrains with only two counters available on the PXI-6221? I was thinking of using the same counter to create three different, synchronized pulses (different duty cycles and frequencies, but aligned w/ each other), but the examples I've seen only have a 1:1 relation between counter to output terminal.
Thank you much in advance.
I've attached the code I'm testing, but note that this is a LabView example and I have not modified it.