Skip to content
Discussion options

You must be logged in to vote
  1. check whether node exists: there is a very helpfull stackoverflow answer:
    https://stackoverflow.com/a/78086111/11322034

  2. about the struct I found a solution that works:

# defining struct (see 1. code in question post)
await server.load_data_type_definitions()  # very important to enable the struct idk
# create struct
dataScruct = ua.ProcessDataStruct()
# put mock/initial-data in struct
dataScruct.Timestamp = datetime.now()
dataScruct.CurrentValue = 55.5
dataScruct.Error = False
dataScruct.StatusMessage = ''
# add variable
sensor65 = await myobj.add_variable(idx, "Sensor65", ua.Variant(dataScruct, ua.VariantType.ExtensionObject))

# start server
async with server:
    self.logger.info("…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Sayum24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant