LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Given up on State MAchines please help...

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/???

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 1 of 19
(3,701 Views)

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?

Message 2 of 19
(3,681 Views)

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...

 

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 3 of 19
(3,675 Views)

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.

- tbob

Inventor of the WORM Global
Message 4 of 19
(3,660 Views)

Thanks a lot tbob can you please save it in LV 8.0/??

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 5 of 19
(3,641 Views)

OK.  In 8.0

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 19
(3,633 Views)

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???

 

 

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 7 of 19
(3,623 Views)

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.

0 Kudos
Message 8 of 19
(3,589 Views)

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...

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 9 of 19
(3,579 Views)

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.  🙂

0 Kudos
Message 10 of 19
(3,566 Views)