C # Serial communication with multiple devices on one port

I just started working briefly in C #, and I'm currently using RS-485 to communicate with some other devices, but I can't seem to get other devices to respond. I was wondering if there is a way to write to a specific device using serial communication, since all this is connected via COM port 4. I already know serial.Write (); but, as far as I know, this does not give you the opportunity to choose the address you want to send. Is there anyone who could know the answer to this question?

Best regards Cvr

Thanks for answers. They helped a lot :)

+5
source share
2 answers

Christoph is right, but to clarify a little:

RS232 , . , . ASCII / . , , - , "" .

RS485 RS232 , , . , , . , .

, ( ) :

  • - , , , ..
  • - ,
  • - , .

, , , ( , ):

$01FF9A

:

01 FF - 9A -

, 01 ", ", . , , .

RS485 Hex, .. , Serial.Write(byte[], int,int), .

.NET http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx

+8

SerialPort.
, ..
Open() .

var port = new SerialPort();
port.PortName = "COM4";
port.Open();
+1

All Articles