Topics covered in this article
- Prerequisites
- Setting the OPC-UA option
- Configuring the OPC-UA option
- MachineMetrics sample script file
Prerequisites
- SINUMERIK Operate is a requirement for OPC UA server.
- The OPC UA license (6FC5800-0AP67-0YBO) is also a requirement and may need to be installed by a service technician.
- The HMI time needs to be checked and set.
Compatibility of OPC UA server version and CNC software versions
CNC software version | OPC UA version |
4.5 | V2.2 and V3.0 SP1 |
4.07 - SP2...SP5 | V2.2 and V3.0 SP1 |
4.08 - SP2...SP3 | V2.2 and V3.0 SP1 |
4.92 and 4.92 - HF2 | V3.0 SP1 |
Setting the OPC-UA option
- Go to Startup
- Press Licenses softkey
- Go to Access MyMachine / OPC UA and check the box under Set as shown below
If you do not have the license, use this link to purchase from Siemens.
Configuring the OPC-UA option
- Go to Startup
- Press Network softkey
- Press OPC UA softkey
- Press Setting softkey
- Press Change softkey
- Make required changes to Connection, Authentication, Activation.
-
- Note: Port setting of 4840
-
If these screens do not match your CNC screens it is likely that you are on a different version to the v4.7 we are showing, you can find OPC-UA guides on the Siemens website.
Photo credit: Siemen's Configuration Manual, 08/2019, 6FC5397-1DP41-0BA3
- Choose OK and you will see a safety note appear regarding an open port in the firewall.
Photo credit: Siemen's Configuration Manual, 08/2019, 6FC5397-1DP41-0BA3
MachineMetrics sample script file
- Snippet of our adapter script file for a Siemens CNC 840d or 828D OPC-UA and the associated namespace tags.
version: 2
username: #Enter Username Here
password: #Enter Password Here
security-mode: Sign #or SignAndEncrypt or None
security-policy: Basic256Sha256 #or Basic256 or Basic128Rsa15 or None
tags:
tool-group:
path: ns=2;s=/Channel/State/actToolIdent
tool-num:
path: ns=2;s=/Channel/State/actTNumber
line-number:
path: ns=2;s=/Channel/ProgramInfo/actLineNumber
spindle-load:
path: ns=2;s=/Nck/Spindle/driveLoad
prog-status:
path: ns=2;s=/Channel/State/progStatus
controller-op-mode:
path: ns=2;s=/Bag/State/opMode
op-mode:
path: ns=2;s=/Nck/Spindle/opMode
position:
path: ns=2;s=/Nck/Spindle/psModePos
spindle-speed:
path: ns=2;s=/Nck/LogicalSpindle/actSpeed
last-alarm-number:
path: ns=2;s=/Nck/LastAlarm/alarmNo
feed-rate:
path: ns=2;s=/Channel/MachineAxis/actFeedRate
prog-name:
path: ns=2;s=/Channel/ProgramInfo/progName
act-parts:
path: ns=2;s=/Channel/State/actParts
spindle-turn-state:
path: ns=2;s=/Nck/Spindle/turnState
total-parts:
path: ns=2;s=/Random@NCU_1/Plc/DB165.DBD50
feedrateovr:
path: ns=2;s=/Channel/MachineAxis/feedRateOvr
workpandprogname:
path: ns=2;s=/Channel/ProgramPointer/workPandProgName
variables:
execution:
- source: prog-status
- state:
- INTERRUPTED: this == 1
- STOPPED: this == 2 or this == 5
- ACTIVE: this == 3 or this == 4
- READY: true
controller-mode:
- source: controller-op-mode
- state:
- MANUAL: this == 0
- MANUAL_DATA_INPUT: this == 1
- AUTOMATIC: this == 2
spindle-rotating:
- source: spindle-turn-state
- state:
- ON: this == 0 or this == 1
- OFF: this == 2
data-items:
- spindle-speed
- spindle-load
- feed-rate
- last-alarm-number
- line-number
- tool-group
- tool-num
- prog-name
- act-parts
- total-parts
- feedrateovr
- workpandprogname
Note: this is only valid for a Siemens CNC
Have Questions?
Reach out to our team at Support@machinmetrics.com.
Comments
1 comment
Thank you for sharing this information. It is very interesting.
What version of CN did you use to retrieve this data file? And what was the version of the license server on OPCUA?
In my case, the NC version is 04.07. Is it possible to apply this technique in this case?
Thank you in advance.
Please sign in to leave a comment.