09-08-2010 09:28 AM
hello everyone,
I would like to know how to control a while loop using case structure?? I would like the person to check if object A is in its home position or not,
if it is, then proceed....
The object should then perform its task as mentioned in the while loop... like move 10blocks up and down...
Later on, when it comes back to its home position, all the process should stop...
I have checked various forums on this http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loops-inside-a-case-structure/m-p/591259
this is the nearest I can have... but can anyone tell me how to program for this/?? How the logic should be??
Solved! Go to Solution.
09-08-2010 09:45 AM
The thread you linked to centers around a state machine, and it sounds very much like what you need is a state machine. Do you know what a state machine is? If not, I would suggest reading this article: Application Design Patterns: State Machines
09-08-2010 09:55 AM - edited 09-08-2010 10:01 AM
It sounds suspiciously like you are looking for a "state machine".
I whipped up a Day-Off.vi snippet as an example. Is it similar in structure to what you are looking for?
09-08-2010 10:06 AM
Hey Jeff, can you please tell me what the Bool RefNum is doing??? I think it might be helpful....
09-08-2010 10:38 AM
@CrackJack wrote:
Hey Jeff, can you please tell me what the Bool RefNum is doing??? I think it might be helpful....
That's an artifact (read: limitation, a.k.a "bug") from the snippet creation. Inside the loop is a property node directly linked to the front panel Boolean control.
09-08-2010 11:02 AM
Hey Smercurio_fc, I was going through the application design and I clearly understand the logic of programming,
but I am failing to find the right way to implement the logic,... ex., i find it difficult how to reference a loop condition, using shift registers and stuff...
can you guide me where can I find a note/material which specifies how to build VIs.... ???
09-08-2010 12:19 PM
http://www.ni.com/academic/lv_training/how_learn_lv.htm
09-08-2010 01:30 PM
NIquist, thanks for the link, but I am trying to understand howt to build state machines...
If we open a new VI, there is an option of create from a sample State Machine... however, I would like to convert my current VI into a state machine itself, Iam unable
to create new Type Defs which can be linked to my case states... I would like to know if there is any document which states tat/??
09-08-2010 02:02 PM
I understand what you're trying to do but you need to understand that you're getting ahead of yourself. You need to learn the basics of dataflow, structures and functions before you can combine them into an architecture such as a state machine. Once you understand the basics of LabVIEW you will be able to open the state machine template (or write your own version) and easily see how to modify it it to suit your own needs.
09-08-2010 05:31 PM
Hello,
I have been trying to learn state machines, and this is one of the simple examples that I came across, I am basically trying to
read from an analog input using DAQ assistant, and changing the tabs...
I would like the DAQ assistant to continue reading the analog input and write the same data on a txt file even when the tab is changed...
How can this be acheived? If I am able to do this, 75% of my code is finished...
Can anyone please suggest/???