José Silva

ModBus RTU communication between Omron CP1E (CP1W-CIF11) and an Arduino using MAX485 RS485 transceiver

2 posts in this topic

Hello everyone!

Briefly introduction, I would like to communicate and test the following hardwares:

1- Omron CP1E (using an Option Port CP1W-CIF11) ; and

2- Arduino Nano using MAX485 RS485 transceiver.

The CP1E will operate in "Modbus-RTU simple master" as illustrated in image 01. The arduino will be in slave mode address 1 and the library used is "SimpleModbus NG" ( https://github.com/angeloc/simplemodbusng/tree/master/SimpleModbusSlave ).

Taking the sample in official manual ( https://industrial.omron.eu/en/services-support/technical-tools/downloads#cp1e ) , pages 248-253 in the "CP1E CPU Unit Software User's Manual" (Image 04) describes a sample communication to an "Inverter Slave".

I want to use the Arduino Slave as the Inverter Slave just to be sure that all previous steps are correct.

Therefore, I would like to know:

1- As illustrated in Image 02, Am I missing any resistors?

2- Should I connect the GND to the FG?

3- In this scenario, the DIP switch setup should be as illustrated in image 03? Only DIP4 is OFF.

4- Can I test it just forcing A641.00 and checking the DM Area Data, as shown in Image 05?

The code used in it is the following:

// Wiring: Arduino and MAX485
// RX0 - RO
// TX1 - DI
// D2  - DE/RE

#include "SimpleModbusSlave.h"

enum {
	REGISTER_0,
	REGISTER_1,
	REGISTER_2,
	REGISTER_3,
	REGISTER_4,
	REGISTER_5,
	REGISTER_6,
	REGISTER_7,
	REGISTER_8,
	TOTAL_REGS_SIZE
};

unsigned int holdingRegs[TOTAL_REGS_SIZE] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };

void setup() {
	modbus_configure(&Serial, 9600, SERIAL_8N1, 1, 2, TOTAL_REGS_SIZE, holdingRegs);
}

void loop() {
	modbus_update();
}

 

Any answer can be helpful. Thank you for your time!

 

Regards,

Jose.

 

01-CP1E_Modbus-RTU_Simple_Master.png

02-Wiring_Diagram.png

03-CP1W-CIF11_Setup.png

04-ModBusRTU_Omron_Sample.png

05-CxProgrammer_Test.png

Edited by José Silva

Share this post


Link to post
Share on other sites

@José Silva you should use Modbus Scanner software to check that you can read registers on Arduino or not.

There are some free software (ComTest Pro) as link below. You should have USB to RS-485 converter to commnuicate with Arduino.

http://www.baseblock.com/PRODUCTS/demosoftware.htm

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now