36
Programming Example
The previous example is now expanded
to include some I/O events.
Example 1: It is desired that an output
turn ‘On’ when the extend
position is reached and stay
‘On’ until the retracted
position is reached – use
output 6 (06). The address
for Output 6 (06) is zero.
Figure 4-7. I/O Example
In PRG mode, go to ‘Program
Segments’ and select Segment 1
(Program #10) Exit Conditions:
PROGRAM#[ 10 ]
↑
QUIT F1
SEGMENT#[1 ]
<SEL F2
EXIT
F3
CONDITIONS
↓
EDIT
F4
Press Edit–F4.
SEGMENT#[1 ]
↑
QUIT F1
DEL
F2
OUTPUT EVENT
F3
CONDITION
↓
EDIT
F4
Press Edit–F4 again. The following
screen should now be up:
↑
QUIT F1
1 START
DEL
F2
2 [END EQ ]
INS
F3
3 END EQ
↓
SAVE F4
We will now enter a single logic equation
to turn ‘On’ output 06.
Press <INS–F3.
SELECT SYM OR
↑
QUIT F1
VAL TO INSERT
ACPT F2
SEL
F3
OUTPUT TO
↓
EDT
F4
The Up/Down arrow keys are used to
select the options which appear in the
bottom row. Press Up/Down arrows until
‘OUTPUT TO’ is reached, then press
ACPT–F2. Press <INS–F3 to get above
screen again; select IO#[ ] and press
<EDT–F2.
SELECT SYM OR
↑
←
F1
VALUE TO INSERT
→
F2
F3
I O#[ ]
↓
F4
Enter ‘6’ and press ‘ENTER’ key, then
press ACPT–F2. The display will go
back to the first screen above and show
as:
↑
QUIT F1
3 I O#[ 6]
DEL
F2
4 [END EQ ]
INS
F3
5 END EQ
↓
SAVE F4
Note: Address 06 will actually cause
the physical output number 1 to turn ‘On’
(See I/O Address Assignments in Tables
3–1A and 3–1B).
You can use the Up/Down arrow keys to
scroll through the equations entered. It
should appear as:
1 START
2 OUTPUT TO
3 IO# [06]
4 END EQ
Note: Brackets appear in F3 field to
highlight the port to be selected.
Press Save–F4 to save to RAM. (Be
sure to go to CFG mode and save to
FLASH Memmory when done).
Now when the axis is extended at the
end of Segment 1, the output ‘06’ will go
‘On’.
The next step is to program Segment 2,
(the retract motion) with an Exit
Condition as above, except that the logic
equation to enter is:
1 START
2 OUTPUT TO
3 NOT
4 IO# [06]
5 END EQ
Use the same sequence as above to
enter the equation. Now when the axis
is retracted to the 0.0000 inch position,
the output will turn ‘Off’.
A logic equation can have up to 256
elements for each event. Also, the
equation can include axis positions and
variables as arguments. Refer to the
Programming Reference Manual to learn
how to use all of event logic capabilities.
Jump Instruction
The Jump command is used to program
‘branches’ or ‘repeat’ cycles. There are
two types of Jumps – an Absolute Jump
or a Conditional Jump. Jumps are
allowed only in segments and only from
one segment to another. Therefore, all
branches or loops are within a profile.
The previous example can be
programmed to run continuously and
repeat the two segment motions as long
as the run switch is ‘On’. The Jump is
programmed as follows:
Go to PRG mode and select ‘Program
Segments’ for Axis 1 Program 10 (as
previously programmed) for ‘Edit’.
Select (<SEL) segment #2, Edit, then
use arrow keys to select the screen for
Jump Conditions.
PROGRAM#[ 10 ]
↑
QUIT F1
SEGMENT#[2 ]
<SEL F2
JUMP
F3
CONDITIONS
↓
EDIT
F4
Use the arrow keys to obtain the
following screen:
SEGMENT#[2 ]
↑
QUIT F1
<DEL F2
JUMP TO
SAVE F3
SEGMENT#[ ]
↓
<SEL F4