Browsed by
Tag: communication

How to test / read data from console / RS232

How to test / read data from console / RS232

RS232 commnication is not necessary, but is very useful. You can write some code and you want to switch on a led. The easier way to know what is happening if the led isn’t turning on, is through RS232, and watching what are the values of the vars,…   So, if you have purchased an Ardbox, you’ll need to initialize communications through: Serial.begin(9600); while (!Serial) {} and after that, you’ll be able to send any value to the RS232 port,…

Read More Read More

RS485 Communication

RS485 Communication

Arduino based PLC through RS485 port can connect with other devices which also use RS485 communication port PLC available to use RS485: 20 I/Os PLC: Ardbox Analog Ardbox Relay Ethernet PLC: M-duino 21 M-duino 42 M-duino 58 M-duino 19R M-duino 38R M-duino 57R

I2C Communication

I2C Communication

In order to communicate through I2C, we have to do two type of programs. We have to create some code for the Master device (PLC in our case), and another piece of code for the Slave devices, such as PLC, or any other device (RTC clock, ADC,…, that has an I2C available port). Master Code: #include <Wire.h> void setup() { Wire.begin(); Serial.begin(9600); delay(500); } void loop() { Serial.println(“Initial”); Wire.requestFrom(2, 1); // request 1 byte from device #2 while(Wire.available()) { char c…

Read More Read More

How to Modbus-Ethernet

How to Modbus-Ethernet

Modbus is a Serial communications protocol and it is used for communicating with several industrial devices. It may run over RS485, Ethernet, or whatever hardware interface. If we have an ethernet connection between a lot of devices, we can use this hardware connection (eth), and over it, we can use our own protocol (custom protocol,…), or for instance, Modbus protocol. The way is the same as using RS485, but hardware connections will become much easier, the speed will be higher, and…

Read More Read More