Quick Start
On this page
What the module does
This module reads weight and status from Mettler-Toledo balances and terminals, and from other scales that speak MT-SICS over TCP. Allow writes is on by default for a new scale, so the module can zero, tare, clear the tare, preset the tare and reset that scale, from tags or scripts (see “Commands”). Turn Allow writes off on a scale’s form to make it read-only: then the module only reads its weight and status. A separate switch, Allow adjustment, controls the adjustment (calibration) sequence of the scale (see “Calibration”).
The reply formats follow the MT-SICS standard command set. See the Installation chapter for the install and “If it does not connect” below for faults.
Add a scale
-
In the Gateway, open Connections, then MT-SICS Scales.
-
Press Add device + and fill in:
- Name: becomes the tag folder, for example
Scale1. - Enabled: on starts the scale when you save; off keeps it configured without a connection.
- Host and Port: the scale’s SICS interface. There is no default port. Common values are 1701, 1702, 4305 and 8000; read yours from the terminal’s interface settings.
- Mode:
poll(default) asks for the weight every poll interval.continuouslets the scale stream the weight. - Poll interval (ms): default 500 ms, at least 100 ms. Used in poll mode only.
- Timeout (ms): default 3000 ms. How long to wait for the connection and for each answer. In continuous mode: how long the stream may stay silent before the connection is opened again.
- Allow writes: on by default for a new scale. Turn it off for a scale that Ignition must not zero or tare (see “Commands”).
- Allow adjustment: on by default for a new scale. It is separate from Allow writes. Turn it off for a scale whose adjustment must not be started from Ignition (see “Calibration”). A scale whose saved settings have no value for it runs with it off until you turn it on.
- Name: becomes the tag folder, for example
-
Optional: the Test button checks the host and port. On a scale that is not connected it opens a second short-lived connection, which some scales refuse while another client is connected.
-
Save. The scale connects at once and its tags appear in the tag provider
SICS. The list shows its state.
Tags
The gateway lists the provider [SICS] and its tag count under Services > Tags; the tag tree itself is in the Designer’s tag browser.
Tag below [SICS]<Scale>/ |
Meaning |
|---|---|
Connected, State |
Connection up or down, and the state in words (Not licensed, Disabled, Standby on the backup node of a redundant pair …) |
LastError, LastUpdate |
The last error, and the time of the last good answer |
ReconnectCount, LicenseState, ProtocolErrors |
Connection losses, the module licence as this scale sees it, answers the module could not use |
LastWriteError, LastWriteTime |
Result and time of the last command; only with Allow writes on |
Type, Capacity, Serial, Software |
Read once when the connection opens; only the ones the scale reports |
Net, Unit |
The weight of every reading and its unit |
Stable, StableWeight |
Whether the reading is stable, and the last stable value |
Overload, Underload, Tare |
Range flags; the tare stays Bad (see below) |
Zero, Tare, ClearTare, PresetTare, Reset |
Command tags; only with Allow writes on |
State, Prompt, RequestedWeight, RequestedUnit, Result, AsFound, AsLeft |
The calibration run: where it is, what to do, the test weight the scale asks for, the result and the two readings; only with Allow adjustment on (see “Calibration”) |
Operator, NotAllowedNow |
Inputs you write: the operator name of the next run, and your plant interlock; only with Allow adjustment on |
StartInternal, StartExternal, Confirm, Abort |
Momentary command tags of the calibration; only with Allow adjustment on |
NetandUnitfollow every reading; the unit is the one the scale reports (g,kg,lb…).Stableis true for a stable reading.StableWeightchanges only on a stable reading, so it keeps the last settled value while the weight moves.- On overload or underload the flag is set,
Netkeeps its last value with quality Bad. - A scale that reports busy (
S I) leaves all values as they were. Tareexists but stays Bad: reading the tare needs a query (TA) that the module does not send, and a value remembered from our own commands would be wrong after the first tare key press on the scale. The tare you set or took from a script is in the reply of that call (data)._Infois read once when the connection opens. A scale that lacksI2,I3orI4simply has no tag for it.ProtocolErrorscounts answers the module could not use, the error linesES,ET,EL, and lines the scale sent without being asked (they are discarded, so a later answer is never taken for another request). Error lines never close the connection. Three unusable lines in a row mean the answers are out of step: the connection is then closed and opened again, which also raisesReconnectCount.- If the weight field of an answer holds an error instead of a number (
S S Error 10b, for example an EEPROM error in the weigh module), the module counts it inProtocolErrors, logs one WARN line with the error number, and turns theWeighttags Bad with their last value kept. They turn Good again with the next weight. The number is never shown as a weight. - If the scale answers busy (
S I) or with error lines for longer than the timeout, or the weight is otherwise not refreshed, theWeighttags turn Bad with their last value kept, and turn Good again with the next weight. A busy scale for a short time leaves them as they were.
Continuous mode
The module sends SIR and reads the stream. It ends the stream by sending SI (a read command that makes the scale stop SIR) and then closing the connection. The connection is closed either way. It does not send @, because @ resets the scale. If your scale answers an error to SIR, the scale shows the message “cannot stream” in LastError: set the mode to poll.
Commands (zero, tare)
Everything in this section changes the scale. It works only on a scale where Allow writes is on (on by default for a new scale). A scale saved with it off has no Cmd tags, scripts get the outcome REFUSED and nothing is sent to the scale. Turning it off stops a command that has not been sent yet. If you turn it off on a scale that had it on, the existing Cmd tags cannot be removed by the module: they turn Bad_Stale when the scale next connects and every write to them is refused, until the gateway restarts. Before that connect (for example while the scale is disabled, not licensed or held back) they may show Bad_NotConnected; writes are refused then too.
Tags Cmd/Zero, Cmd/Tare, Cmd/ClearTare and Cmd/Reset are momentary booleans: write true (or 1) to run the command. Writing false (or 0), the release of a momentary button, is accepted and does nothing (its write still shows in the log and in LastWriteTime); any other value is refused. A press is refused while a readStable call is waiting for the scale (the command would otherwise be sent late); press again. Writing true is accepted at once, and the scale’s answer shows in _Status/LastWriteError (empty when the scale did it) and _Status/LastWriteTime.
| Tag | Command sent | What it does |
|---|---|---|
Cmd/Zero |
ZI |
Zeroes the scale immediately, also when the weight is not stable. The tare memory is cleared. |
Cmd/Tare |
TI |
Tares the scale immediately. |
Cmd/ClearTare |
TAC |
Clears the tare memory. |
Cmd/PresetTare |
TA <value> <unit> |
Presets the tare. You write the value (a number above 0, at most 9 digits and 6 decimals); the unit is the unit of the scale’s last weight. The tag is refused until the scale has reported a weight with its unit. |
Cmd/Reset |
@ |
Resets the scale to its power-on state. Refused in continuous mode: use poll mode for it. |
Scripts can do the same: presetTare and reset (see “Scripting”). The tags and the scripts follow the same rules and are logged the same way.
- Each command is sent once. If the scale does not answer, the result is
TIMEOUT(“it may have done it”) and the module opens the connection again before the next request; it never sends the command a second time by itself. ZandT(which wait for a stable weight) are not used. Scales that do not supportZIandTI(for example approved, legal-for-trade balances) answer an error, and the module reports it without trying anything else.- The module only accepts the answer forms MT-SICS defines. Another form is reported as
FAILED(“answer not understood; it may have been done”) and counted inProtocolErrors. - In continuous mode the commands work while the stream runs, except the reset.
- Log: for a tag write, logger
innorobix.sics.writehas an INFO line before sending (tag, command, value) and one with the scale’s answer and the time. For a script call,innorobix.sics.commandhas the line before sending and the result. Refusals and failures are WARN. The Ignition user is not logged, because Ignition does not give it to a module.
Calibration (adjustment)
The module can start the adjustment sequence of a scale and guide the operator through it, from tags, scripts or the Perspective calibration screen. It changes the calibration of the scale, so read this chapter before you use it and run the first adjustment with the scale’s own display in view. Test the sequence on your scale model before you rely on it in production.
Switch. Allow adjustment is a per-scale setting, separate from Allow writes, and on by default for a new scale. With it off the scale has no Calibration tags, the calibration scripts return REFUSED, and the module sends no adjustment command. Turning it off stops a run that is going on. A scale in continuous mode cannot be calibrated: use poll mode.
Two kinds of adjustment.
| Kind | Command | What happens |
|---|---|---|
| Internal | C3 |
The scale adjusts with its built-in weight. The scale answers when it starts and when it is done. |
| External | C2 |
The module follows this sequence: when the scale asks for an empty pan, then for a test weight, the module waits for the operator, reads the weight on the pan (as found) and sends C2 again each time the operator confirms. After the scale reports the adjustment done, the operator confirms once more and the module reads the weight again (as left). |
Before it sends a command the module asks the scale for its command list (I0) and sends C2 or C3 only if the scale lists it. A scale that does not list the command, or does not answer the list, is not sent the adjustment command and the run does not start; the reason is in Prompt. Any answer the module does not expect ends the run at once and the module sends nothing more. Adjustment procedures differ between scale models and the module does not know yours: test the sequence on your scale in your environment before production use, with the scale’s own display in view, and check your model’s reference for its adjustment procedure.
Run.
- Write the operator name to
Operator. The Perspective screen does this with the name of the logged-in session user. The module records the name as it is written; it cannot check it, because Ignition gives a module no user for tag or script writes. A run does not start without a name. - Write
truetoStartInternalorStartExternal. The run starts andStateshows where it is:Starting,ZeroPrompt(the scale asks for an empty pan),SpanPrompt(the scale asks for the test weight inRequestedWeightandRequestedUnit),Adjusting,AsLeftPrompt, thenDone,FailedorAborted.Promptsays in words what to do. - At each prompt, do what it says and write
truetoConfirm. AtSpanPromptthe weight on the pan must be stable: while it is not, Confirm is refused and the prompt says so. The stable weight read at that moment isAsFound. AtAsLeftPrompt, with the same test weight on the pan, Confirm readsAsLeftand ends the run.Abortat this prompt skips the as-left reading; the adjustment itself is done. ResultisPasswhen the scale completed the adjustment. Otherwise it says why:Refused by the scale: ...when the scale answered that it cannot adjust now, that the command or parameter is not allowed (the module shows the scale’s answer; look at the scale’s own settings for the reason), that the weight is out of range, or that it does not support the command;Fail: ...for a timeout or answers the module cannot read;Aborted: ...when the run was stopped.
Internal adjustment has no test weight: RequestedWeight, AsFound and AsLeft stay empty. The module does not compare the readings with a tolerance of its own: AsFound and AsLeft are recorded, and judging them is yours.
The tags are momentary like the Cmd tags: write true (or 1); false (or 0) does nothing. Tag values update at the poll interval, because the module reads the scale’s answers when it polls; a short poll interval gives a quicker screen.
Safe stops. Abort, a lost connection, a stopped scale (for example when the licence ends), a switched-off Allow adjustment, the interlock below and a timeout all end the run in the module. The module never sends a cancel command or any other command to the scale to end a run, so after an abort or a timeout the scale’s own display may still wait for a weight or a key: cancel there. A run waits 5 minutes for an operator step and 3 minutes for the scale to finish a step. While a run goes on, the weight tags are not updated and turn Bad, and zero, tare, clear tare, preset tare, reset and readStable are refused. They resume when the run ends. After an abort or a timeout the module opens the connection to the scale again before its next request.
Interlock. Write true to NotAllowedNow while a calibration is not allowed (for example the line is running). A run does not start while it is true, and a run that is going on is ended. The module reads the tag only as it was last written: drive it from your own logic on every change, and write it again after a gateway or scale restart. A value that was never written counts as allowed.
Record of every run. Each run ends with one record: the time, the scale name, the operator name, the scale’s serial number (from I4; empty if the scale reports none), the kind, the test weight and unit, as found, as left, the result (PASS, FAIL, REFUSED or ABORTED) and a sentence. The record goes to the gateway log (logger innorobix.sics.calibration; every state change is logged too, refusals and failures as WARN) and to the tags below. See “Storing records” to keep it in your own table.
Scripts. system.innorobix.sics.startCalibration, confirmCalibration, abortCalibration and calibrationStatus do the same as the tags (see “Scripting”). startCalibration takes the operator name as an argument.
Storing records
The module does not write to a database. The last calibration record of each scale is in the tag folder Calibration/LastRecord, and storing it is done in Ignition with your own table. These tags exist when Allow adjustment is on.
| Tag | Content |
|---|---|
Scale |
The scale’s name |
Operator |
The operator name written before the start |
Serial |
The scale’s serial number, empty if it reports none |
Kind |
internal or external |
TestWeight and Unit |
The test weight and its unit; empty for an internal adjustment |
AsFound and AsLeft |
The readings before and after; empty when none was taken |
Result |
PASS, FAIL, REFUSED or ABORTED |
Detail |
One sentence about how the run ended |
Time |
When the run ended |
Record |
The whole record as one JSON text with the keys scale, operator, serial, kind, testWeight, unit, asFound, asLeft, result, detail, time; a number that was not taken is null |
Use Record to store a run. The module writes the eleven single tags first and Record last, in one update. A script that reads only the new value of Record always gets one complete run. A script that reads the single tags when it runs can see a mix of two runs if a second run ended in between, because Ignition does not hold the module’s writes together for a reader; on one scale that needs two runs within seconds, so it is rare, but Record removes the question. Time is the time the run ended; if it equals the one before the module writes it 1 ms later, so it can differ by a few milliseconds from the time in the gateway log line. There is no counter tag.
The tags hold the last record only, so a gateway restart shows an empty record until the next run. They have the quality of the scale’s data tags: when the scale disconnects they turn Bad_NotConnected and keep the last record’s values, and they turn Good again with the next run, not at the reconnect. A weeks-old record can therefore show Bad on a screen; the record is not damaged. A script must act on a changed value of Record, not on the quality alone.
Calibration/Result says Pass and Calibration/LastRecord/Result says PASS: the first is the text for the screen, the second is the fixed code for a script. Compare against the one you read.
Gateway tag change script (recommended). In the Designer, open Gateway Events, Tag Change, add the tag path [SICS]Scale1/Calibration/LastRecord/Record and paste this as the script. It is the body of the script, not a function:
if not initialChange and newValue.quality.isGood() and newValue.value \
and (previousValue is None or previousValue.value != newValue.value):
r = system.util.jsonDecode(newValue.value)
system.db.runPrepUpdate(
"INSERT INTO my_calibration_records (scale, operator_name, serial, kind, test_weight, unit, "
"as_found, as_left, result, detail, recorded_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
[r['scale'], r['operator'], r['serial'], r['kind'], r['testWeight'], r['unit'],
r['asFound'], r['asLeft'], r['result'], r['detail'], r['time']],
'MyDatabase')
my_calibration_records and MyDatabase are your own table and database connection; create the table first. The time is UTC text such as 2026-01-02T03:04:05.123Z; store it as text, or convert it with system.date.parse to the format your column needs. Test the script with one run before you rely on it. The same body works in a tag event script on a tag of your own, such as an expression tag {[SICS]Scale1/Calibration/LastRecord/Record} (use currentValue instead of newValue); the module’s own tags cannot carry scripts.
Transaction group (optional). A transaction group needs the SQL Bridge module. It runs on its execution rate (1 s by default) and writes at most one row per run, so use it with an execution rate below the shortest time between two calibrations (a calibration takes minutes, so a 1 s rate is fine). In the Designer make a Standard group on your own table, add the LastRecord tags as items (tag provider SICS, folder = the scale’s name, then Calibration/LastRecord), use a trigger on a change of Calibration/LastRecord/Time as your Designer offers it, and map each item to a column.
Perspective calibration screen
The module carries a second ready-made Perspective view, a wizard for one scale. It shows the state, the prompt in large type, the test weight the scale asks for, the scale’s current reading, as found, as left and the result, and has the buttons Start internal adjustment, Start external adjustment, Confirm and Abort. It is built from standard Perspective components. Get it as the scale screen: open <gateway address>/res/sics/calibration-view.json in a browser, save the file, add it to the Views of your Perspective project (see “Perspective scale screen”), and set its scale parameter to the scale name.
- The Start buttons first write the Perspective session’s user name to
Operator, then press the start tag. The name is the session’s user; a session without a login gives an empty name and the run does not start. - The buttons follow the state tag: Start only when no run is going on, Confirm only at a prompt, Abort while a run is going on. All are disabled while the scale is not connected. On a scale with Allow adjustment off the view says so and the buttons are disabled.
- The view shows the interlock when
NotAllowedNowis set and disables Start. - The view sets no security of its own: put it behind a security level of your Perspective project. Anyone who can open it can start a calibration.
Perspective scale screen
The module carries a ready-made Perspective view for one scale. It shows the net weight in large type with its unit, a Stable indicator, an Overload or Underload warning, and the scale’s connection state and last error. It has buttons for Zero, Tare, Clear tare and Reset, and a Preset tare entry with a Set tare button. It is built from standard Perspective components, so it needs nothing besides the Perspective module and works in Ignition 8.3.
To use it:
- Open
<gateway address>/res/sics/scale-view.jsonin a browser (your gateway’s address with http or https and its port) and save the file. - In the Designer, add the saved file to the Views of your Perspective project. The file is a complete Perspective view in JSON form, as the Designer exports views. Give the view a name.
- Open the view. Its one parameter,
scale, is the scale name exactly as in the scale list, for exampleScale1. Set it where you place the view (an embedded view or a page), or edit its default.
The view binds to the tags of that scale with indirect bindings, so one view serves every scale. Changing the parameter shows another scale.
- The buttons write the
Cmdtags of the scale. On a scale with Allow writes off there are noCmdtags: the buttons are disabled and the view says why. - The buttons are also disabled while the scale is not connected.
- After a press the view shows “
command sent”. The scale’s own answer shows under it as the last command error when the scale refused the command (the same text as _Status/LastWriteError). - The view sets no security of its own. Zero, Tare, Clear tare, Reset and Preset tare change the scale for every user who can open the view: put the page or the buttons behind a security level of your Perspective project.
- The tag writes are logged by the module like every other command (see “Commands”).
- The preset tare value is in the unit shown beside the entry field, the unit of the scale’s last weight.
Scripting
Gateway scope, functions of system.innorobix.sics. scale is the scale name, any case.
w = system.innorobix.sics.readStable("Scale1", 5000) # {"weight": 100.0, "unit": "g", "stable": True}
r = system.innorobix.sics.zero("Scale1") # {"outcome": "ACK", "detail": "Zeroed (stable).", "data": {"stable": "true"}}
system.innorobix.sics.tare("Scale1") # data: tare and unit
system.innorobix.sics.clearTare("Scale1")
system.innorobix.sics.presetTare("Scale1", 12.5, "kg") # value above 0, at most 6 decimals; unit 1 to 4 letters
system.innorobix.sics.reset("Scale1")
system.innorobix.sics.startCalibration("Scale1", "internal", "Maria Test") # or "external"; needs Allow adjustment
system.innorobix.sics.confirmCalibration("Scale1")
system.innorobix.sics.abortCalibration("Scale1")
st = system.innorobix.sics.calibrationStatus("Scale1") # state, prompt, requestedWeight, requestedUnit, result, asFound, asLeft
-
readStablesendsSand waits for the scale to settle, at mosttimeoutMs(default 5000, up to 15000). It is a read and needs no Allow writes. It raisesScaleTimeoutExceptionwhen no stable weight comes in time (the weight stays dynamic and the scale does not answer) and also when the scale gives up itself withS I(the weight did not settle in the scale’s own time, or the scale is busy; the two cannot be told apart), andScaleScriptExceptionfor an unknown or stopped scale, continuous mode, or an answer that is not a stable weight. While it waits, the scale’s polling waits too. Call it from a button or a gateway timer script, not from a tag change script. -
The other functions return the outcome and do not raise for a refusal:
ACK(done),NAK(the scale refused: busy, range, parameter, not supported),TIMEOUT,FAILED,REFUSED(not sent: Allow writes off, scale not connected or busy, wrong parameters).detailis a sentence for the operator. A scale that does not run at all (unknown name, disabled, held back by the licence, deleted, or not yet connected and polled after a start) raisesScaleScriptException(“not running”) instead. -
The calibration functions need Allow adjustment on the scale (not Allow writes).
startCalibration,confirmCalibrationandabortCalibrationreturn the outcome like the commands above,ACKorREFUSEDwith a sentence indetail, and the status indata;calibrationStatusis a read and returns the status dictionary (itsstateisOffwhen Allow adjustment is off). The script user is not known to the module, so the operator name is an argument ofstartCalibration; it is recorded as given. Call the functions from a button or a gateway timer script, not from a tag change script.
Licence
Without a licence for this module the module runs 2 scales while the gateway is in trial. On an activated gateway without a licence for the module nothing runs, and nothing runs after the licence or the trial has expired. The configuration is kept in every case.
If it does not connect
LastErrorsays what failed. “did not answer SI” means the TCP connection works but the scale does not speak SICS on that port.- Check the scale’s interface setting: SICS over Ethernet must be enabled and the port must match.
- Gateway log, logger
innorobix.sics.device. Setinnorobix.sics.protocolto TRACE to see every line sent and received.
Generated from the module's documentation for version 8.11.0. Questions: contact us.