Hi Dojo,
We have driver that takes too long to execute some sets. That's because when we perform sets, function will be executed. In that function we are looping through table that has more that 300 rows and for every row we need to get data from device which will cause slowness.
Improvements are not possible in code because we need to send requests in loop.
One possible solution is to check how many rows that table has, and then for example if table has 300 rows, we want to call automation script 6 times in parallel from protocol and forward 50 rows. That way we will speed up execution of function. if we can run it in parallel.
I created dummy script where I send dummy request to device and loop same request 50 times to see can device handle multiple requests in parallel.
I created main script and run that dummy script which will start subscript - dummy script.
Main script:
var script = engine.PrepareSubScript("Dummy script");
script.StartScript();
script.StartScript();
I found that scripts are not executed in parallel. Main script will wait to first iteration of script been finished and only then execute second iteration.
I can't find anything about this topic. Is it possible to run automation scripts in parallel?
Hi Dario,
You can run automation script in parallel by using the SubScriptOptions.Synchronous property.
However, if you're performing sets from those automation scripts to the same element, I'm doubting if this approach will improve the performance. All of those sets will get queued in the SetParameter stack in SLDataminer and then again handled one by one. (see: https://docs.dataminer.services/develop/devguide/Connector/InnerWorkingsSLDataMiner.html)
Hi Thomas, thank you for your answer. With script.Synchronous = false; it will execute scripts in parallel. We won’t do sets in a script, we want to speed up getting all data from device. Unfortunately, in this case that is not possible because device can’t handle all requests sent in parallel.