Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating Complex Signal Patterns using NI USB-6351

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.

  • This is being accomplished using a CO Pulse Freq task.

2. Generate a second square pulse with a period of 200 ns on PFI 11.

  • This pulse should start on the rising edge of the first pulse.
    I am using a CO Pulse Time task to generate 5000 samples, each with a 100 ns high time and 100 ns low time.

3. Generate a custom digital pattern on Port0/line0.

  • This pattern needs to be generated for every rising edge of the second signal.
    Specifically, I need to generate 5000 random digital samples (0's and 1's), each synchronized with the rising edge of the second pulse.

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:

  • Is the NI USB-6351 capable of generating these types of signals concurrently?
  • If so, could anyone provide an example or guidance on how to implement this in LabVIEW?
    Thank you for your assistance!

Best regards,
Dileep

0 Kudos
Message 1 of 3
(176 Views)

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.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 3
(148 Views)

[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

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 3 of 3
(147 Views)