Click here to learn the biblical way to get to heaven! (The most important page on this site)
You can have your very own virtual server though VPSLink! Using REFERRAL code MJDCDJ you will receive a 10% discount on
your new account, and I will get a service credit on my account. My personal preference is the Link 2 package running XEN for starting out (You can upgrade any time). You can choose from a variety of Linux distributions such as CENTOS, Fedora, Debian, and Ubuntu. This is a great package for learning Linux,
and setting up your own web page, or email server.
Moving an Axis
Simple movement of an axis is very easy to accomplish. First you must turn the servo on, then you must move the asis. The MSO command (Motion Servo On) can be used in logic to energize the servo, and the MAM command (Motion Axis Move) can be used to cause movement of the axis. The MSF command can be used to shut off the servo.

From
the Controller Organizer window, open the MainRoutine of the
MainProgram.
With rung 0 highlighted blue, type MSO and press enter. Or locate the motion commands on the instruction toolbar, and drag down the MSO instruction.


Double
click the ? Next to Axis, and select the axis we created earlier.
Remember it is a controller scoped tag.

The
MSO instruction also needs a control scructure. On the Motion
Control field of the MSO instruction, we must create a control tag.
An easy way to do this is to type the name of the tag where the
question mark is (Use MSOControl) then press enter.
.

Then
right click on the tag to create it (select new).
Next the New Tag dialog box appears. The data type will default correctly to MOTION_INSTRUCTION, so just press OK.

![]()
Now
we need a condition before the MSO instruction that will cause the
servo to energize. This could be any bit or condition. (such as a
pushbutton, or the done bit from a timer). For this example, we
will simply toggle a bit. From the instruction toolbar, drag down
an XIC instruction, a branch, and the “OTU” instruction.
Place them on the rung as shown:

On
one of the question marks, type 'servo_on'.

![]()
Since
this is an undefined tag, we must declare the tag in the tag
database. We'll just make this a controller tag to make things
simple. To declare the tag, right click on the tag name, and select
New 'servo_on' from the options list.
In the New Tag window, be sure the tag is going into the controller tag database, then hit OK.
![]()


Drag
the servo_on tag you just created to the other instruction (having
the ?) You will see a grey box as you approach the ?. Move close
enough, and it will turn green. When you see the green oval you can
drop the tag. Both instructions now use the same variable. You
will see that as soon as you toggle the servo on later in this
lesson, the MSO will be executed, then the processor will unlatch
(or shut off) the bit you toggled on.

You
are ready to finish your online edit, and energize the servo. Click
'Finalize Edits' in the online edit toolbar. This is the equivalent
of doing an accept, test, and assemble, but all in one step.
You will get a warning asking you to ensure you want to
finalize the edits. Read the warnings, then choose Yes.

Next
right click the servo_on tag on the XIC instruction, and toggle the
bit. The servo should come on. You will notice the servo_on bit
does not appear to turn green. This is because as soon as we turn
the bit on, the MSO is executed, and the bit shut off by the
unlatch. We only need to pulse the MSO command to turn on the
servo.

Using
a similar procedure as documented above. Add the MSF instruction so
we can shut the servo off. Don't forget to right click on the
MSFControl tag and the servo_off tag to declare them for use in
logic. You must also finalize your edits as you did when entering
the MSO instruction. When finished your MSF rung should look like
this:
Right click and toggle the servo_off tag on the XIC.
Ensure the servo shuts off when the command is executed.
Now that you know now to turn the servo on and off,
let's set up the MAM command in logic (Motion Axis Move). We should
be able to cause movement of the axis.
On the end rung, type MAM and press enter. You could
also drag a new rung, and the MAM command from the instruction
toolbar if you wish.

Finish
setting up the new rung as shown below: Dont forget to right click
on the MAMControl, servo_move, and MyPosition tags to declare them.
You must also finalize edits when you are finished since we are
online with the controller.
Toggle the servo_move tag. See if the axis moves.
Change the position. Remember there are 100 revolutions per mm on
the position, so changing the position from 2 to 3 will cause 100
revolutions in the positive direction. From 3 to 2 would cause 100
revolutions in the negative direction. After changing the position,
toggle the servo_move tag again to execute the MAM command. If you
were to look in the help file, a move type of 0 means the move will
be absolute. This means that you enter exactly where you want the
axis to be in the position field. For incremental moves, you enter
how far you want the axis to move from it's current position. Merge
is used to terminate motion produced by another motion
instruction.