0

Ok, I am really really new to this stuff and basically dont know what to do. I got a task. Basically, I have more sensors (like 10) on one port (COM4). I know adress of each sensor and I know what type of comunication it's using.

Let me show you example:

I know these settings of port:

enter image description here

I also know that on this port I have more then one device, for example 2 sensors. I know these sensors adresses and protocols.

In our example let's say I have sensors with adresses: '1', 'J'. And both use protocol: 'spinel97'. Now, I know that command: 0x11 is used to report slave ID.

How do I make program in C# that connects to second/first device and reports device ID?

I am so sorry for asking without code (I know it's annoying) but I am actually so clueless and dont know where to find anymore.

Thanks for any aswears

Andrew Black
  • 129
  • 1
  • 11
  • And here is the Microsoft documentation on the `SerialPort` object. https://learn.microsoft.com/en-us/dotnet/api/system.io.ports.serialport?view=dotnet-plat-ext-3.1 – Richard Chambers Nov 09 '20 at 20:28
  • Sorry for my bad explanation, I know a little about how to use SerialPort, my problem is that I dont know how to constact those sensers. I dont know how to send commands. I dont know how to contacet each device independitly nad basically how it works in general – Andrew Black Nov 09 '20 at 20:30
  • Lab exercise on an Arduino using a Serial Port Expander. https://www.instructables.com/HOW-TO-EXPAND-ONE-SERIAL-PORT-INTO-EIGHT/ and see as well as using a PIC with a serial port on a PC https://www.maximintegrated.com/en/design/technical-documents/app-notes/2/206.html and see this article compare/contrast UART with I2C and SPI https://www.seeedstudio.com/blog/2019/09/25/uart-vs-i2c-vs-spi-communication-protocols-and-uses/ and https://www.element14.com/community/message/242468/l/re-can-i-talk-to-multiple-arduinos-at-the-same-time-with-another-arduino-in-a-serial-format – Richard Chambers Nov 09 '20 at 20:45
  • Ok, thanks for all responces. I will check it out all fully but by the first glance it looks like exactlly what I need! Thanks you all once again – Andrew Black Nov 09 '20 at 20:52

0 Answers0