12-24-2014 01:31 AM
Hi Everyone ,
I have coded a program that if i click a button ( switch untill released) . inside that structure should work only one times .
and i have coded and its working fine .. but its looks compilcated..
i need some simple solution . Plz help me guys
12-24-2014 03:42 AM
Please attach the code in 2012 version.
12-24-2014 04:49 AM - edited 12-24-2014 04:50 AM
Hi saran,
yes, using local variables is too complicated when shift register (or feedbacknode) will do the same!
THINK DATAFLOW!
- use proper datatypes: when you just need a counter use an integer instead of floats!
- you can connect integers directly to case structure selector input!
Note1: your indicator "F01_***" should be located outside of the case structure…
Note2: there should be a wait function inside of your while loop…
12-24-2014 02:12 PM
I agree that it is complicated. It is also obviously a class assignment. I'm pretty sure you didn't understand the assignment, but I can't help you with it because you didn't tell us the exact wording of your homework.
If your goal is for you to learn LabVIEW, then my advice is to do your own work and talk to your teacher(s) and classmates. In addition, look at the numerous "Getting started with LabVIEW" tutorials, on-line lessons, etc., and work the examples. You can also write little programs for yourself, experimenting with different ways of doing things.
If you are experimenting, something you might find instructive (particularly for "little programs") is to go to the Block Diagram, turn on "Highlight Execution" (the fifth symbol on the Toolbar, looks like a light bulb), and then run your code while the Block Diagram is visible. LabVIEW works by Data Flow, and this will illustrate the data flowing through your program (it's kind of fun to watch, too).
Bob Schor
12-24-2014 03:08 PM
saran1988 wrote:I have coded a program that if i click a button ( switch untill released) . inside that structure should work only one times .
and i have coded and its working fine .. but its looks compilcated..
i need some simple solution . Plz help me guys
Your code has very little to do with what you are describing.
12-24-2014 07:44 PM
HI ,
is it possible to do without incrementing (+1) ,
beasuse inside that loop i am going to use three case structures each souldworks only on time when i press button.
12-24-2014 11:09 PM
12-26-2014 12:52 AM
@SaranVenkateshS wrote:
Hi Everyone ,
I have coded a program that if i click a button ( switch untill released) . inside that structure should work only one times .
Primary Rule with Boolesns:-
If you want something to work once & only once, go for Latching Mech Action (default action when you drop a Bool button like STOP/OK/Cancel). Once the code reads the Bool button's value, the button will automatically return to its original state. But you can't have local variable for Latch action booleans.
Another method to make something work once & only once is, to use Event Structures with the Boolean button's Value Change event.
So, start reading more about Boolean Mech Actions (Latch & Switch), and about Event Structures using LabVIEW Help. And, try them out by yourself, as already suggested by many of us.
12-26-2014 12:56 AM
HI parthabe,
i will try and tell you.
12-26-2014 02:06 AM
@parthabe wrote:
Primary Rule with Boolesns:-
None of these have anything to do with the problem here. He has an outer case structure connected to a switch action boolean. Inside the true case is another case structure that should only be true whenever the outer boolean just turned true.
To possible solutions without using any numerics: