I'm working on rewriting a bunch of Procomm meta keys that send pre-defined commands as ScriptCommunicator sequences and running into some difficulty making it work. In this scenario, ScriptCommunicator is communicating via RS232 to an embedded device running Linux, but the difficulty I'm running into is being able to force the sequence to pause/wait for a response before sending the next command in the sequence value. Right now, they're sending too fast and it's causing some issues getting the remote device to process the commands correctly.
Could I get some direction on the best way of doing this? The idea I'm researching right now is using a single sequence script that automatically throws a sleep/wait between each newline in the sequence value, but my JS/ES programming background is not my strong suite.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would do this with a worker script (you have to add this in the Script Window). You can find an example script in the attachment that:
- sends a command
- waits for the answer (ACK string)
- sends a command
...
After the ACK for the third command is received the script stops itself.
I'm working on rewriting a bunch of Procomm meta keys that send pre-defined commands as ScriptCommunicator sequences and running into some difficulty making it work. In this scenario, ScriptCommunicator is communicating via RS232 to an embedded device running Linux, but the difficulty I'm running into is being able to force the sequence to pause/wait for a response before sending the next command in the sequence value. Right now, they're sending too fast and it's causing some issues getting the remote device to process the commands correctly.
Could I get some direction on the best way of doing this? The idea I'm researching right now is using a single sequence script that automatically throws a sleep/wait between each newline in the sequence value, but my JS/ES programming background is not my strong suite.
Hi,
I would do this with a worker script (you have to add this in the Script Window). You can find an example script in the attachment that:
- sends a command
- waits for the answer (ACK string)
- sends a command
...
After the ACK for the third command is received the script stops itself.
Last edit: Stefan Zieker 2020-06-06
Thanks. This didn't work exactly the way I hoped, but it was close enough that I was able to tweak to fit this scenario. Much appreciated!