V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Lynntox
V2EX  ›  C#

C#串口通信问题 求教

  •  
  •   Lynntox · 9 天前 · 526 次点击

    我使用 labview 写的是没有问题的,通过串口助手发送产品也有反应

    但是在使用 C#就没办法正常通讯

    首先 我确认了线是没问题的,串口属性是没问题的 9600-8-n-1

    byte[] command = new byte[] { 0xAA, 0x55, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEE };

    // 发送数据 serialPort.Write(command, 0, command.Length);

    就很奇怪

    1 条回复    2024-09-11 16:55:37 +08:00
    sunmker
        1
    sunmker  
       5 天前
    先打开串口,.open
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   944 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 19:37 · PVG 03:37 · LAX 12:37 · JFK 15:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.