09-15-2010 03:07 PM
hello everyone,
I have given up on state machine.. and trying to compile this simple program...
I am unable to compile this code, and seriously at my wits end how to debug this code.. can anyone please suggest me what is wrong/???
09-15-2010 03:48 PM
I may be missing something....
I didn't see a State Machine within the code.
I must admit that I don't have the DAQmx drivers installed, but that would not prevent me from seeing a State Machine.
I do get a broken wire for the DAQmx Task Name (Drill_Rig_AI).
Can you describe the problem that you are having and maybe point to the State Machine that you are referring to?
09-15-2010 03:55 PM - edited 09-15-2010 04:01 PM
Ray.R ... I am sorry... I had initially decided to perform this task using state machine... But then I quit...
And hence, I thought of using simple case structures...
This is what I want actually...
I would like to create a VI in which the start condition is a cylinder at position A. Once the position is confirmed, there is a motor which should be turned ON via LV.
Once the motor is ON, the cylinder should go to position B, once the cylinder is at position B, a counter should start... The cylinder has an attachment in the front which does a particular task
and once the task is finished, the cylinder should go back to position A and the system should shut off...
And in that process, I am totally confused and don't know what to do...
😞 😞
http://forums.ni.com/t5/LabVIEW/how-to-have-a-while-loop-inside-a-case-structure/td-p/1241346/page/2
this is the forum where I had been discussing about SM.... also posted my VI ter.. but posting it again here...
09-15-2010 04:35 PM
Attached is a template VI of a state machine that should fit your purpose. Just add your specific DAQ code. Hopefully you will learn how to construct a state machine after reviewing this example.
09-15-2010 06:12 PM
Thanks a lot tbob can you please save it in LV 8.0/??
09-15-2010 06:48 PM
OK. In 8.0
09-15-2010 08:01 PM
Thanks a lot tbob...
I really appreciate your help... I had one last help.. How to keep the waveform updated even if the states are changed??i Know someone has replied
me by telling that DAQ and waveform chart; both should be out of the case loop, but then will any change in the input status be updated
in the waveform if I have the waveform outside the case loop???
09-16-2010 08:52 AM
If you need a task to run idenpendently of the states or state changes, then you could use a dynamic VI (or a vi that is called dynamically and runs until it is shut down) to take care of the DAQ acquisition and updating the wavfeform graph.
If you plan to add operator buttons that need to be processed while states are changing, data is acquired, displays are updated, then you may want to include an Event Structure for the UI.
09-16-2010 09:19 AM
ohhh... okayyy.... didnt know that.... but arnt event structures time based, I mean if the operator decides not to press the button, then will the
timeout occur and the loop come out of its execution/?? please correct me if I am wrong...
09-16-2010 10:20 AM
It depends how you implement it 😉
You could have a Producer/Consumer architecture with a queue, where the queue would pass new events to be handled to the consumer (state machine) loop.
There are other nifty design structures where you could call a set of Dynamic VI's and they do their thing while the Event Structure waits for the next event.
On the other hand, you can always implement the entire solution using State Machine(s) as well. It depends on how you want the system (software) to behave. 🙂