COM口终端程序

发布于 2024-08-19 13:36:05 字数 196 浏览 3 评论 0原文

我开发了一个嵌入式应用程序,它通过通信通道请求设备的状态信息。我的客户要求这些将在特定的时间段内发送,所以我正在寻找一个 PC 终端应用程序,它可以在一段时间内以设定的间隔重复发送文本字符串命令。我目前使用串行设备测试仪,当有东西发送到它时,它可以立即发回设定的字符串,但我需要控制时间段和重复次数。

是否有任何应用程序(适用于 Windows)可以实现此目的?

I have developed an embedded application which requests status information from a device down a communications channel. My customer requires that these will be sent with a specific time period, so what I am looking for is a PC terminal application which can send a text string command repeatedly at a set interval over a period of time. I currently use a serial device tester which can immediately send back a set string when something is sent to it, but I need to control the time period and number of repititions.

Are there any applications (for Windows) out there which can acheive this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

无声情话 2024-08-26 13:36:05

Docklight / Docklight 脚本
对于测试通过串行端口的应用程序通信,它是完成这项工作的最佳工具。
它在串行端口上侦听用户定义的序列,然后可以使用从输入消息或脚本中的函数派生的参数触发传输。

我编写了一个 C++ 程序来测试嵌入式串行应用程序,它有 +/- 1000 行代码。我可以用 Docklight Scripting 中的大约 20 行 vb 脚本来替换它。

Docklight 绝对物有所值。

Docklight / Docklight Scripting
For testing applications communication over the serial port it is the best tool for the job.
It listens for user defined sequences on serial port and can then trigger a transmission with parameters derived from the input message or function in a script.

I wrote a C++ program to test a embedded serial application and it 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.

鸠书 2024-08-26 13:36:05

我倾向于实现一个简短的 python 脚本来执行此操作(它可以使用 python 编译为独立的可执行文件="http://www.py2exe.org/" rel="noreferrer">py2exe 如果这是您需要的)。安装 pythonpyserial。然后使用如下脚本:

#!/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's 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 结合(可从同一站点获取)。

I would tend to implement a short python script to do this (it can be compiled to a standalone executable with py2exe if that's what you need). Install python and pyserial. Then use a script like this:

#!/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's 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)

However, if you want a more conventional Windows application, then you can probably do it with Docklight, possibly combined with Docklight Scripting (available from the same site).

记忆之渊 2024-08-26 13:36:05

串行终端仿真应用程序 Tera Term 具有能够设置定时循环的脚本语言。

http://ttssh2.sourceforge.jp/

http://en.wikipedia.org/wiki/Tera_Term

The serial terminal emulation application Tera Term, has a scripting language which will be capable of setting up timed loops.

http://ttssh2.sourceforge.jp/

http://en.wikipedia.org/wiki/Tera_Term

霊感 2024-08-26 13:36:05

我使用 RealTerm。您可以为其编写脚本并让它重复发送该文件。您可以在字符之间或行之间添加延迟。有时会有点问题,但价格实惠(免费)。

http://realterm.sourceforge.net/

I use RealTerm. You can write scripts for it and have it send that file repeatedly. You can add delays between characters or delays between lines. It's a little buggy sometimes, but it's great for the price (free).

http://realterm.sourceforge.net/

下壹個目標 2024-08-26 13:36:05

ScriptCommunicator(开源、跨平台)是适合您的工具。它具有许多功能和非常有用的脚本界面。

ScriptCommunicator (open-source, cross-platform) is the right tool for you. It has many features and a very useful script interface.

月光色 2024-08-26 13:36:05

虽然已经回答,但我使用 http://www.hw-group.com/products /hercules/index_de.html 。他们的应用程序是免费的,在串行选项卡中,我可以从 rs232 发送和接收数据。就像魅力一样。

Although answered already, i use http://www.hw-group.com/products/hercules/index_de.html . Their app is free and in the serial tab, i can send and receive data from rs232. works like a charm.

爱你是孤单的心事 2024-08-26 13:36:05

GLTerminal是在线终端,可用于许多不同的wasy。无需安装,其在线且开源。发布部分还有独立的应用程序。

https://github.com/grzesl/glterminal
输入图片此处描述

GLTerminal is online terminal witch can be used in many different wasy. No installation needed its online and opensource. There is also standalone applications in release section.

https://github.com/grzesl/glterminal
enter image description here

挽心 2024-08-26 13:36:05

您可以使用内置的 Windows 任务计划程序来运行一个简单的批处理脚本,该脚本将文本写入 com 端口,有些人会这样想,

echo "Hell there" > COM1:  

但我已经很久没有这样做了,所以我的语法很生疏。否则,您可以使用一个支持脚本的简单“termulator”程序 - 我想我已经有十年没有这样做了。

You can use the built in windows task scheduler to run a simple batch script that writes texts to a the com port some think like

echo "Hell there" > COM1:  

But I've not done this is in yers so my syntax is rusty. Otherwise you could use a simple 'termulator' program that supports scripting - again I've not done this in a decade I think.

暖伴 2024-08-26 13:36:05

GModLab - 跨平台、可编写脚本(JS)终端:https://github.com/tardigrade888/gmodlab
您可以编写执行任何操作的脚本。

GModLab - cross-platform, scriptable (JS) terminal: https://github.com/tardigrade888/gmodlab
You can write scripts that do anything.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文