Chapter 3 Creating and Editing Screens
When Var3 is set to 0, it indicates that LOCKCOM command will be executed
twice and HMI will continuously wait without time limit. At this time, HMI may
have no response at all.
Example
Explanation of LOCKCOM Command
In the above macro commands, the communication commands are all used. When
Background Macro is executed first, COM1 will be locked. At this time, the
execution of ON Macro and Screen Cycle Macro commands will stop when
reaching LUCKCOM (0,0) this command. After UNLOCKCOM command in
Background Macro is executed, the execution of ON Macro and Screen Cycle
Macro command will be activated again. This can avoid the interference and
incorrect calculation or communication result.
$0 = LOCKCOM(0,0)
$1 = PUTCHARS($1, 3,
300)
Background
Macro
$0 = LOCKCOM(0,0)
$1 = PUTCHARS($1,
3, 300)
Screen Cycle
Macro
$0 = LOCKCOM(0,0)
$1 = GETCHARS($1,
3, 300)
Macro
On
Explanation of UNLOCKCOM Command
If the macro commands is set as shown as the above, the user can lock the COM
port and transmission data by using Background Macro, and unlock the COM port
by using ON Macro. It means that the actions of locking COM port and unlocking
COM port can be separated.
$1 = PUTCHARS($1, 3, 300)
Macro
$0 = LOCKCOM(0,0)
Background
UNLOCKCOM(0)
On
Macro
Revision May, 2010 3-363