Omron TJ2-MC64 - PROGRAMMING Programming Manual page 222

Hide thumbs Also See for TJ2-MC64 - PROGRAMMING:
Table of Contents

Advertisement

Communication protocols
Examples
In these examples we assume this set-up:
A Trajexia system with a TJ2-MC64.
A slave PC, with node address 13.
A connection from the serial port of the TJ2-MC64 to the PC. The serial
port uses RS422 communication.
/i
Example
Reading data from the PC using HLM_READ.
BASIC code
' Set up Host Link master for port 2
SETCOM(9600,7,2,2,2,6)
' Source address: CIO/IR 002
' Amount of data: 2 words
' Destination address: VR(0)
HLM_READ(2,13,PLC_IR,2,2,MC_VR,0)
Host Link
From Host Link master to Host Link slave:
communication
@13RR0002000242*
From Host Link slave to Host Link master:
@13RR000101010241*
Result
VR address = 0: value = 257.0000
VR address = 1: value = 258.0000
/i
Example
Writing data to the PC using HLM_WRITE.
BASIC code
' Source address: TABLE(18)
' Amount of data: 2 words
' Destination address: LR 014
TABLE(18,$0701,$0702)
HLM_WRITE(2,13,PLC_LR,14,2,MC_TABLE,18)
Host Link
From Host Link master to Host Link slave:
communication
@13WL0014070107025F*
From Host Link slave to Host Link master:
@13WL0059*
PROGRAMMING MANUAL
Result
LR address = 0: value = 701 (hex)
LR address = 1: value = 702 (hex)
/i
Example
Send TS (test) command to PC using HLM_COMMAND.
BASIC code
HLM_COMMAND(HLM_TEST,2,13)
Host Link
From Host Link master to Host Link slave:
communication
@13TSMCW151 TEST STRING2A*
From Host Link slave to Host Link master:
@13TSMCW151 TEST STRING2A*
Result
HLM_STATUS PORT(2) = 0, which implies correct communication.
/i
Example
Set PC in MON mode using HLM_COMMAND.
BASIC code
HLM_COMMAND(HLM_STWR,2,13,2)
Host Link
From Host Link master to Host Link slave:
communication
@13SC0250*
From Host Link slave to Host Link master:
@13SC0052*
Result
The PC runs in MON mode. Note that this is necessary for writing data
to the PC using HLM_WRITE.
/i
Example
Reading PC model code using HLM_COMMAND (timeout).
BASIC code
HLM_TIMEOUT=500
' Destination address: VR(100)
HLM_COMMAND(HLM_MREAD,2,13,MC_VR,100)
Host Link
From Host Link master to Host Link slave:
communication
@13MM42*
From Host Link slave to Host Link master:
no response
Result
Because the master has not received a response from the PC,
HLM_STATUS PORT(2) has value 256 (bit 8 is set) after 500 servo
cycles.
216

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tj1-prtTj1-drtTj1-cortTj1-mlGrt1-ml2Tj1-fl02

Table of Contents