ATTACH program instruction Program task 0 automatically attaches robot #1 when that task begins execution. A robot control program executed by any of the other program tasks must explicitly attach the robot. Any task can attach to any robot, provided that the robot is not already attached by a different task. The robot that is attached by an ATTACH instruction is the one that was last specified by a SELECT instruction executed by the current task (see the SELECT instruction). If no SELECT instruction has been executed, then robot #1 is attached. The SELECT instruction can be used to select a different robot only if no robot is currently attached to the task.
To successfully attach the robot, the system must be in COMP mode. Otherwise (for mode bit 1 = 0), program execution is suspended (without notice) until the system is placed in COMP mode. This situation can be avoided in two ways: (1) use the STATE function to determine if the system is in COMP mode before executing an ATTACH instruction, (2) set bit 1 in the mode value, and use the IOSTAT function to determine the success of the ATTACH instruction. When the system terminal (logical unit 4) is attached, all keyboard input will be buffered for input requests by the program. NOTE: When the system terminal is attached, a user is not able to type ABORT to terminate program execution.
The program must provide a means for fielding a termination request, or you must use the pendant or emergency stop switch to stop program execution. When a DISK device is attached, it allows a program to read and write data from and to files. DISK refers to the Secure Digital (SD) card. One of the FOPEN instructions must be used to specify which file to access. WRITE and READ instructions can then be used to transfer information to and from the file. Also, FCMND instructions can be used to send commands to the file system. When a TFTP device is attached, it allows a program to read a file from an TFTP server.
When a SERIAL:n serial communication line is attached, it can be used to send and receive information to and from another system. As with disk I/O, WRITE and READ instructions are used for the information transfer. For the details on physical connectors and corresponding eV+ designations, see: Table 3-5. Serial Connectors and eV+ Designations in the SmartController User's Guide . When mode bit 3 = 0 and the $device parameter is omitted, the logical unit number implicitly specifies the corresponding default device from the following table. Default Device Numbers Supplied by the LUN eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 70 Number Device 0 Robot (default when lun is omitted)