Installation manual
Chapter 8 PA Library
8-35
pa_chg_dio
Function
Sets teach point (PTP) DO data attribution.
Syntax
long pa_chg_dio(ARM armno, DIOSTATUSP dp)
armno Arm number (No.).
dp Pointer to the DO data attribution structure “DIOSTATUS”.
Explanation
Sets each designated port data attribution as current point DO data attribution.
(Port 1 cannot be set on account of the system activation.)
Setting cannot be performed while in playback control.
Return value
ERR_OK Normal termination
Others: Anomalous termination (Refer to error table)
Description example
DIOSTATUS dos;
:
dos.io1 = 0x01; .. PORT1 CH1 ON
dos.io2 = 0x80; .. PORT2 CH8 ON
dos.io3 = 0x40; .. PORT3 CH7 ON
:
pa_chg_dio(ARM1,&dos); .. Sets current point teach data DIO information.
DO information format inside teach data is long. Beware when putting
this format into “DIOSTATUS” type.
Example: For adding PORT1_CH1 ON, PORT2_CH3 ON and PORT3_CH8 ON to
current point DO information.
:
PNTDAT pnt;
UBYTE* ubp;
DIOSTATUS dos;
:
pa_get_pnt(ARM0,&pnt); .. Current point DO information loading
ubp = (UBYTE*)&pnt.ply.pnt.atr[6]; .. Setting with DIOSTATUS type.
dos.io1 = *(ubp+2);
dos.io2 = *(ubp+1); (ATTENTION! To each port address.)
dos.io3 = *ubp;
dos.io1 |= 0x01; ..Adds DIO information.
dos.io2 |= 0x04;
dos.io3 |= 0x80;
pa_chg_dio(ARM0,&dos); .. Setting to current point DIO information
Remark