Send data from Arduino to S7-200 using RS485 without Modbus

posted in: Microcontroller, PLC | 0
  1. Prepare
  • UART TTL to RS485 . communication circuit
  • DB9 port

You wire as shown. Here I use S7-200 CPU226 with 2 communication ports. ربح المال من الانترنت مجانا

Here you do not need to attach the resistor. Then attach DB9 port to Port 0 of S7-200

2. Programming

Download program for arduino

Download program for S7-200

You can change the value you want to send to the PLC, here I want to send the value of analog pins, pin 11 and constant values.

  int VW0 = analogRead(A0);
  int VW2 = analogRead(A1);
  int VW4 = analogRead(A2);
  int VW6 = analogRead(A3);
  int VW8 = analogRead(A4);
  int VW10 = digitalRead(11);
  int VW12 = 512;
  int VW14 = 1023;

Upload the code for Arduino and PLC and test

So I have written values ​​from arduino into registers VW0 – VW14 of S7-200 without modbus for communication.

Leave a Reply

Your email address will not be published.