04-30-2021 02:49 PM
This challenge has had me pulling hair for sometime now, perhaps you could offer some helpful insights for how to implement this in LabView. I have tried a combination of different strategies using DAQmx to no avail. My algorithm (thought process) is described below:
Objective: To continuously output a signal that is periodic for 38 out of 40 frames, and changes it frequency for the final 2 frames.
Approach 1: Continuously generate 2 separate signals using different virtual channels, and selectively output either one via the same output terminal depending on what frame is being executed.
Approach 2: Continuously generate 2 separate signals, where one is off while the other is on i.e. they alternate inversely. Then I can concatenate the signals (they'll even out) and output the result through a single terminal.
Any suggestions on how to effectively implement this would be well appreciated. Thanks
PS: I am working with a 8-counter PCIe 6612 device.
05-01-2021 11:01 AM
Hi ooyeniyi,
@ooyeniyi wrote:
Objective: To continuously output a signal that is periodic for 38 out of 40 frames, and changes it frequency for the final 2 frames.
What are "frames"?
Can you specify those different frequencies? What's the ratio of those frequencies?
Suggestion: when "frequency parameter" are "nice" then you could create just one signal for the whole "40 frames" duration…
05-01-2021 11:22 AM - edited 05-01-2021 11:23 AM
Why not generate one signal and change it's duration and frequency as required?
05-01-2021 04:33 PM
@RTSLVU wrote:
Why not generate one signal and change it's duration and frequency as required?
I agree. The 6612 supports buffered counter outputs (thanks, NI!). You can define an array of paired pulse params (Freq/Duty Cycle or High Time/Low Time) where the first 38 have one frequency and the last 2 have another. Configure for Continuous Sampling with Implicit timing, write the pulse params before starting the task, and that's about it.
There's even a shipping example for buffered counter output you can use as a starting point.
-Kevin P
05-04-2021 02:52 PM
Thanks Kevin and RTSLVU. The suggested example Counter Buffered Continuous Output opened my eyes to a the possibility of using array indexes to reconfigure the output signal. However, pursuing this does not seem like the most efficient situation for me because I would need to enter multiple array indexes (well over 100) of repeat patterns before arriving at the final 2 frames where a different configuration is taken up.
In this application, a frame contains 250 pulses, each with a period of 100usecs (i.e. 50usecs high and 50usecs low).
Using AND/OR logic gates to combine individual input signals into one desired output signal seems to be the most feasible solution at this point. I am unable to implement the logic using LabView software, so I intend to use an add-on hardware. Thanks a lot for the helpful responses.
05-04-2021 05:47 PM
It isn't nearly as hard as you seem to think. Here's how simple the code can be for creating the array of pulse parameters you need:
Start from the shipping example for continuous buffered counter output. It's already configured to want pulse params in terms of high time / low time. Just use the result above as the data to wire into DAQmx Write.
- Kevin P
05-05-2021 11:37 AM
Thanks for the help Kevin. I am unable to drag the image into my block diagram, so I am trying to recreate your code but having trouble recreating the pulse parameters. How can I setup the pulse parameters?
05-05-2021 07:37 PM
The pulse params are just a cluster containing 2 DBLs, high time first and low time second. It would be pretty easy to build from scratch.
Another thing you could do is go to the buffered counter output shipping example. First save it under a new name in a folder of your own before making any changes. Then on the diagram, right-click the 'Output Array' terminal and choose "Create Constant". Then right-click the new constant and choose "Change to Element". That'll get you the same scalar cluster so you can build up your array of them.
-Kevin P