From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Frequency Using Two Numeric Controls

Hi,

 

I know this is quite simple, does anyone know how to control a frequency of a simulated signal using two controls.

The scenario is, when  I adjust the first knob, it should correspond to an increase in frequency also in the graph. When I  increase the second knob, it should increase the freqency also. I've used an OR function to do this, however when I adjust the second knob, it adds to the frequency of the first knob. How can I make the knobs independent of each other.

 

This is my VI.

 

freq.PNG

0 Kudos
Message 1 of 5
(3,521 Views)

I don't understand the point of having two knobs.  Do you want them to have the same value?  Why have 2 knobs instead of just the one?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,504 Views)

This is part of a bigger project of mine. I want to control my FPGA via PC host and RT host. So the other control is  a shared variable from the PC host and the oher is the control for my RT host. I want to be able to control my signal from either two of this controls.

 

 

0 Kudos
Message 3 of 5
(3,495 Views)

Logical functions only work with booleans (green) and integers (blue wires) and operate bitwise. Your DBLs will get coerced to integers and the OR will probably not get you what you want. Why not use conventional code?

 

For example, you could keep the desired value in a shift register and update it with whatever control value changed last. You stll need to watch out for collisions. What of both sides change it at the same time?

0 Kudos
Message 4 of 5
(3,479 Views)

@jamison.suade wrote:

So the other control is  a shared variable from the PC host and the oher is the control for my RT host.


Ok, let me just stop you there.  Trust me from many many failures.  Shared Variables will do nothing but get you into trouble.  Instead, you should use a messaging protocol via a Network Stream or raw TCP/IP.  This way the PC just sends a command when it needs to override the frequency.  This also give the RT controller the ability to just ignore the command for one reason or another.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 5
(3,465 Views)