03-04-2016 08:24 PM
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.
03-04-2016 08:28 PM
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?
03-04-2016 08:33 PM
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.
03-04-2016 08:40 PM - edited 03-04-2016 08:42 PM
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?
03-04-2016 08:49 PM
@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.