COM port terminal program

I developed a built-in application that requests status information from the device via a communication channel. My client requires that they be sent with a specific time period, so I'm looking for a PC application that can send a text string several times at a given interval for a certain period of time. I am currently using a serial device tester, which can immediately send a given string when something is sent to it, but I need to control the time period and the number of repetitions.

Are there any applications (for Windows) that can do this?

+5
source share
9 answers

Docklight / Docklight Screenshot To test serial communications applications, this is the best tool to work with. It listens for user-defined sequences on the serial port and then can start the transfer with the parameters obtained from the input message or function into the script.

I wrote a C ++ program to test the embedded serial application, and that was +/- 1000 lines of code. I was able to replace this with about 20 lines of vb script in Docklight Scripting.

Docklight is definitely worth the money.

+8
source

python script, ( py2exe, ). python pyserial. script :

#!/usr/bin/python
import time
import serial

# Interval in seconds
interval = 2.5

# Number of times to send
repetitions = 10

# Simple Command string
command_string = "Hello World"

# Or if it a binary-type command:
command_bytes = [0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64]
command_string = "".join([chr(c) for c in command_bytes])

# Open the serial port - most of these settings have
# defaults in case you want to be lazy
ser = serial.Serial(
        port=0, # This is COM1, use 1 for COM2 etc
        baudrate=115200,
        parity=serial.PARITY_NONE,
        stopbits=serial.STOPBITS_ONE,
        xonxoff=0,
        rtscts=0,
        timeout=0)

# Loop 'repetitions' times
for i in range(repetitions):
    # Send the string
    ser.write(command_string)
    # Go to sleep for "interval" seconds
    time.sleep(interval)

, Windows, , , Docklight, , Docklight Scripting ( ).

+6
+4

ScriptCommunicator ( , -) - . script.

+1

Windows script, com-, , ,

echo "Hell there" > COM1:  

, . "termulator", - , .

0

# . COM- .

0
0

All Articles