396
INTELLIGENT ACTUATOR
Appendix
[5] Processing procedure
The processing procedure to be followed when programming this application example is
explained below:
A. Set “LF” as a character indicating the end of a character string (terminator character).
B. Open channel 1 of the RS232 unit so that this channel can be used.
C. Data sent to channel 1 is received into a local string starting from column 1.
D. If the received data was “MOVE,” the speed data is converted to a binary value and the
converted value is set in variable 10, while the position data is also converted to a binary
value and the converted value is set in position No. 1. Thereafter, the movement is carried
out and after the movement has completed, “OK” is sent.
[6] Application program
STEP No. N OP-CODE OPRND1 OPRND2 POST Comment
1 SCHA 10 Set LF as a terminator character.
2 OPEN 1 Open SIO channel 1.
3 TAG 1
4 READ 1 1 Read SIO1 columns from 1.
5
6 ISEQ 1 'HOME' Home return command
7 HOME 11 Perform home return.
8 EXSR 1 Send “OK.”
9 EDIF
10
11 ISEQ 1 'MOVE'
If the received data was a
movement command:
12 SLEN 3 Set the length to 3 digits.
13 VAL 10 5
Speed Variable 10
14 VEL *10 Set the speed.
15
16 PCLR 1 1 Clear position 1.
17 SLEN 3.3
18 VAL 199 8
Axis 1 position Variable 199
19 PPUT 1 1 Set the axis 1 data.
20
21 VAL 199 15
Axis 2 position Variable 199
22 PPUT 2 1 Set the axis 2 data.
23 MOVL 1 Carry out the movement.
24 EXSR 1 Send “OK.”
25 EDIF
26
27 GOTO 1
28 -----------
29 BGSR 1 OK send subroutine
30 SCPY 1 'OK' Set “OK.”
31 SPUT 3 13 Set “CR.”
32 SPUT 4 10 Set “LF.”
33 WRIT 1 1 Send.
34 EDSR