08-10-2017 03:01 AM
Hi,
I have attached two vi files.
1. FanControllerPWM
2. PWMControl
In FanControllerPWM.vi file I have created a channel that generates PWM and a knob to vary the PWM .Using an external oscilloscope I can able to see the variation in frequency according to the variation in the PWM.
In PWMControl.vi file I have called the FanControllerPWM as subvi and I created a knob to vary the PWM frequency.
When I try to vary the frequency on the knob on the PWMControl vi the PWM frequency remains the same and doesn't vary.
But I can able to vary it from FanControllerPWM vi.
can I please know why? what am I missing here ?
Solved! Go to Solution.
08-10-2017 03:15 AM - edited 08-10-2017 03:17 AM
Hi Vikash,
what am I missing here ?
You missed the basic paradigm of LabVIEW: THINK DATAFLOW!
Explaining DATAFLOW: In PWMControl you read the current value of your knob and then you call FanController using this value. The subVI uses this value - and you wonder about it's usage? As PWMControl has finished its task it does not care about your try to change the knob value later on…
Possible solutions:
- run both VIs in parallel and use a queue/notifier to set the PWM value in your FanController! (basically a producer-consumer scheme)
- get rid of PWMControl and use only FanController…