Client - Write into User Created Datatype #1505
-
|
Hello! I have an S7-1212 as Server and I created a Data Type called 'sequenceDT' which is made of 6 integer variables, 1 array of 15 integers and 1 array of 5 bool. Then I created an array of 50 'sequenceDT' and published on the OPC Server. How can I write into one of the variables of that array? So, 'sequence' is an array of 50 'sequenceDT', so I was hoping the address would be something like 'ns=5;s="opcData"."sequence".[0]."prog"' for one of the integer variables and 'ns=5;s="opcData"."sequence".[0]."args".[0]' for one of the arrays, but apparently it isn't. Could someone help me out, please? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Did you try to write the node in uaexpert? This should work if the value is a array: client.load_type_definitions()
struct = client.get_node('ns=5;s="opcData"."sequence"')
data = struct.get_value()
data[0].prog = .....
struct.set_value(data)If it doens't work I would consider switching to the asyncua library. Because this is no longer in development and is missing a lot of features/bugfixes, that are in asyncua. |
Beta Was this translation helpful? Give feedback.
Did you try to write the node in uaexpert?
This should work if the value is a array:
If it doens't work I would consider switching to the asyncua library. Because this is no longer in development and is missing a lot of features/bugfixes, that are in asyncua.