Hallo an alle,
ich probiere mich gerade in C#.Ich bin also komplett am Anfang!
Ich nutze Visual Studio und habe mit NuGet und Verweise auf die System.IO.Ports beschäftigt.
Lauf MS ist die eine Bibliothek für Serial Kommunikation.
Der Zeichensatz „sw i03 \r\n“ veranlasst das mein HDMI Switch mit Com-Port auf Port 3 zu schalten. Also zumindestens macht es das unter Python.
Mein Skript siehe nun wie folgt aus. Leider zuckt mein Switch überhaupt nicht.
Hier liegt sicher ein Skriptfehler vor, könnt ihr mir helfen?
using System;
using System.IO.Ports;
namespace SerialPortExample
{
classSerialPortProgram
{
// Create the serial port with basic settings
private SerialPort port = new SerialPort("COM9",
9600, Parity.None, 8, StopBits.One);
staticvoid Main(string[] args)
{
// Instatiate this class
new SerialPortProgram();
}
privateSerialPortProgram()
{
// Begin communications
port.Open();
string data = "sw i03 \r\n";
port.Write(data);
}
}
}
Schon mal vorab vielen Dank!
ich probiere mich gerade in C#.Ich bin also komplett am Anfang!
Ich nutze Visual Studio und habe mit NuGet und Verweise auf die System.IO.Ports beschäftigt.
Lauf MS ist die eine Bibliothek für Serial Kommunikation.
Der Zeichensatz „sw i03 \r\n“ veranlasst das mein HDMI Switch mit Com-Port auf Port 3 zu schalten. Also zumindestens macht es das unter Python.
Mein Skript siehe nun wie folgt aus. Leider zuckt mein Switch überhaupt nicht.
Hier liegt sicher ein Skriptfehler vor, könnt ihr mir helfen?
using System;
using System.IO.Ports;
namespace SerialPortExample
{
classSerialPortProgram
{
// Create the serial port with basic settings
private SerialPort port = new SerialPort("COM9",
9600, Parity.None, 8, StopBits.One);
staticvoid Main(string[] args)
{
// Instatiate this class
new SerialPortProgram();
}
privateSerialPortProgram()
{
// Begin communications
port.Open();
string data = "sw i03 \r\n";
port.Write(data);
}
}
}
Schon mal vorab vielen Dank!
Comment