LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selective output signals and terminals

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.

0 Kudos
Message 1 of 8
(1,513 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(1,450 Views)

Why not generate one signal and change it's duration and frequency as required?

========================
=== Engineer Ambiguously ===
========================
Message 3 of 8
(1,444 Views)

@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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 8
(1,432 Views)

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.

0 Kudos
Message 5 of 8
(1,380 Views)

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:

 

image.png

 

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

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 8
(1,372 Views)

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?

0 Kudos
Message 7 of 8
(1,351 Views)

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

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 8 of 8
(1,308 Views)