TSL Automation Solutions Logo

Section 15.4.13 · Chapter 15: Using Macros

Communication Operation

■ EN_LINK

Format EN_LINK(P1,P2,P3) Data Type U
Function Enables communication link P1 or sub-link P2 of communication link P1 when P3 is 1. Disables the specified communication link or sub-link when P3 is 0.
P1 (I/C) The number of the communication link to be enabled or disabled.
P2 (I/C) The node address of the sub-link to be enabled or disabled. If the specified communication link has no sub-link, this parameter is ignored. If the specified communication link has sub-links and you want to enable or disable the link itself, set this parameter to 0.
P3 (I/C) To enable the specified communication link or sub-link, set this parameter to 1. To disable the specified communication link or sub-link, set this parameter to 0.
Example 1 ENABLE_LINK(1, 20, 0) /* Disable the sub-link, whose node address is 20, of communication link 1. */

■ LINK_STS

Format P1 = LINK_STS(P2,P3 ) Data Type U
Function Gets the status of communication link P2 or sub-link P3 of communication link P2 and saves the result in P1.
P1 (I/C) The word to receive the status of the specified communication link or sub-link. The status is a 16-bit value. The following table lists the meaning of each status value.
Status Value Meaning Status Value Meaning
0 OK 14 Device busy
1 Overrun error 15 Unknown error
2 Break error 16 Link disabled
3 Parity error 17 Initialization failure
4 Framing error 18 Failed to send data
5 No response 19 Failed to receive data
6 Unrecognized response 20 Failed to open connection
7 Timeout 21 Connection not ready
8 Inactive CTS 22 Invalid sub-link
9 Checksum error 23 Invalid COM port
10 Command rejected 24 Error
11 Invalid address 255 Condition uncertain
12 Invalid range 65535 Failed to get status
13 Invalid request
P2 (I/C) The number of the communication link.
P3 (I/C) For a sub-link of a serial link, specify the node address of the sub-link. For a sub-link of an Ethernet link, specify the sub-link ID of the sub-link. If the specified communication link has no sub-link, this parameter is ignored.
Example 1 $U100 = LINK_STS(2, 0) /* Get the status of communication link 2 and save it to $U100. */
Example 2 $U12 = LINK_STS(1, 128) /* Get the status of the sub-link, whose node address is 128, of communication link 1 and save it to $U12. */

■ LINK_PAR

Format LINK_PAR(P1,P2,P3,P4) Data Type U
Function Accesses the communication parameters of an Ethernet link or a sub-link of an Ethernet link.
P1 (I/C) The operation of the access.
Operation Value
Get parameters 0
Set parameters 1
P2 (I/C) The number of the communication link. For example, the number of the first link is 1. Note that the link must be an Ethernet link or the operation will fail.
P3 (I/C) The ID of the sub-link. If the specified communication link has no sub-link, this parameter is ignored.
P4 (I) The starting location of the memory block that stores the parameters. The memory arrangement of the block is shown in the following table.
Word No. Description
0 The communication delay. The unit is 1 millisecond.
1 The timeout time. The unit is 0.1 second.
2,3 The IP address. The four bytes of this double-word stores the 4 numbers of an IP address.
Byte Content
High byte of word No. 3 The 1st number
Low byte of word No. 3 The 2nd number
High byte of word No. 2 The 3rd number
Low byte of word No. 2 The 4th number
[Example]
The following table shows how the IP address '192.168.1.100' is stored in the memory block when the memory block starts at $U100.
Byte Content Remark
HIgh byte of $U103 C0H (192) The word value of $U103 is C0A8H
Low byte of $U103 A8H (168)
High byte of $U102 01H (1) The word value of $U102 is 0164H
Low byte of $U102 64H (100)
[Note]
You can use a numeric entry object to display and enter an IP address. When configuring a numeric entry object to display an IP address, Select '32-Bit Unsigned Integer' as the Data Type and select 'IP Address' as the Display Type.
4 The IP port number.
5 Reserved
6 Reserved
7 Reserved
Example 1 LINK_PAR(0, 1, 2, $U100) /* Get the communication parameters of sub-link 2 of communication link 1 and save it to the memory block starting at $U100. */
Example 2 $U200 = 10 (U) /* Will be used to set the command delay to 10 ms */
$U201 = 1 (U) /* Will be used to set the timeout time to 0.1 second */
$U202 = C0A80164H (UD) /* Will be used to set the IP address to 192.168.1.100 */
$U204 = 2000 (U) /* Will be used to set the IP port to 2000 */
LINK_PAR(1, 2, 0, $U200) /* Set the communication parameters of link 2 using the data stored in the memory block starting at $U200. */

Need PM Designer itself?

V4 for current PK, PT, ITV and PM panels, V2 for older models. Free, sent by email.

Source.Section 15.4.13 of the PM Designer Software User Manual, Edition 2.0, © Cermate Technologies Inc. (www.cermate.com, service@cermate.com). Reproduced online, with the manual's own figures, by TSL Automation Solutions, authorised Cermate distributor, for users of Cermate HMI panels. PM Designer and PanelMaster are trademarks of Cermate Technologies Inc.

Text and figures are the manufacturer's and may describe features your panel or software version does not have. For a plain-language introduction read the PM Designer guide; for help with a specific panel contact TSL Automation.