com_encom (Statement) [Version 1.5 or later]


Prepare for binary transmission using the RS-232C port or Ethernet client port.
For the RS-232C port, this statement occupies the port for binary transmission. For the Ethernet client port, this statement opens the port and establishes a connection with the server.


com_encom [#<portnumber>]
<portnumber>
Output port number.
(1: Controller's RS-232C port, 8-15: Ethernet client ports)
When the port number has not been specified, controller RS-232C is selected.


This command discriminates binary data from ASCII data in binary transmission between the PC and robot controller e.g., in WINCAPSIII.
After binary transmission is completed, you need to release the communication port by using com_discom command.
  • If data is transferred from the PC (e.g., in WINCAPSIII) to the robot controller after execution of this command, then the controller will treat it as binary data and will not close the RS-232C port occupied by binary transmission.
  • After executing this command in Ethernet connection, it will not influence data communications with WINCAPSIII.


If com_encom executes following com_discom within a short period, a "client open failure" error may occur during execution of com_encom. To prevent such an error, insert a code for checking that no connection has been established, before a com_encom as shown in the example above.
Do not use com_discom or com_encom in a program execution loop.


<When the Ethernet client port is used>
PROGRAM sample
DEFINT Flg
com_state #8,Flg
'Obtain the status of Ethernet client port.
IF Flg=-1 THEN
'If no connection has been established,
com_encom #8
'Open the port.
ENDIF
END


Top