Get stack-light status into Kepware
AndonTap reads the stack light and spindle current, works out the machine state on the unit, and serves it over Modbus TCP. The setup app writes a Kepware tag file for each machine. This guide goes from a wired unit to live tags.
- An AndonTap unit, wired and powered (see monitoring an older CNC for the wiring)
- Kepware with its Modbus TCP/IP Ethernet driver
- A network path from the Kepware server to the unit, with TCP port 502 open
- A static IP address for the unit from your network administrator
- The setup app in Chrome or Edge, and a USB-C cable or Bluetooth
Step 1 · Give the unit an address
A new unit has no IP address and sends nothing on the network. Connect the setup app over USB-C, or over Bluetooth (the unit shows up as ANDONTAP-XXXXXX). On Network & security, choose Static, enter the IP address, subnet mask and gateway (0.0.0.0 if the network has none), and click Write to unit. The unit checks the address, saves it and restarts on it.
On the same page, check that Modbus TCP is on. It is on from the factory.
Prefer a terminal? ip static 10.20.30.40 255.255.255.0 10.20.30.1 on the USB-C console does the same; type status to check.
Step 2 · Name the machine and the lamps
The tag file is built from this unit's setup, so finish the setup first:
- Machine: the machine name and asset ID. They are also served as strings, so Kepware can show which machine a device is.
- Stack light: each input's role and colour. A red lamp on input 1 becomes tags named Lamp1_Red_…; an input set as a part counter becomes In4_Parts.
- Spindle & CTs: the CT rating, output and thresholds, and what CT2 watches.
Inputs set to Unused are left out of the file.
Step 3 · Export the Kepware tag CSV
On Data map & export, click Download tag CSV. The file is named after the machine and asset ID, for example Mill_04_A1234_kepware_tags.csv. Each row is one tag with its address, data type, read-only access, a 1000 ms scan rate and a description. A few of the rows:
| Tag | Address | Type |
|---|---|---|
| MachineState.MachineState | 300009 | Word |
| Inputs.Lamp1_Red_State | 300011 | Word |
| Spindle.Spindle_Amps | 300017 | DWord, scaled to Float |
| Device.MachineName | 300101.032H | String |
Current values are sent in units of 0.01 A; the CSV includes linear scaling so Kepware shows amps. Status bits come in as Boolean tags from the discrete inputs.
On a V6 unit the CSV also has the inputs 7-8 tags, from input registers 200-219 (Kepware 300201-300220), for example Inputs.InputsActive at 300201. Inputs 5-6 are in the main block with inputs 1-4. Inputs 5-8 are supported from firmware 1.7.
No unit yet? The demo exports the same file from a simulated machine, so you can try the import first.
Step 4 · Add the device in Kepware
- Add a channel that uses the Modbus TCP/IP Ethernet driver, or use an existing one.
- Add a device with the unit's IP address. The port is 502, and the unit answers to any device (unit) ID.
- Leave zero-based addressing on and first word low on for 32-bit values. These are the driver's defaults, and the CSV addresses assume them.
The unit accepts up to 4 Modbus clients at once, which matters if Kepware, a historian and a second SCADA all poll it.
Step 5 · Import the CSV
Right-click the new device and choose Import CSV, then pick the file from step 3. The tags arrive with their names, addresses, types, scaling and descriptions. Names keep the group they belong to (Inputs, Spindle, MachineState, CT2, Device, Flags, Status), so the list stays readable.
Step 6 · Check the tags in Kepware's Quick Client
Open Kepware's Quick Client and browse to the device. Every tag should show Good quality. Then check them against the machine:
- MachineState shows a number: 0 Unknown, 1 Off, 2 Idle, 3 Running, 4 Alarm, 5 Setup, 6 Warning, 7 Maintenance.
- Each lamp's _State tag reads 0 off, 1 on, 2 flashing. Turn a lamp on at the machine and watch it change.
- SpindleLevel reads 0 stopped, 1 turning, 2 cutting.
- Device.MachineName shows the name you entered in step 2.
If tags read Bad, or values look shifted by one register or nonsensical for 32-bit values:
- Ping the unit, and check that port 502 is open between the networks and that Modbus TCP is on.
- Check zero-based addressing and first word low on the device (step 4).
- Check that no more than 4 Modbus clients are connected.
On the unit, status on the console shows the network settings, and input register 88 counts the connected Modbus clients.
Step 7 · Roll it out to the rest of the floor
The register layout is fixed and identical on every unit, whatever its setup. The addresses in one CSV are the addresses on every machine; only the tag names differ, because they follow each machine's lamps and CTs. Two ways to scale out:
- Identical machines: save the setup file, load and clone it onto the next unit (it keeps its own name and IP address), and copy the Kepware device with a new IP address.
- Mixed machines: export a CSV from each unit's setup so the names match its own stack light.
From Kepware, the data goes wherever your other tags go: SCADA, an MES, a historian. Firmware 1.7 has no MQTT of its own; a gateway such as Kepware can publish the tags to MQTT.
Writes from Kepware
The tag file is read-only. The unit does accept some writes over Modbus (spindle thresholds, debounce, clock, identify and counter resets) at its factory "basic" remote-write level, and refuses anything else with exception 01. Network settings, restarts and firmware updates need the "full" level, set in the setup app. The user manual and the register map list every holding register.
Using Allen-Bradley PLCs as well? See machine state into Studio 5000. Comparing with a PLC on each machine? See Why not a PLC?
Export a real tag file now
Open the demo, set up a simulated machine, and download its Kepware CSV from Data map & export.