mappView TIME Datatype: Configuring Millisecond Input

Karen Mitchell2 min read
B&R AutomationHMI ProgrammingTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

A TIME variable exposed through OPC UA appears as an Int32 value in milliseconds. Because no engineering unit or limits can be assigned in the OPC UA view, mappView cannot perform unit-aware node binding or automatically convert milliseconds to seconds. Use one of the following workarounds according to whether readable TIME literals, direct binding, or centralized visualization logic matters most.

Why direct TIME binding fails

TIME improves application-code readability by accepting literals such as T#2s_100ms. After OPC UA exposure, however, the value is an Int32 measured in milliseconds without unit metadata. A mappView widget therefore cannot infer the conversion, and node binding that depends on the unit is unavailable.

DateTimeInput is also unsuitable when millisecond entry is required: it adjusts time only to seconds. NumericInput provides the required numeric control, but TIME must first be adapted through the PLC data model or a compound widget.

Compare the three workarounds

Variant Data path Primary benefit Constraint
Integer plus NumericInput Integer milliseconds bound directly to NumericInput Simple binding with an assignable unit Loses TIME literals; enter 2200 instead of T#2s_200ms
Compound widget TIME bound to the compound widget; NumericInput uses a local property Retains TIME in the application and contains conversion in one reusable widget Requires explicit permission handling on the compound widget
UDINT conversion in the PLC UDINT visualization values converted with UDINT_TO_TIME and TIME_TO_UDINT Supports unit-aware node binding and backend conversion Requires at least two interface variables, bindings, and cyclic conversion logic

Configure the compound-widget conversion

This approach is useful when many TIME configuration values must be presented consistently without duplicating conversion logic throughout the PLC application.

  1. Place a NumericInput inside a compound widget and bind the NumericInput to a local property rather than directly to the application value.
  2. Bind the application TIME value, represented in milliseconds through OPC UA, to the compound widget.
  3. When the NumericInput value changes, multiply the local display value by 1000 before writing the millisecond value.
  4. When the millisecond property changes, divide it by 1000 before updating the NumericInput.
  5. Apply PermissionOperate to the compound widget. Without this protection, the NumericInput can accept an edited display value even when variable permissions prevent the underlying write.

Select and verify the implementation

Choose the integer variant when millisecond integers are acceptable in application code. Choose the compound widget when preserving TIME variables and reusing one visualization conversion across many settings outweighs the extra widget configuration. Choose PLC-side UDINT conversion when the application needs unit-aware node binding and the additional interface variables and cyclic logic remain manageable.

Verify both directions: enter a value containing fractional seconds, confirm that the backend receives the corresponding millisecond value, then change the backend TIME value and confirm that the display divides it by 1000. Finally, test with write permission denied; the compound widget must prevent operation instead of retaining an uncommitted edit.

FAQ

Why can’t mappView bind a TIME variable with a unit?

OPC UA exposes TIME as an Int32 value in milliseconds, but no unit can be assigned in the OPC UA view. Without unit metadata, mappView cannot infer a milliseconds-to-seconds conversion for node binding.

Can DateTimeInput edit milliseconds in mappView?

No. The available DateTimeInput adjustment reaches seconds but does not permit millisecond entry; use NumericInput with an integer, compound-widget, or UDINT conversion workaround.

How do I prevent unauthorized edits in a TIME compound widget?

Apply PermissionOperate to the compound widget. Otherwise, its NumericInput can accept the edited display value even when permissions prevent the application variable from changing.

Back to blog