Reading a tool offset value|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Reading a tool offset value
Avatar
Davy T
New Member
Members
Forum Posts: 2
Member Since:
02/14/2019
sp_UserOfflineSmall Offline
1
08/25/2020 - 08:01
sp_Permalink sp_Print

Hi,

After a successful connection to a machine Siemens Sinumerik 840-d, we are trying to read a tool offset value. Here is the minimal code:

// Connection to the machine
Session session = Session.Create(…);

// List of nodes to read
ReadValueIdCollection nodesToRead = new ReadValueIdCollection ();
string nodeId = “ns=2;s=/ToolCompensation/edgeData[u1,c2,1]
var readValueId = new ReadValueId () { NodeId = nodeId, AttributeId = Attributes.Value, IndexRange = “” };
nodesToRead.Add (readValueId);

// Get the answer
session.Read (null, int.MaxValue, TimestampsToReturn.Both, nodesToRead, out DataValueCollection results, out DiagnosticInfoCollection diagnostics);
object answer = results[0].Value;

The variable “diagnostics” is null so it is good. But the problem we are facing is that the variable “answer” is also null. We are however sure that the node “/ToolCompensation/edgeData” exists and that the format to use is “/ToolCompensation/edgeData[u1,c {column number},{tool number}]”, according to the Siemens specifications. We also tried different configurations like:

  • /ToolCompensation/edgeData
  • /ToolCompensation/edgeData[u1,1]
  • /ToolCompensation/edgeData[1,1,1]

Does anyone know why we are receiving null values? Is it possible that while the address “/ToolCompensation/edgeData” is valid, values are really null?

Best regards,
Davy

Avatar
Zbynek Zahradnik
Member
Members
Forum Posts: 62
Member Since:
02/24/2014
sp_UserOfflineSmall Offline
2
08/25/2020 - 20:55
sp_Permalink sp_Print

First thing to do is to look at the whole results[0], not just results[0] Value. Specifically, check results[0].StatusCode, to see if there isn’t a Bad status – and if so, with some useful code bits to tell you why it is Bad.

Best regards

Avatar
Davy T
New Member
Members
Forum Posts: 2
Member Since:
02/14/2019
sp_UserOfflineSmall Offline
3
10/09/2020 - 00:10
sp_Permalink sp_Print

Sorry for my late reply. It appeared that my code was right, the problem being on the server.

We took also your suggestion to read the StatusCode that will help in the possible debugging sessions to come.

Best regards,
Davy

Avatar
T Scheep
New Member
Members
Forum Posts: 1
Member Since:
07/25/2022
sp_UserOfflineSmall Offline
4
07/25/2022 - 09:05
sp_Permalink sp_Print

dtriponney@lemoinetechnologies.com said
Sorry for my late reply. It appeared that my code was right, the problem being on the server.

We took also your suggestion to read the StatusCode that will help in the possible debugging sessions to come.

Best regards,

Davy

  

Hi Davy,

We are currently running into a very similar problem when trying to retrieve the tool offset values. Could you indicate what the problem was on the OPCUA server that was causing issues? And perhaps you have a minimal example of the correct way to retrieve the values specified? As all our current approaches cause null values to be returned we are at a loss as to what the correct way forward should be.

Thanks!

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
5
07/25/2022 - 13:29
sp_Permalink sp_Print

The DataValues returned have a StatusCode field.

Make sure you check  it. If it is bad it should give you an idea why.

Avatar
Marc Archambault
New Member
Members
Forum Posts: 1
Member Since:
03/14/2023
sp_UserOfflineSmall Offline
6
03/14/2023 - 11:41
sp_Permalink sp_Print

Hello all,

I think I am running into the exact same problem as you guys did. I want to access the geometry offset and the wear offset of an Index machine with a Sinumerik 840Dsl controller. This is to be done from an client in Python.

The documentation that I have seems to say that all this info is under the adress “/Tool/Compensation/edgeData”

It also says to it should be called this way $/Tool/Compensation/edgeDatax[y,z] x = ParamNo y = ToolNo z = EdgeNo

I am unable to get any information even when knowing X,Y and Z. 

What am i getting wrong here?

 

Thanks a lot

Marc

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: radziu ignac
Guest(s) 34
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1446
Posts: 4890