Menu

Bulk send commands via sequence with delay

Anonymous
2020-06-05
2020-06-10
  • Anonymous

    Anonymous - 2020-06-05

    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.

     
  • Stefan Zieker

    Stefan Zieker - 2020-06-06

    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
  • Anonymous

    Anonymous - 2020-06-10

    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!

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.