Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Simon Bowen
@simonbowen

OK are you saying that

 const parameter = new Variant({
      dataType: DataType.UInt32,
      value: value
    });

Is not the correct definition?

Andreas Heine
@AndreasHeine
because its not an UInt32 i guess
Simon Bowen
@simonbowen
Is it possible to determine what it should be using UAExpert?!
what is ns=6 in the namespace array by the way
Simon Bowen
@simonbowen
I am not sure how to show you.
Andreas Heine
@AndreasHeine
in the serverobject is an namespacearray variable
Simon Bowen
@simonbowen
image.png
Is that what you mean?
Andreas Heine
@AndreasHeine
image.png
Simon Bowen
@simonbowen
image.png
Sorry, this must me really frustrating for you.
Andreas Heine
@AndreasHeine
no worries ^^
ok ns=6 is custom (br.../PLC/PV)... not sure if i can help there
is the server packml compliant?
Simon Bowen
@simonbowen
It should be.
Andreas Heine
@AndreasHeine
it does not have the namespace ("http://opcfoundation.org/UA/PackML/")... that thing is not compliant at all!
Simon Bowen
@simonbowen
Ah OK, that's concerning.
Andreas Heine
@AndreasHeine
usually you import the xml from the packml and build the model with the packml-objects/types/...
serverside
Simon Bowen
@simonbowen
TBH I am a complete novice when it comes to automation, I'm just trying to integrate some software to call that method. Which is vital.
Andreas Heine
@AndreasHeine
but this looks like someone build something similar without the cs nodeset from packml
you need to find ns=6;i=180 typedefinition
the easiestr way is th write a small client which just reads it definition
Simon Bowen
@simonbowen
image.png
Is that it?
Andreas Heine
@AndreasHeine
no you need the datatype of that nodeid
Simon Bowen
@simonbowen
OK could I read that Node and then get the data type that way?
Andreas Heine
@AndreasHeine
sure!
Simon Bowen
@simonbowen
async getGeneralPackMLMode(): Promise<DataValue> {
    return await this.session.read({
      nodeId: new NodeId(NodeIdType.NUMERIC, 180, 6),
      attributeId: AttributeIds.DataType
    });
  }
DataValue {
  value: Variant { dataType: 0, arrayType: 0, value: null, dimensions: null },
  statusCode: ConstantStatusCode {
    _value: 2150957056,
    _description: 'The attribute is not supported for the specified Node.',
    _name: 'BadAttributeIdInvalid'
  },
  sourceTimestamp: null,
  sourcePicoseconds: 0,
  serverTimestamp: 2022-08-26T15:17:47.617Z {
    high_low: [ 30980446, -4282142 ],
    picoseconds: 917000000
  },
  serverPicoseconds: 917000000
}
Andreas Heine
@AndreasHeine
progress ^^ ok it does not have the attribute good to know try "AttributeIds.DataTypeDefinition"
Simon Bowen
@simonbowen
DataValue {
  value: Variant { dataType: 0, arrayType: 0, value: null, dimensions: null },
  statusCode: ConstantStatusCode {
    _value: 2150957056,
    _description: 'The attribute is not supported for the specified Node.',
    _name: 'BadAttributeIdInvalid'
  },
  sourceTimestamp: null,
  sourcePicoseconds: 0,
  serverTimestamp: 2022-08-26T15:21:08.710Z {
    high_low: [ 30980447, 2006644838 ],
    picoseconds: 615000000
  },
  serverPicoseconds: 615000000
}
Andreas Heine
@AndreasHeine
ok...
does AttributeIds.Value work?
Simon Bowen
@simonbowen
DataValue {
  value: Variant { dataType: 0, arrayType: 0, value: null, dimensions: null },
  statusCode: ConstantStatusCode {
    _value: 2150957056,
    _description: 'The attribute is not supported for the specified Node.',
    _name: 'BadAttributeIdInvalid'
  },
  sourceTimestamp: null,
  sourcePicoseconds: 0,
  serverTimestamp: 2022-08-26T15:22:15.452Z {
    high_low: [ 30980447, -1620898998 ],
    picoseconds: 961000000
  },
  serverPicoseconds: 961000000
}
If it's any help, I can call the method in UAExpert without a problem.
Andreas Heine
@AndreasHeine
can you send a screenshot how it looks (the dialog for the methodcall)
i am confused...
Simon Bowen
@simonbowen
image.png
Andreas Heine
@AndreasHeine
its a ENUM
Simon Bowen
@simonbowen
Ahhh OK
Andreas Heine
@AndreasHeine
try Int32 instead of UInt32 !
DataType.Int32 in your variant
should do the trick
Simon Bowen
@simonbowen
That did. Thank you!
So that I can understand, are enums always Int32?
because the Enumeration DataType is a subtype of Int32
Simon Bowen
@simonbowen
Thank you so much.
Andreas Heine
@AndreasHeine
your welcome!