How can we help?

Siemens OPC UA Constants and Variables

You are here:
< All Topics

Siemens OPC UA Source Variables

Siemens variables are used to hold data retrieved from Siemens OPC UA devices.

The information in curly brackets are required parameters specifying additional information, such as a spindle number, about the data being retrieved.

Some variables optionally support multiple paths. Valid options are nothing, a path number, or All. These are denoted in the variable list with a {} inside the variable brackets: [SiemensOPCUA.variable_name{}]. The following are example values to determine which path to read:

  • Path 1:[SiemensOPCUA.cycle_status] or [SiemensOPCUA.cycle_status{1}]
  • Path 2: [SiemensOPCUA.cycle_status{2}]
  • Loop (checks if a variable is true for any path): [SiemensOPCUA.feed_hold_status{All}]
Variable NameNotes
Active Tool [SiemensOPCUA.active_tool{}]Returns the tool position of the active tool. Any individual path.
Alarm Code [SiemensOPCUA.alarm_code]Returns the alarm code without the description. No Path.
Alarm Status [SiemensOPCUA.alarm_status]0 = No Alarm. No Path.
Capture Alarms [SiemensOPCUA.alarms]Used to capture all Siemens alarms including those that go off simultaneously. No path.
Axis Feed Rate
[SiemensOPCUA.axis_feed_rate{}] {AXIS}
Feed Rate Information for the specified path and axis number. Any individual path.
Connect Time [SiemensOPCUA.connect_time]The connect time for the most recent poll. No path.
Connected Time [SiemensOPCUA.connected_time]Returns the amount of time in seconds since a successful connection to the Source. No path.
Coolant [SiemensOPCUA.coolant]0 = Coolant Off
1 = Coolant On
No Path
Current Executing Block [SiemensOPCUA.current_block]The variable will hold the contents of the current line being executed. No Path
Cycle Status [SiemensOPCUA.cycle_status{}]0 = Idle, 1 = Cycling. Used with the constants CYCLING and IDLE. Any individual path or all paths.
Dry Run [SiemensOPCUA.dry_run{}]0 = Dry Run Off
1 = Dry Run On
Any Individual Path
Emergency Status [SiemensOPCUA.emergency_status]0 = Not in Emergency, 1 = In Emergency. No path.
Feed Hold Status [SiemensOPCUA.feed_hold_status]0 = Not Holding, 1 = Holding. No path.
Feed Rate Override [SiemensOPCUA.feedrate_override{}]The current feed rate override as a percentage. Any Path.
Mode Selection [SiemensOPCUA.mode_selection{}]The current setting for the mode selection.  Options are AUTO (0), MDI (1), and JOG (2). Constants, which are listed below, can be used to reference these numbers. Any individual path.
Optional Stop State [SiemensOPCUA.optional_stop{}]0 = Optional Stop Off
1 = Optional Stop On
Any Path.
Part Count [SiemensOPCUA.part_count]Returns the current part count from the Siemens part counter. No Path.
Path Feed Rate [SiemensOPCUA.path_feed_rate]Returns the current path feed rate. No Path.
Program File Name [SiemensOPCUA.program_filename{}] Returns the actual file name of the program. Any individual Path.
Program File Name Executing [SiemensOPCUA.program_filename_executing{}]Returns the executing program number. This may be the main program or a sub program. Some programs may not have a program number. Any individual Path.
Program Stop (M0) [SiemensOPCUA.program_stop]Returns True if the program has stopped due to an M0 code. No path.
Rapid Override [SiemensOPCUA.rapid_override{}]Returns the percentage of the rapid traverse override. Any individual path.
Single Block Status [SiemensOPCUA.single_block_status{}]0 = Single Block off, 1 = Single Block On. Any individual path or all paths.
Spindle Load Meter Percent [SiemensOPCUA.spindle_load_meter_percent{}] {SPINDLE NUMBER}Spindle Load in percent for the specified spindle. Any individual path.
Spindle Override [SiemensOPCUA.spindle_override{}] {SPINDLE NUMBER}The active spindle override as a percentage. Any individual path.
Spindle Speed [SiemensOPCUA.spindle_speed{}] {SPINDLE NUMBER}Returns the speed of the specified spindle. Any individual path.

The following variables hold the value for the previous poll from the Control. The same rules for reading paths above will apply.

Variable NameSyntax
Active Tool (Previous)[SiemensOPCUA.prev_active_tool{}]
Alarm Code (Previous)[SiemensOPCUA.prev_alarm_code]
Alarm Status (Previous)[SiemensOPCUA.prev_alarm_status]
Alarms (Previous)[SiemensOPCUA.prev_alarms]
Connect Time (Previous)[SiemensOPCUA.prev_connect_time]
Connected Time (Previous)[SiemensOPCUA.prev_connected_time]
Coolant (Previous)[SiemensOPCUA.prev_coolant]
Current Executing Block (Previous)[SiemensOPCUA.prev_current_block]
Cycle Status (Previous)[SiemensOPCUA.prev_cycle_status{}]
Dry Run (Previous)[SiemensOPCUA.prev_dry_run{}]
Emergency Status (Previous)[SiemensOPCUA.prev_emercency_status]
Feed Hold Status (Previous)[SiemensOPCUA.prev_feed_hold_status]
Feed Rate Override (Previous)[SiemensOPCUA.prev_feedrate_override{}]
Mode Selection (Previous)[SiemensOPCUA.prev_mode_selection{}]
Optional Stop State (Previous)[SiemensOPCUA.prev_optional_stop{}]
Part Count (Previous) [SiemensOPCUA.prev_part_count]
Path Feedrate (Previous)[SiemensOPCUA.prev_path_feedrate]
Program File Name (Previous)[SiemensOPCUA.prev_program_filename{}]
Program File Name Executing (Previous)[SiemensOPCUA.prev_program_number_executing{}]
Program Stop (M0) (Previous)[SiemensOPCUA.prev_program_stop]
Rapid Override (Previous)[SiemensOPCUA.prev_rapid_override{}]
Single Block Status (Previous)[SiemensOPCUA.prev_single_block_status{}]
Spindle Load Meter Percent (Previous)[SiemensOPCUA.prev_spindle_load_meter_percent{}] {SPINDLE NUMBER}
Spindle Override (Previous)[SiemensOPCUA.prev_spindle_override{}]
Spindle Speed (Previous)[SiemensOPCUA.prev_spindle_speed{}] {SPINDLE NUMBER}

Siemens OPC UA Constants

Constant NameSyntax
Auto Mode[SiemensOPCUA.AUTO]
Cycling[SiemensOPCUA.CYCLING]
Idle[SiemensOPCUA.IDLE]
Manual Mode[SiemensOPCUA.JOG]
MDI Mode[SiemensOPCUA.MDI]
Table of Contents