Hi all, I'm looking for ideas to trigger multiple sets and checks with waiting periods from Visio via a single button. Some examples includes:
#1
Sets AdminStatus of interface_1 on Element_A to 'Down'
Sets AdminStatus of interface_1 on Element_B to 'Up'
#2
Sets AdminStatus of interface_1 on Element_A to 'Down'
Sets AdminStatus of interface_1 on Element_B to 'Down'
Sets AdminStatus of interface_2 on Element_C to 'Up'
Wait 1 sec
Sets AdminStatus of interface_2 on Element_C to 'Down'
Wait 1 sec
Sets AdminStatus of interface_2 on Element_C to 'Up'
#3
Sets a PID to DISABLE
Wait for 1 second
Confirm that the set was successful by checking the PID value again
Set the PID to ENABLE
Wait for 1 second
Confirm that the set was successful by checking the PID value again
One idea is to write an automation that is capable of taking in a set of instructions in a well-defined format (e.g.: json). An example is provided below.
This way the automation script is generic and can be used to form other multiple sets.
(1) What I'm looking for is pros and cons of doing it using this method (e.g.: keeping track of the json string in the shape data could be difficult)
(2) Also has this already been done and there is something that we can perhaps re-use?
(3) Would a driver be more appropriate than an automation script in such a use case?
{
"Actions": [{
"order": 1,
"action": "SET",
"element_name": "element_A",
"pid": 123,
"idx": "itf_1",
"intended_value": "off"
"retries": 1
}, {
"order": 2,
"action": "WAIT",
"duration": 5,
}, {
"order": 3,
"action": "CHECK",
"element_name": "element_A",
"pid": 456,
"idx": null,
"expected_value": "power_down"
"retries": 1
}
]
}
Hi Bing Herng,
Using automation sounds like a good option to me. Even though there are waiting periods and multiple sets and gets, the execution happens only once.
In a driver, you are using timers that trigger actions every cycle and also trigger sets and gets on button clicks.
You can achieve this easily through the automation script in combination with Visio.
To display the JSON in Visio, you could set Visio variables through the script:
Alternatively, you could set custom properties on the view/element that are then shown in Visio.
You would probably need to deserialize the data first.
Best regards,