09-03-2021 04:47 PM
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:
Troubleshooting:
Questions:
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.
Solved! Go to Solution.
09-04-2021 12:30 PM
I was able to solve this by adding a device reset block after the last clear task block.
09-05-2021 06:15 AM
FYI: the problem you solved with device reset is known as "lazy uncommit". Once you set up the output for PFI0, then later reconfigured to route to PFI2, the old route to PFI0 took on "lazy uncommit" status. Which basically means that the route isn't immediately removed, but is somehow marked as being *eligible* to be overridden.
When the PFI also has DIO functionality, one could configure it to be used in a digital task as a way to get past "lazy uncommit" rather than do a device reset. A full device reset wouldn't be a good solution if you had, say, a continuous analog task also running at the time.
You can learn more by searching around here now that you know that "lazy uncommit" is the term to key on.
As to your 2nd question, No, you can't produce 3 distinct counter outputs with a device having only 2 counters. And it doesn't really make sense to describe 3 pulse trains with different frequencies and duty cycles as being *aligned*. Unless you only mean to start and/or stop them at the same time.
You might conceivably define a "correlated DIO" task for those 3 outputs and then create a counter pulse train task to act as the sample clock. But it'll be significantly non-trivial to feed the task with the exact right DO data to produce your 3 pulse trains at different frequencies and duty cycles.
An X-series device would make this much easier again b/c they have 4 counters available.
-Kevin P