【问题标题】:Serial Port Emulator for Mac OSX [closed]Mac OSX 的串行端口仿真器 [关闭]
【发布时间】:2014-11-12 17:59:07
【问题描述】:

Mac OSX 上有没有串口模拟器? 我正在开发一个在 Mac 上控制串行设备 (RS232) 的程序。我曾经使用com0com 为串行设备验证我的程序,但它仅适用于 Windows。

我已经阅读了this thread,但仍然是徒劳的。 MultiCom 不是我想要的。我需要一个创建/模拟虚拟串行设备的软件。

提前感谢您的帮助。

【问题讨论】:

  • 这可能对您有帮助,也可能无济于事,但您可以在亚马逊上以相当便宜的价格购买基于 PL2303 的 USB-to-DB9 转换器,例如this one。它可以在没有驱动程序的情况下开箱即用,然后您将拥有一个实际的串行端口,这可能比寻找软件来模拟一个更容易。
  • 谢谢。我已经考虑过了。拥有 2 个外部物理设备有时会困扰我。但是,这将是最少的选择。

标签: macos serial-port emulation device-emulation


【解决方案1】:

在适用于我的 Mac 上模拟串行设备 (RS232) 的一种方法是插入 Arduino(它需要硬件,是的,但可以模拟许多其他设备)。我用它来模拟更昂贵的传感器。这是来自Arduino website 的代码的简单示例,稍作修改以连续打印语句。

// the setup routine runs once
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // Wait for serial port to connect (Needed for native USB port only)
  while (!Serial) {
    ;
  }
}

// the loop routine runs over and over again forever:
void loop() {
  // Print a statement through Serial
  Serial.println("Hello world !");
  // Some delay
  delay(10);
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-20
    • 1970-01-01
    • 2014-03-01
    相关资源
    最近更新 更多