LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State Machine Inquiry

Hello there , 

Guys now I have multi state machine " Four States " reference one and another three one and I want to access to any of the three state from my reference state to make a vending machine , as you can see in my uploaded pic , one more thing I want to know how to get a clock in this software to use it in my flip flop design . 

Thx in adv 

0 Kudos
Message 1 of 7
(2,242 Views)

Today is your first day on the Forum, and you haven't found the "unofficial rules" nor explored enough to learn how to use the Forum to best results.  Here are some suggestions:

  • Learn LabVIEW.  You should at least have gone through the Tutorial material mentioned on the first page of the Forum, taken a Class at University that taught you the basics of LabVIEW, and written some (or a lot of) LabVIEW.
  • Many of us are LabVIEW "enthusiasts", and want to help others interested in learning/using LabVIEW.  Therefore we don't "do your homework for you".
  • You will get a better response if you attach your work, preferably in the form of one or more VIs (it is difficult to edit or run a "picture", though once you start learning LabVIEW, you will learn how to do this, too).

Bob Schor

0 Kudos
Message 2 of 7
(2,228 Views)

Hello Dear first ,

My intention is learning not asking for someone to do my homework , and I watched some tutorials for this software and I tried to make some projects on it , but I problem is I don't know how to compare between states in case structure I mean , I want when no switch is pressed I stay in start state and when 1 switch is pressed I want to detect which switch exactly is pressed to do my next action , but I don't know how to make this ,

0 Kudos
Message 3 of 7
(2,215 Views)

my project files 

 

0 Kudos
Message 4 of 7
(2,214 Views)

my files

Download All
0 Kudos
Message 5 of 7
(2,208 Views)

Of, you have two different questions:

 

  1. Something about a state machine
  2. Something about flipflops

For (1) you are showing the picture of a front panel, which has zero information content. For (2), I have no idea what flipflops have to do with clocks. Flipflops is something you wear on the beach. If you were thinking about circuits, you should know that LabVIEW is a programming language, not a curcuit design software.

 

OK, so you finally posted your code and as Bob already said, your in dire need of some introductory tutorials first.

 

In the meantime, here are some initial comments on your code:

  • Never ever maximize the front panel and block diagram to the full screen. Typically you want to work on both simultaneously and maybe even have the help window open (recommended at your learning stage!). If the windows are maximized, you can only see one thing at a time, slowing down your learning process!
  • A tab is a control in all typical uses. Making it an indicator (as you did) has several drawbacks. The user will not be able to operate it at run time. Tab controls are conventionally meant to be operated!
  • Notice the coercion dot in the tab terminal? Your tab is 32bit while your enum wired to it is 16bit. Do you know the difference?
  • What a mess: You have three different enum instances, all with the same four items. A typedef'd 16bit enum for the state, a plain 16bit enum for other diagram constants, and a 32bit enum for the tab. Maintaining code like that is worse than herding cats!

So please do a few simple tutorial (or ask your teacher). Then sit down and start with a detailed description on what the user should see, how the user is supposed to used it and what should happen in what order as a result. Then translate into code.

0 Kudos
Message 6 of 7
(2,193 Views)

Definitely spend time with Tutorials (or pay attention in class) and learn how LabVIEW works.  It's not all about an Interesting Front Panel, but about thinking about what you want to do.  The Front Panel is just a means of interacting with the User (a User Interface, which some abbreviate as a UI).

 

You mention a State Machine.  What are your States?  Do you know about State Machines?  What are your States?  [What happens?]  How do you go from one State to another?  

 

Sometimes if you don't understand a complex topic (like what is a State Machine, and how do I design one), you can look at one tiny aspect of your code and write a small VI that just does that.  Since this is your problem, your State Machine, and your Front Panel, I'll leave this up to you.  But learn a little more LabVIEW first -- at least go through the tutorials, doing all of the examples (or at least reproducing them yourself on your PC).

 

Bob Schor 

 

 

0 Kudos
Message 7 of 7
(2,162 Views)