03-21-2011 10:08 AM
I am a new user in Labview and has minimal knowledge on this software. As a part of my project I need to control a Stepper motor using a phidget (Unipolar stepper motor controller). In my case what needs to happen is listed in the steps below
1) on selecting run the system is initialised and detection occurs to see if the phidget is attached
2) User on clicking a button open the stepper motor will turn a certain number of revelutions to open the barrier
3) Next on clicking close the barrier closes down i.e. the motor turns anticlockwise
I have used the phidget examples provided to study this and the value at which the barrier is closed is '0' and the value at which the barrier opens in '14000'
how can i set my switch to do this?
03-21-2011 10:15 AM
Best to use is a simple "state machine", you can search for that term in the forums.
In the initialise state do you first step
in your Idle state, you wait for a user interaction.
if the user presses the open button you go to a state where you do step 2
if the user presses the close button, you go to step 3 and close the VI.
03-21-2011 10:28 AM
As Bjorn said, a state machine is probably a good program architecture for you.
Since you are not very familiar with LabVIEW, a good starting place it the on-line tutorials.
You seem to have a reasonable specification for your project. Before you start writing code, I strongly recommend that you design it first. A state chart or a flow diagram is a good way to show what the program will do at each point. For example you have not specified any error handling. What will the program do if the phidget is not attached? How long will the program keep the motor energized if the sensor or revolution counter never reaches the 14000 threshold? What happens if it goes way past 14000, that is, it does not stop? By planning all these things first you will find it much easier to write the program and more likely that the program will actually do what you want it to.
Is this a school project, work, or something you are doing for yourself?
Lynn