LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Emergency HELP




1) I need to make the user Interface part i.e. the front pannel so that when the user clicks a button (lets call it "Ceck Status
"X"" for motor X and "Check Status "Y"" for motor Y) the message "01OS" will will be sent to the motor "X" and message
"02OS" will be sent to the motor "Y" when those buttoms are clicked. On the reply we would recieve the message
"01#0000000000" and "02#0000000000" respectivelly. If however one of
the bytes in red happen to be high i.e."1" then the command "01RS" or "02RS" (depending which motor it is "X" or "Y")
would be sent automaticakky, and that would reset the motors back to default, because if any of those bytes are high then
this means that the motors are busy or there is some sort of an error in them, hence cannot be moved.

2) After the first point is done the second part of the header should then be sent automatically, i.e. the command "01SB300"
should be sent first, then "01SV6000" for motor X, and "02SB300" should be sent first then "02SV6000" for motor Y
(depending which button was clicked by the user at the beginning. If everything has gone smoothly on the above points,
there should be a "green light" for each motors i.e. for X and Y and if this initialization wasn't done properly there should be
a "red light" for both motors, indicating that something has gone wrong depending which motor was used.

Below is an attachement of the program that communicates with the hardware called PM341, which WMassey built it for me.
This program only works when i sent the actuall commands i.e. when I select device address 1 and send the command "RS" I recieve a reply "01#OK" because I am actually sending "01RS" (which means I am talking to the "X" motor) and when I select device address 2 and send the same command, then I recieve "02#OK" (which means that I am taslking to the "Y" motor).


 If more details are required please let mwe know.


The first and the second points are much more importent, btw I use LabView version 7.1.


thanks in advanced.
0 Kudos
Message 1 of 2
(2,468 Views)
This isn't all that difficult to do, but there is one question that will affect the architecture: does the processing you do after you click the button for the first motor need to happen at the same time as the processing you do after you click the button for the second motor. Or, is it that you only want to work on one motor at a time? If you need simultaneous control then you are going to be limited by hardware since you're working over the serial port. Hence, you will need to structure the code so that you only deal with one motor at a time. For this you just need an event structure inside a while loop, and there's examples that ship with LabVIEW that show you how to do this. I've attached a simple VI that gives you an idea. You should use this as a starting point only - there's likely a lot of details regarding the control of these motors that you will encounter as you progress with the application.
0 Kudos
Message 2 of 2
(2,424 Views)