Industrial Automation
Industrial Automation | Europe

myKnowledge

Main > Product Type > Software > Programming
Minimize Text   Default    Enlarge Text
 

Print
E-mail

Protocol Macro For HostLink


The protocol consists of 10 sequences, numbered 050 to 059 as follows:

Sequence Number
Description
050
DM area multiple word read
051
IR/SR area multiple word read
052
HR area multiple word read
053
LR area multiple word read
054
AR area multiple word read
055
DM area single word write
056
IR/SR area single word write
057
HR area single word write
058
LR area single word write
059
AR area single word write

Output & Input Words for All Read Sequences

Note: The output words are the middle operand of PMCR and are also known as source words and read words. The input words are the 3rd operand of PMCR and are also known as destination words and write words.

Output Word
Description
Value
M
Size of table
0004
M+1
Unit number
0000-0031
M+2
Start address
0000-max address for memory area
M+3
Number of words to read
0001-0030
Input Word
Description
Value
N
Size of table
Returned by PMCR
N+1
End code
0000=OK, see Hostlink manual for error code descriptions
N+2 onwards
Data
 


Recommended Method to Perform A Read

  • Clear word N & N+1 (i.e. set to zero)
  • Set up the output words as described in the table above.
  • Execute PMCR.
  • When PMCR is complete check the value in word N & N+1. If word N remains at zero then there was no response from the slave PLC (i.e. timeout). If word N is 2 then the slave PLC returned an end code that will be stored in word N+1. If word N is greater than 2 and word N+1 is zero, the operation was successful.
Note 1: The data read from the slave PLC will be stored in reverse order in the master PLC.
Note 2: Never try to read more than 30 items in one message.

Read Operation Example

The master PLC wants to read 3 words of DM starting at DM0123 from slave unit 16. The first output word in the PMCR is set to DM0000. The first input word is set to DM0010.

DM0000=     Size of table=              0004
DM0001=     Unit number=              0016
DM0002=     Start address=            0123
DM0003=     Number of words=      0003
 
After the successful execution of PMCR:
 
DM0010=     Size of table=              0006
DM0011=     End code=                  0000
DM0012=     Value from slave DM0125
DM0013=     Value from slave DM0124
DM0014=     Value from slave DM0123


Output & Input Words for All Write Sequences

Output Word
Description
Value
M
Size of table
0004
M+1
Unit number
0000-0031
M+2
Address
0000-max address for memory area
M+3
New value
0000-FFFF
Input Word
Description
Value
N
Size of table
Returned by PMCR
N+1
End code
0000=OK, see Hostlink manual for error code descriptions


Recommended Method to Perform A Write

  • Clear word N & N+1 (i.e. set to zero)
  • Set up the output words as described in the table above.
  • Execute PMCR.
  • When PMCR is complete check the value in word N & N+1. If word N remains at zero then there was no response from the slave PLC (i.e. timeout). If word N is 2 then the slave PLC responded. If N+1 is non-zero the write operation failed. If it is zero the write operation succeeded.

Write Operation Example

The master PLC wants to write a value of 1234 to DM0200 in slave unit 3. The first output word in the PMCR is set to DM0000. The first input word is set to DM0010.

DM0000=     Size of table=              0004
DM0001=     Unit number=              0003
DM0002=     Address=                    0200
DM0003=     New value=                 1234
 
After the successful execution of PMCR:
 
DM0010=     Size of table=              0002
DM0011=     End code=                  0000


Timeout & Retry Values

All the sequences have a one second timeout for sending the commands and another one second timeout for receiving the reply. If the sequence times out or an unexpected reply is received the sequence will automatically retry up to two times. After this the sequence will abort.
Attached are several protocol macros for HostLink.



Attachments

C-Mode_Hostlink_CS1.psw - Size: 30464
C-Mode_Hostlink_Cx.psw - Size: 17274
C-Mode_Hostlink.psw - Size: 32631
C_hlink.doc - Size: 740864


Comments (View All Comments / Add Comment)

Related Articles
No related articles found.
Created 2008-11-27
Modified 2008-11-27
Views 4299

 

You are not logged in.