首页 > 解决方案 > RS232 via USB with UnoPlatform and C#

问题描述

i want to control my power amplifier for my music box with my Raspberry pi 4 and a Uno GUI. this device has a subd9 socket using rs232 serial communication protocol. i use a usb to serial converter cable and want to use the raspberrys USB port for this.

the command i need to send is hex and looks like ´ 02 00 00 00 01 03

i searched for solutions but i wasn't able to find something suitable. Does anyone have an idea how i can achieve that?

Thank you for any help

标签: c#serial-portusbuno-platform

解决方案


我已经安装了 system.io.ports V5.0.1,没有任何错误。我将 Using System.IO.ports 添加到我的 Mainpage.cs。并在智能中出现警告(图片)

在此处输入图像描述

对不起,它是德国人,

Nicht verfügbar = 不可用 verfügbar = 可用

当我添加来自 jdweng 的代码示例时,就会出现(图 2) 在此处输入图像描述

它说:错误 CS1069 在命名空间 System.IO.Ports 中找不到类型名称“SerialPort”。此类型已转发到 Assembly System.IO.Ports,Version=0.0.0.0,Culture=neutral,PublicKeyToken=cc7b13ffcd2ddd51。您应该添加对程序集的引用。Test.Skia.Gtk C:"Users"User-source-repos-Test-Test-Test.Shared-MainPage.xaml.cs 54 活动

编辑 26.05.2021 15:20 我在 Projekt 的每个 Header 上安装了 Nuget 包,现在所有错误都消失了。但是现在当我尝试发送 jdweng 时,我遇到了一个异常:

在此处输入图像描述


推荐阅读