Skip to content

Workflow Examples ​

Last updated

Each example uses only node behavior that works as described in these pages.

1. Device offline: set a flag, tell the HMI, publish to MQTT ​

Goal: when the Haas VF-2 drops off the network, raise a local flag shown on the dashboard and publish an event to the plant broker.

  1. Create a local tag Status/VF2_Offline (boolean) on Local Tags.
  2. New workflow VF-2 offline. Add Machine Offline, Device = Haas VF-2.
  3. Add Set Tag: Device Local Tags, Tag Path Status/VF2_Offline, Value true.
  4. Add Sound: Stock sound Alarm.
  5. Add Reformat Date/Time: Format ISO 8601, Output variable at.
  6. Add MQTT Publish: MQTT Device Plant broker, Topic plant/machining/vf2/connection, Payload {"state":"offline","at":"{{at}}"}.
  7. Wire Machine Offline → Set Tag → Sound → Reformat Date/Time → MQTT Publish (gray dots only).
  8. Save, then Enabled.
  9. Build a second workflow VF-2 online with Machine Online that sets the tag to false.

2. Shift change: snapshot a counter into a tag ​

Goal: at 06:00, 14:00 and 22:00, copy the good-part count into "last shift" and reset the live counter.

  1. New workflow Shift snapshot with a Manual trigger.
  2. Set Tag: Device Local Tags, Tag Path Shift/LastShiftGood, Value Source From another tag, Source Line1/GoodCount.
  3. Set Tag: Device Line 1 PLC, Tag Path GoodCount_Reset, Value 1 (the PLC must have write access enabled).
  4. Delay 1000, then Set Tag GoodCount_Reset = 0.
  5. Wire and Save. Leave it disabled — it does not need its own triggers.
  6. On Schedules, New Schedule: Name Shift snapshot, Action Run Workflow, Target Shift snapshot, Custom cron 0 6,14,22 * * *.

3. Over-temperature email with a debounce ​

Goal: when Oven 3's high-temperature bit (set by the PLC) stays on for 30 s, email maintenance once per event.

  1. Trigger: Tag Change on Oven3/TempHigh.
  2. Condition: Left {{value}}, Operator ==, Right true (or 1 — use exactly what the Tags page shows for this bit). Wire True onward; leave False unwired.
  3. Delay 30000.
  4. Read Tag Oven3/TempHigh, Output variable stillHigh.
  5. Read Tag Oven3/Temp, Output variable temp.
  6. Condition: {{stillHigh}} == true, wire True to:
  7. Send Email: To maintenance@plant.example, Subject Oven 3 over temperature, Body Oven 3 has been over temperature for 30 s. Current temperature {{temp}} °C..

Check the SMTP limits in Communication Nodes first. Because Tag Change fires on each update of the bit, a PLC that rewrites the bit with a new quality can start extra runs; each still waits and re-checks, so at worst you get a duplicate email.

4. Barcode scan to a data table (workflow + script) ​

Goal: an operator scans a lot label into a local tag; the scan is logged to a data table.

  1. A script Log scan that inserts context.params.code and context.params.station into the table (see Scripts and Workflows).
  2. Workflow: Tag Change on Local Tags Station4/LastScan → String Compare Left {{value}}, Starts with, Right LOT- → True → Run Script Log scan with parameters code = {{value}}, station = 4 → Error → Set Tag Station4/ScanError = true.

For a plain insert like this you can use Write DB instead of the script: Table name set to your table, and Column values code = {{value}}, station = 4. Keep the script when the insert needs logic of its own.

See also ​

Scada.Ink Help Center