Output of coordinate values – IAI America XSEL-QX User Manual

Page 427

Advertising
background image

403

Appendix

20. Output of Coordinate Values

Description

Read the current coordinates of the actuator in real time and output BCD data via an output port.

Example of Use

Use a PRDQ command to read the current coordinate position of axis 1.
Output the current coordinate data of axis 1 as a BCD every 0.2 second.
The output range is 0.00 to 999.99 mm.

Assignment of BCD output
Output port No.

Description

Output port No.

Description

324 0.01

336 10

325 0.02

337 20

326 0.04

338 40

327 0.08

339 80

328 0.1

340 100

329 0.2

341 200

330 0.4

342 400

331 0.8

343 800

332 1
333 2
334 4
335 8

Unit: mm

Application Program

* Use a PRDQ command to write the current position coordinates to variable 101.
Since the value read to the variable is in the format of “XXX.XXX,” the digits not used in the BCD output
are moved to decimal places.
In this example, the third and subsequent decimal places are not used, and thus the value is multiplied by
100 to be converted to data in the format of “XXXXX.X.”
Next, the aforementioned variable is copied to a dedicated variable for BCD output, or variable 99.
At this point, all decimal digits are rounded off.
Thereafter, the remaining part of data is output to an external device using an OUTB command.
This program is used as a subprogram in the multi-tasking mode.

Assign the current position of axis 1 to variable 101.

Round off the third and subsequent decimal places.

Copy to an integer variable.

Output 5 BCD digits.

Sampling time

Advertising
This manual is related to the following products: