Macro Programming
57
9.2
Macro Programming Examples
To prevent injury and equipment
damage, always test macros and
batching routines thoroughly before
connecting the indicator to a live
system.
9.2.1
Example 1
The following example uses a macro to provide
operator prompts for a simple container filling
procedure. The single setpoint is used to check for a
full container; when tripped, the setpoint releases the
pause in step 3 of the macro.
With the indicator in setup mode, the following EDP
commands are sent to program the setpoint and assign
prompts used by the macro.
SETPOINT=1
KIND=NETSP
VALUE=200
TRIP=HIGHER
BATCH=OFF
DIGOUT=NONE
BATCHNG=OFF
PROMPT#1=ADD BOX
PROMPT#2=ADD MATERIAL
PROMPT#3=REMOVE BOX
NOTE:
Prompts are assigned using the PROMPT#n
EDP command or the PROMPTS parameter on the
PROGRM menu. Prompts are recalled for display
during macro execution using the NAME.n EDP
parameter or the NAME parameter under the macro
submenu.
The macro shown below is started when the operator
presses the F1 macro key:
MACRO 1
MACRO1.K01=PAUSREL.MOTION
MACRO1.K01=NAME.1
MACRO1.K02=KTARE
MACRO1.K03=PAUSREL.COMPAR1
MACRO1.K03=NAME.2
MACRO1.K04=KPRINT
MACRO1.K05=PAUSREL.COZ
MACRO1.K05=NAME.3
1. The first macro step displays the prompt
ADD
BOX
on the secondary display and waits for
scale motion caused by the operator placing
the box on the scale. When scale motion
stops, the pause is released and the macro
continues.
2. The macro performs a tare operation, taring
the box weight and placing the indicator in net
mode.
3. The secondary display prompts the operator
to
ADD MATERIAL
. The prompt is held on the
d i s p l a y u n t i l s e t p o i n t 1 c h a n g e s s t a t e
(
COMPAR1
). When the setpoint trips, the
pause is released.
4. The macro performs a print operation using
the NFMT ticket format.
5. The secondary display prompts the operator
to
REMOVE BOX
. The prompt is held on the
display until the gross weight on the scale
goes to zero.
PAUSREL
MAJORKY
MOTION
COZ
DIGIN1 – DIGIN8
AZTRACK
TIMER
COMPAR1 – COMPAR8
The PAUSEREL parameter inserts a pause in the macro sequence that is released
when the specified condition is met. The value specified for this parameter
determines when the pause is released:
MAJORKY: When any of the five major keys is pressed
MOTION: When scale reaches standstill
COZ: When scale reaches center of zero
DIGIN1–DIGIN8: When DIGIN
x
goes active
AZTRACK: When scale is within zero track band
TIMER: When timer expires (timer value is specified on TIMEOUT parameter)
COMPAR1 – COMPAR8: When the setpoint
x
(1–8) changes state
PROGRM Menu
Parameter
Choices
Description
Table 9-1. MACRO Submenu Parameters (PROGRM Menu)
Warning