From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control a robot motion via 5 Boolean Switches

Hi All

I have a vi that i want to control the motion of a robot ( Forward, Backward, Right, Left, and Stop) Which are five states.

I need these states via Boolean switches (It looks like a cross in the front panel).

When the user presses the right button the robot will move to the right according to the program I already amde to dael with robot.

When the user presses the left button the robot will leave the right state and go to the left state, so the robot will turn left.. and so on

Only one swithch can be pressed a time.

I need some body to help me to get the core ( I think state machine) that will do the transfer between the states with the given condition is met (only one switch selected from the five switches) to perform only one task from the five tasks

Best regards

Mido

(Please send the solution as LabVIEW 8.5 vi)
0 Kudos
Message 1 of 6
(2,579 Views)

Well, that doesn't sound too hard. What kind of hardware do you actually have? What are the switches actually controlling? Or, is the robot controlled via a communication protocol? You said "according to the program I already made to deal with robot." What program? Is this a LabVIEW program? If so, are you trying to modify this program or write a new one? Have you looked at the KB articles? How about the examples?

 

http://search.ni.com/nisearch/app/main/p/y/0/q/application%20design%20patterns/x/0/

0 Kudos
Message 2 of 6
(2,575 Views)

I make the communicatin between the robot and LabVIEW via ActiveX. I made the programs that deal with the motors in the robot in LabIEW 8.5 but as I mention that I need to connect all these states togther in on program.

the switches is just Boolean swithche. in the front panel. Its main function is: As any of this switches is pressed it will lead to excute the program I made to communicte with the robot to send the notor commands.

0 Kudos
Message 3 of 6
(2,565 Views)
It sounds like you should just use an event structure.  You can do this if you set the mechanical action of the buttons to switch when released.  Whenever a button is pressed, you reset all the other buttons by writing a false to them while the appropriate command is sent to the robot.
0 Kudos
Message 4 of 6
(2,557 Views)
I will try but any one has a suggestions please post
0 Kudos
Message 5 of 6
(2,534 Views)
A suggestion for what?  On using event structures? There are examples that ship with LabVIEW that show you how to use event structures. Also, did you look at the various KB articles in the link I provided previously?
0 Kudos
Message 6 of 6
(2,524 Views)