Script Example
Tip: Use Max — MachineMetrics’ AI assistant — to help generate or refine an EtherNet/IP adapter script for your PLC tags. The examples below are starting points.
Basic Configuration (CompactLogix)
version: 2
scan-interval: 0.25 # Poll every 250ms (adjust as needed)
tags:
mode-auto: Module10.ModeAuto
fault-ind: Module10.FaultInd
part-count: HMI1.PartCounter
variables:
execution:
- source: mode-auto and fault-ind == false
- state:
- ACTIVE: this
- READY: true
parts:
- source: part-count
- value-increase
- count
data-items:
- execution
- parts
ControlLogix/GuardLogix with Slot Parameter
For ControlLogix and GuardLogix, specify the processor slot:
version: 2
slot: 3 # Backplane slot where processor is installed
scan-interval: 0.25
tags:
mode-auto: Module10.ModeAuto
fault-ind: Module10.FaultInd
part-count: HMI1.PartCounter
variables:
execution:
- source: mode-auto and fault-ind == false
- state:
- ACTIVE: this
- READY: true
parts:
- source: part-count
- value-increase
- count
data-items:
- execution
- parts
Note: CompactLogix is always slot 0 (don't need to specify slot parameter).
Advanced Configuration
version: 2
scan-interval: 0.25
tags:
recipe-loaded: RecipeLoaded
mode-auto: Module10.ModeAuto
fault-ind: Module10.FaultInd
peak-force: Program:Station1.Values.Reals[0]
press-force: Program:Station1.Values.Reals[2]
fault-code: HMI1.StaData.FaultNumber
fault-msg: HMI1.StaData.FaultDescription
variables:
execution:
- state:
- ACTIVE: mode-auto and fault-ind == 0 and recipe-loaded
- READY: true
controller-mode:
- state:
- AUTOMATIC: mode-auto
- MANUAL: true
data-items:
- recipe-loaded
- controller-mode
- execution
- press-force
conditions:
system:
- code: gen_fault
message: Machine is in fault
value:
FAULT: fault-ind > 0
- code: ${fault-code}
message: ${fault-msg}
value:
FAULT: fault-ind > 0
Adding the Machine in MachineMetrics
- Go to Assets → Machines → Add Machine
- Enter machine details
- Select Allen Bradley (or EtherNet/IP) as adapter type
- Enter controller IP and port
<ip-address>:44818 - Enter adapter script configuration
- For ControlLogix/GuardLogix: Verify
slot:parameter is correct - Test connection and save