Login  •  Register


Client State Machine handling

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Client State Machine handling

Postby sxdev » 25 Mar 2020, 09:32

Hi,

I am developing an OPC UA client application that shoult programatically react to the current state of a finite state machine.
Is it the correct way to check the CurrentState->Id's value (which is a node id as you know) against the node ids of the states defined in the state machine's type definition?

Some pseudo code:
Code: Select all
if (CurrentState.Id == NodeId(ExampleStateMachineType.StateA))
{
  // react to state A
}
else if CurrentState.Id == NodeId(ExampleStateMachineType.StateB))
{
  // react to state B
}
// ... and so on


Or is there another way of checking the state? Maybe in a more "enum like" way?

Thank you!
sxdev
Jr. Member
Jr. Member
 
Posts: 1
Joined: 25 Mar 2020, 09:07

Return to Technical

Who is online

Users browsing this forum: No registered users and 0 guests