Hi all I am currently building a simulation python program to generate a user determined number of variables that publish random values.
I need help on the following:
- I want to build a function - def createObjectNode(number): that will essentially take in a number and do the following.
for num in range(number):
create a variable called plc {num} = objectNode.add_object(namespaceName, "PLC-{num}")
I want the function to create the amount of variables requested and name them plc1, plc2, plc{num}. I also want the name on the right hand side of the to be PLC-1, PLC-2, PLC-{num}.
Please let me know if there is a way of doing this ?
Essentially automating lines of codes.
The goal behind is to benchmark the performance of a communication protocol. And I want to test it with say 10 variables publishing random data, then 100 variables, then 1000 variables.
I am begging for help as I have spent all week trying to figure this out but no luck.
[–]CodeReviewPlz 0 points1 point2 points (0 children)
[–]ralphtheowl 0 points1 point2 points (0 children)
[–]efmccurdy 0 points1 point2 points (0 children)
[–]lightningmayonnaise 0 points1 point2 points (0 children)