TSL Automation Solutions Logo

Section 15.4.2 · Chapter 15: Using Macros

Data Transfer

■ Assignment ( = )

Format P1 = P2 Data Type U/S/UD/SD/F/B
Function Assigns the value of P2 to P1.
P1 (I/E) The destination.
P2 (I/E/C/AE) The source.
Example 1 $U2 = 123.45 (F) /* Assign 123.45 to $U2 (and $U3) */
Example 2 $U100.f = 1d (B) /* Turn on the specified bit */
Example 3 W60 = ($U30 + W50 - 1000) / 2 (SD) /* Write the result of the arithmetic expression to W60. */
Example 4 V0.0 = 2\M0 (B) /* Assign the bit value of M0 of link 2 to the bit V0.0 of link 1*/

■ Logical NOT ( = ! )

Format P1 = ! P2 Data Type B
Function Reverses P2 and saves the result in P1.
P1 (I/E) The location to save the result.
P2 (I/E) The operand.
Example 1 $U2.3 = !$U3.4 (B) /* If $U3.4 is 1 (On), $U2.3 is 0 (Off) */

■ " "

Format P1 = "P2"
Function Copies the quoted ASCII character string P2 to P1. Note that the string is a null terminated string. If the length of the string is N then N+1 bytes will be copied to P1 and the last byte is 0.
P1 (I) The location to save the result.
P2 (A) The quoted ASCII character string.
Example 1 $U60 = "TEST" /* The null character (00h) will be moved to the low byte of $U62 */
Example 2 $U20 = "ABCDE" /* The null character (00h) will be moved to the high byte of $U22 */

■ MOV

Format P1 = MOV(P2,P3) Data Type U/S/UD/SD/F
Function Copies P3 words of P2 to P1.
P1 (I/E) The starting location of the memory to receive the copy.
P2 (I/E) The starting location of the memory to be copied.
P3 (I/C) The number of words to be copied.
Example 1 $U100 = MOV($U200, 16) /* Copy the 16 words starting from $U200 to $U100 */
Example 2 W60 = MOV($U200, $U2) /* Copy the word array starting from $U200 with the size specified in $U2 to W60.*/
Example 3 $U10 = MOV(2\D100,10) /* Copy D100 ~ D109 of link 2 to $U10 ~ $U19.*/

■ SETM

Format P1 = SETM(P2,P3) Data Type U
Function Sets P3 words of P1 to word value P2.
P1 (I/E) The starting location of the memory to be set.
P2 (I/C) The set value or the location that holds the set value.
P3 (I/C) The number of words to be set. The max. no. of words are 512.
Example 1 $U100 = SETM(0, 16) /* Set the 16 words starting from $U100 to 0. */
Example 2 W60 = SETM($U200, $U2) /* Set the words of the word array starting from W60 with the size specified in $U2 to the value of $U200.*/

■ MOV_BITS

Format P1 = MOV_BITS(P2,P3) Data Type B
Function Copies a block of bits starting from P2 with a length of P3 to the bit block starting from P1.
P1 (I) The starting location of the bits to receive the copy.
P2 (I/E) The starting location of the bits to be copied.
P3 (C) The number of bits to be copied.
Example 1 $U100.0 = MOV_BITS($U200.0, 16)(B) /* Copy the 16 bits starting from $U200.0 to $U100.0. */
Example 2 $U10.1 = MOV_BITS(W60.1, 10) (B) /* Copy the 10 bits starting from W60.1 to $U10.1. */

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.2 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.