Professional Documents
Culture Documents
Webinar, June 07
Screen Macros
Button Macros
Global Macros
Initial Macro runs once
Background Macro runs continuously
Clock Macro runs on schedule
Sub-Macro runs when called
Screen Macros
Screen Open Macro runs once when screen is
opened
Screen Cycle Macro runs continuously while
screen is opened
Screen Close Macro runs once when screen is
closed
Button Macros
Before Execute Macro runs once prior to
button action
After Execute Macro runs once after button
action
On Macro runs once when bit is turned on
Off Macro runs once when bit is turned off
Variables
Volatile Memory
Non-volatile memory
Indirect addressing
Recipe variables
PLC addressing
Tags in Macros
Passing variables
Volatile Memory
Non-volatile memory
Each memory location is 16 bits, or 2 bytes, or 1
word
M$0 through M$1023 (2 Kbyte)
Retentive even when loading new program into
the HMi
Indirect addressing
Use *$ to access memory indirectly
For example,
$100 = 50
$200 = 100
$300 = *$200
Recipe variables
RCPNO selected recipe #
RCPn recipe variable
See Recipe application note or user manual for
more info
PLC addressing
1@D100 base PLC address 1, word D100
2@D100 base PLC address 2, word D100
2#1@D100 link2 PLC address1 word D100
3#1@N7:1 link 3 PLC address 1, integer file
N7, word 1
Tags in Macros
Passing values
All variables are global variables
Use direct addressing to pass a value
$100 = 50
$200 = $100
Using Macros
Macro wizard
Update Macro
Import/Export Macros
Macro wizard
The macro wizard makes
entering code easy
Click the wizard toolbar
button in the macro
window
Update Macro
Updating the Macro saves
it to memory
If you do not update, the
changes will be lost!
The macro shown adds
the values in $2 and $3,
then places the result in
$1
Import/Export Macros
Allows for re-use of Macros from one button to another
Allows for re-use of Macros from one program to another
Macro Examples
Move data
Evaluate an expression
Perform a sequence of steps
Perform an action based on a condition
Re-use of code (sub-macros)
Access the serial port
Move data
$30 = 1
Assigns the value of 1 to location $30
$40 = 07DCH
Assigns the hex value 07DC to location $40
1@D100 = 5
Writes the value of 5 to D100 in the base PLC
1@D100 = $150
Assigns the value that is in memory location $150 and writes it to D100
in the base PLC
$200 = 1@D300
Reads the value in D300 and assigns it to memory location $200
1@D400 = 2#1@N7:1
Reads the value on link2 in N7:1 and writes it to D400 in the base PLC
Evaluate an expression
$101=1@D101
$102=1@D102
$100 = $101 + $102
Wrap up
Macros extend the functionality of the HMi
Scripted programming language
Questions???
TRC 1-800-809-2772, option 5
Tier 3 support
David Brandt
Gerry Feldmeier
Jason Hill
Jim Rosner
The End