ATTACH program instruction This bit controls how the device driver responds to the attach request from the control program task. (The device driver is an internal system task that is separate from the control program task.) For most applications, this bit should be set. If this bit is clear, and the device is already attached by another control program task, the driver queues this attach request and signals the control program that the attach is not complete. The attachment will complete when the device becomes available. If this bit is set, and the device is already attached by another control program task, the device driver immediately signals that the attach request has failed.
The function IOSTAT(lun) can be used to determine the success or failure of the attachment. A positive value from IOSTAT indicates successful completion; zero indicates the attachment has not completed; a negative value indicates completion with an error. Bit 2 (mask value = 2) - Wait (0) versus No-wait (1) This bit controls whether or not the control program task waits for a response from the device driver. For most applications, this bit should not be set. If this bit is clear, program execution waits for the device driver to signal the result of the attach request. If this bit is set, program execution does not wait for the result of the attach request.
The program must then use the function IOSTAT(lun) to determine if the attachment has succeeded (see earlier text). If the program attempts to READ from or WRITE to the logical unit while the attachment is pending, program execution then waits for the attachment to complete. Bit 3 (mask value = 4) - Specify LUN (0) versus Have LUN Assigned (1) This bit determines how the lun parameter is processed. If this bit is clear, the device corresponding to the value of lun is attached. That is, the value of the lun parameter specifies the device that is to be attached (according to the table in the Details section) except when a different device is specified with the $device parameter.
If this bit is set, the device to be attached is specified by the $device parameter (which should not be omitted). In this case, a logical unit is automatically selected, and the value of the lun parameter is set by the ATTACH instruction. eV+ assigns a value to lun even if the ATTACH request fails. (This mode cannot be used to attach the robot or eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 68