05-01-2019 03:54 AM
Hi there, I am trying to create a VI where when i slide my control bar, myrio will generate 3.3V for 3 seconds (say for example) then generate 1.6V
For example. When i pull the slide bar to 3, i want myrio to generate 3.3V for 2 seconds then generate 1.6V and wait for next input. When the next input from slide bar is 2, I want myrio to generate 3.3V for 1 seconds then generate 1.6V and wait for next input. This is the VI i have done but obviously it is not working. Anyone can help me please ?
05-01-2019 04:09 AM - edited 05-01-2019 04:10 AM
So I'm going to list some points along with numbers to make it easier for you to refer to them if you want:
Hopefully this can get you started in the right direction.
05-02-2019 10:18 AM
Oh there is also the MyRIO essentials guide with lots of good examples and videos of various sensors and outputs.
https://learn.ni.com/teach/resources/92
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-02-2019 10:39 AM - edited 05-02-2019 10:40 AM
Hi bao,
When i pull the slide bar to 3, i want myrio to generate 3.3V for 2 seconds then generate 1.6V
Right now your "Altitude" value is multiplied by 5000 and used for a Wait function. With an input value of "3" you will get 15000 and so will wait for 15s. Your math is somehow wrong here…
and wait for next input.
How do you define the "next input"? When does your VI "think" it got a "new input"?
(On a RIO system you don't use an Event structure for UI events as there typically is no UI…)
This is the VI i have done
No, this is just an image of the block diagram of your VI!
(Why don't you use AutoCleanup? Why don't you use the ">0" primitive?)
05-02-2019 10:44 AM
@GerdW wrote:and wait for next input.
How do you define the "next input"? When does your VI "think" it got a "new input"?
(On a RIO system you don't use an Event structure for UI events as there typically is no UI…)
Fair point on the (possibly/probably non-existent) UI, although I got the impression it was intended to run this essentially from the development computer with the UI open/available. Maybe the "slider bar" is an actual lever and is connected to AI or something, or will be controlled over a network connection whilst the myRIO runs headless, in which case as GerdW says, definitely don't look at the Event Structure as a solution.