i want make communication in between Arduino as Slave and PLC(omron CPE-1) As Master ,
i want senfd 16 keys push to on data to PLC or Simply Modbus master software
and also receive data from PLC or Simply Modbus Master Software like LED on off command 1 or 0 digital data and error message from PLC which i want to show on 20x4 LCD display
can you please suggest Arduino (as a slave )2 way communication code ( want send 16 keys push to on data ( 1,2,4,8,6,32,.....512,1024 format register add. 40001, and want receive error message or LED / relay on/off command 1/ 0 ) in resister 40011,40012.
right now i tested below code , both are working ok , bust have different library and hardware settings ,
please find link below. i am not getting print cammant to print data
I noticed you mention the PLC other then in passing. I would read those manuals as well, most if not all of what you need to know is contained therein. I simply googled for omron CPE-1 manual and found these as the first three:
http://www.omron.com.au/data_pdf/mnu/w479-e1-10_cp1e.pdf?id=2064
I realize those three manuals are over 1,000 pages but after reading them you will understand what you are asking and most likely have the solution. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil
Thanks For Valuable reply, now basic problem is solved now I can send 16 keys data to Simply Modbus Software . and also can receive 6 led on-off command too,
but unexpected error is coming, as per Modbusrtu.h file I can send and receive data but I want to show that data on LCD Display Too(20x4), problem is if I add #include <LiquidCrystal.h> file and LCD code, Microcontroller goes in continues restart mode if I send request data from Modbus software (Modbus software is MAster and Arduino mega is Slave)
I tried the serial print command, it's working but LCD code not, even I tried i2c communication For LCD that file also not working,
please check below code, what is the reason for auto-restart mode problem?