Machines

class pytm4srv.models.Machine

Represents one reporting machine.

active_tool: Mapped[int | None]

The number of the last active tool reported by the machine, or NULL.

alarm_notification_grouping: Mapped[int]

A notification will be sent when this many alarms have occurred so far in the day. The next notification will be sent after this many more alarms.

alarms: Mapped[list[dict]]

A list of current alarms. For details, see Machine state format.

archived: Mapped[bool]

Whether the machine is not currently in use and should be hidden.

autocomp_support: Mapped[bool]

Whether this machine is configured for AutoComp.

current_work_order: Mapped[str]

User-specified work order name to be applied to newly finished parts.

custom_alarms: Mapped[dict[str, str]]

User-defined alarm messages.

custom_properties: Mapped[Dict[str, Any]]

Custom properties for this machine.

These can be used to enable experimental behavior, change advanced settings, etc.

Only modify these under the direction of Wolfram Manufacturing Technologies.

cycle_state_id: Mapped[BigInteger | None]

The current cycle execution state.

description: Mapped[str]

User-specified, persistent description for this machine.

Equivalent to the notes field of other types, but renamed to avoid confusion with per-day shift notes.

disabled: Mapped[bool]

Whether the machine is currently disabled and should be hidden.

Unlike archived machines, OnTakt will not attempt to connect to disabled machines.

downtime_alarms: Mapped[List[str]]

A list of alarm messages that will automatically create downtime on this machine.

This is processed independently of custom_alarms, so these should be the strings as reported by the control.

earning_rate: Mapped[float]

Average currency value of this machine’s runtime per hour.

estopped: Mapped[bool | None]

Whether or not this machine is currently emergency stopped.

feed_rate_override: Mapped[int | None]

The last feed rate override (percentage) reported by the machine, or NULL.

Stored as an integral percentage, for example: 100 for 100%.

id: MappedColumn object at 0x7c965e161c60>]]

Unique, numeric ID for the machine in OnTakt.

ignore_zero_part_count: Mapped[bool]

Whether to ignore the part count when it is zero.

This should be enabled for if they are reporting many ghost parts at once, because this means the control is intermittently reporting an incorrect part count of zero.

inventory_point_id: Mapped[int | None]

This machine’s primary inventory point.

keep_current_work_order: Mapped[bool]

Whether to continue the current work order when a process switch is detected instead of clearing it.

last_contact: Mapped[datetime | None]

The timestamp of the last time this machine reported.

last_part_count: Mapped[int]

The last part count the machine reported.

last_preflight_check: Mapped[datetime | None]

The timestamp of the last time an external service ran a Preflight™ check on this machine.

last_tmac_contact: Mapped[datetime | None]

The timestamp of the last time TMAC reported.

last_vars: Mapped[dict[str, Any]]

The last known state of all common variables.

Note that for JSON compatibility, keys (variable numbers) will be strings.

mute_alarms: Mapped[List[str]]

List of alarm codes to skip notifications for.

name: Mapped[str]

User-specified name for the machine.

nc_properties: Mapped[Dict[str, str]]

Key/value map of properties related to the selected system.

The keys are the properties of the selected system from GET /api/machines/systems.

All keys and values are strings. Extra properties are ignored.

notify_channel: Mapped[int | None]

Notification channel ID to send messages to when events occur.

notify_cycle_completed: Mapped[bool]

Whether to send a notification when this machine completes a cycle resulting in at least one new part.

notify_end_shift: Mapped[bool]

Whether to send a report notification at the end of the shift.

notify_feed_hold: Mapped[bool]

Whether to send notifications when the machine enters FEED HOLD.

notify_goal_met: Mapped[bool]

Whether to send notifications when this machine meets the part goal.

notify_mid_shift: Mapped[bool]

Whether to send a report notification in the middle of the shift.

notify_nc_alarms: Mapped[bool]

Whether to send notifications for machine alarms.

See also: alarm_notification_grouping

notify_process_changed: Mapped[bool]

Whether to send a notification when this machine changes between processes.

notify_production_behind: Mapped[int]

Setting to a positive number will notify when the machine’s production has fallen behind the goal line by that percent. Set to 0 to disable.

notify_production_stopped: Mapped[bool]

Whether to notify when production seems stuck/stopped.

notify_tmac_alarms: Mapped[bool]

Whether to send notifications for TMAC alarms.

See also: alarm_notification_grouping

part_count_cv: Mapped[int | None]

Variable to use to count parts on this machine.

This can be overridden by individual processes.

priority: Mapped[int]

The current priority of this machine for sorting and delegating.

Allowed values are: - 1 = low - 2 = medium (default) - 3 = high

program_cv: Mapped[int | None]

If this is set and there is a program from this machine with its load_by_var_value equal to the value of this variable, that program will be loaded instead of the reported program name.

program_name: Mapped[str | None]

The filename of the currently running program.

rapid_override: Mapped[int | None]

The last rapid override (percentage) reported by the machine, or NULL.

Stored as an integral percentage, for example: 100 for 100%.

shift_notes_notify: Mapped[bool]

Whether to notify when shift notes are submitted.

system: Mapped[str]

The protocol to use when communicating with the control.

This is a value of the key field from GET /api/machines/systems.

tags: Mapped[List[str]]

List of tags this machine has.

target_utilization: Mapped[int]

The expected utilization (%) of this machine over the measurement period (usually 1 week).

time_study: Mapped[bool]

Whether this machine is currently part of a time study.

tmac_alarm: Mapped[dict[str, float]]

A mapping of the alarm name to the timestamp OnTakt first saw it.

tmac_api_key: Mapped[str]

API key used to access the TMAC 3.0 API.

Configured in TMAC -> Profiles -> Application Integrations.

If the active user is not an administrator, this will be returned as a boolean indicating whether it is set instead of the actual value.

tmac_instance_name: Mapped[str]

Instance name of the machine on the TCU.

tmac_job: Mapped[str | None]

The name of the TMAC job last reported for this machine.

tmac_learn: Mapped[bool | None]

The state of TMAC learn mode last reported for this machine.

tmac_monitor_disable_limit: Mapped[timedelta | None]

How long TMAC monitoring can be disabled before a warning notification is sent.

NULL means notifications will never be sent.

tmac_monitor_disabled: Mapped[datetime | None]

When TMAC monitoring was last switched off.

NULL means it is currently enabled, or we have not received a TMAC message for this machine.

tmac_monitor_notified: Mapped[bool]

Whether we have already notified about TMAC monitoring being disabled this time.

tmac_url: Mapped[str | None]

URL of the Caron TMAC MTConnect endpoint.

tools_seen: Mapped[List[int]]

The tool numbers that have been reported as active since the last part was finished.

class pytm4srv.models.OEE

Represents a calculated OEE for a single machine at a single point in time.

availability: Mapped[int | None]

Availability score (%) stored as an integer between 0 and 100.

id: MappedColumn object at 0x7c965e161c60>]]

Unique, numeric ID for the machine in OnTakt.

machine_id: Mapped[int]

The ID of the machine this OEE was calculated for.

notes: Mapped[str]

User-specified notes about this measurement.

property overall: int | None

Overall score (%) as an integer between 0 and 100 if at least one factor is present, otherwise None.

performance: Mapped[int | None]

Performance score (%) stored as an integer between 0 and 100.

quality: Mapped[int | None]

Quality score (%) stored as an integer between 0 and 100.

timestamp: Mapped[datetime]

The date and time this OEE was calculated.