07-05-2024 03:39 AM
Hello LabVIEW Community,
I am currently working on a project involving the NI USB-6351 DAQ, and I need some assistance with generating a specific set of Digital signals. Here is what I am aiming to achieve:
1. Generate a square pulse at a frequency of 1 kHz on PFI 10.
2. Generate a second square pulse with a period of 200 ns on PFI 11.
3. Generate a custom digital pattern on Port0/line0.
I have successfully managed to generate the first two signals without any issues. However, I am encountering difficulties with the third signal. Specifically, I need to generate a custom digital pattern on Port0/line0 that triggers on every rising edge of the second pulse.
My questions are:
Best regards,
Dileep
07-05-2024 08:35 AM
You can do this by using the PFI11 as your sample clock source for the digital pattern out on P0.0. Now for every rising edge on the PFI11, a new sample from your digital pattern will be generated.
07-05-2024 08:37 AM - edited 07-05-2024 08:38 AM
[Edit: after posting, I see that Santhosh made my point #2 below more briefly and clearly]
1. My first point is a more subtle one. I would be leery of your plan to go "line to line" with the timing for your 2 pulse tasks. One counter produces new pulses every 1.000 msec. You then want to use that to trigger a second counter to produce a pulse train of 5000 pulses at 200 nanosec each. This also results in exactly 1.000 msec. Will the task be done in time to be able to rearm and be ready for the next "triggering edge" that's due to arrive at the exact same instant? Personally, I wouldn't count on it.
My advice is that you need to change 1 of your parameters to create a very little bit of "breathing room". Either give the first counter a period more like 1.001 msec, the second counter periods of more like 199 nanosec, or choose to produce only 4999 pulses at 200 nanosec. Any one of those is likely to be more reliable than going "line to line".
2. Generally, yes your device will support 2 counter output tasks simultaneous with a hardware-clocked DO task. Perhaps the key thing you need to try is to configure your DO task to use the 2nd counter's output pulse as its sample clock?
(And for future reference, be careful with terminology. DAQmx makes a clear distinction between triggers and clocks. A number of other instruments don't really support both things distinctly and may refer to the instigating signal as a trigger rather than a clock. This has been a long-time source of confusion for people getting used to data acquisition using DAQmx because the term "trigger" is used differently or interchangeably elsewhere.)
-Kevin P