riandanualdy

modbusrtu How to connect omron CP1E with modbus RTU

25 posts in this topic

Hallo, i want to connect PLC Omron CP1E to indicator weighing scale with modbusRTU connection and i have a CP1W-CIF11 module to connect indicator with CP1E. ,but I have no experience in RTU modbus communication in the PLC.

How do i start?

 

*i just need output:

1. Coil (Reference No = 0. Output bits) for input switch with address 3 (Tare).

2.Input Status (Reference No = 1) for output lamp with address 17 (stable)

3.Input register (Reference No = 3) to read data with address 5 (gross weight)

4. holding register (Reference No = 4) to write comparison data with address 17(over)

page 85 - 94 in attachment

 

 

ad4402_manual.pdf

1 person likes this

Share this post


Link to post
Share on other sites
10 minutes ago, riandanualdy said:

Hallo, i want to connect PLC Omron CP1E to indicator weighing scale with modbusRTU connection and i have a CP1W-CIF11 module to connect indicator with CP1E. ,but I have no experience in RTU modbus communication in the PLC.

How do i start?

 

*i just need output:

1. Coil (Reference No = 0. Output bits) for input switch with address 3 (Tare).

2.Input Status (Reference No = 1) for output lamp with address 17 (stable)

3.Input register (Reference No = 3) to read data with address 5 (gross weight)

4. holding register (Reference No = 4) to write comparison data with address 17(over)

page 85 - 94 in attachment

 

 

ad4402_manual.pdf

Please check this manual below about Modbus RTU Easy Master at section 14-4 page 245 - 253

https://assets.omron.eu/downloads/manual/en/e480_cp1e_users_manual_en.pdf

1 person likes this

Share this post


Link to post
Share on other sites
1 hour ago, riandanualdy said:

how about wiring CP1W-CIF11 if my indicator is use 3 wire (A,B,ground)?

You don't need to connect SG please follow this connection below

CP1W-CIF11     <------------>       AD-4402

RDA-  <------------>   SDA

RDB+  <------------>  SDB

If it cannot connect swap cable

CP1W-CIF11     <------------>       AD-4402

RDA-  <------------>   SDB

RDB+  <------------>  SDA

1 person likes this

Share this post


Link to post
Share on other sites
3 hours ago, Wasan said:

You don't need to connect SG please follow this connection below

CP1W-CIF11     <------------>       AD-4402

RDA-  <------------>   SDA

RDB+  <------------>  SDB

If it cannot connect swap cable

CP1W-CIF11     <------------>       AD-4402

RDA-  <------------>   SDB

RDB+  <------------>  SDA

i done use

RDA- <--> SDA & RDB+ <--> SDB

or

RDA- <--> SDB & RDB+ <--> SDA

and i use this cx programmer, but the a641.00 value is not 1 but the a641.02 value is 1 and if i check memory a641.02 is 90.

what should i do now?
 

modbus coba coba euy (2).cxp

a641.png

d1300-d1305.png

Share this post


Link to post
Share on other sites
59 minutes ago, riandanualdy said:

i done use

RDA- <--> SDA & RDB+ <--> SDB

or

RDA- <--> SDB & RDB+ <--> SDA

and i use this cx programmer, but the a641.00 value is not 1 but the a641.02 value is 1 and if i check memory a641.02 is 90.

what should i do now?
 

modbus coba coba euy (2).cxp

a641.png

d1300-d1305.png

There are Error Code Response Timeout please check communication parameter (Baud Rate, Data Bit, Stop Bit, Parity Bit) that match setting with CP1E and AD-4402

CP1E_Modbus_01.jpg

CP1E_Modbus_02.jpg

CP1E_Modbus_03.jpg

1 person likes this

Share this post


Link to post
Share on other sites

You should use A641.00 to A641.02 that belong to Optional Serial Port If you use A640.00 to A640.02 It is belong to Built-in RS-232 Port.

Maybe you should check program as below and clear PLC Memory (There are some random data on D1300 - D1400) and download project again.

CP1E_Modbus_05.jpg

CP1E_Modbus_06.jpg

modbus coba coba euy V 3.cxp

1 person likes this

Share this post


Link to post
Share on other sites
17 hours ago, Wasan said:

You should use A641.00 to A641.02 that belong to Optional Serial Port If you use A640.00 to A640.02 It is belong to Built-in RS-232 Port.

Maybe you should check program as below and clear PLC Memory (There are some random data on D1300 - D1400) and download project again.

CP1E_Modbus_05.jpg

CP1E_Modbus_06.jpg

modbus coba coba euy V 3.cxp

i try your ladder diagram and i change wiring SDA- to A and SDB+ to B or SDA- to B and SDB+ to A is connected and indicator of com in CP1w-cif11 is on. yesterday i think the wiring is wrong and now is correct. but now if i check in memory d1305-d1349 it's cannot change (Screenshot_27.png), what should i do?

if i want to display data address 3,5,7, is it already correct my cx programmer?

Thank you

 

 

Screenshot_28.png

Screenshot_27.png

modbus coba coba euy V 3.cxp

Share this post


Link to post
Share on other sites

Please check that you config Modbus parameter on AD-4402 match with CIF11 parameters and set D1300 to #0001 that means Modbus slave address 1.

modbus coba coba euy V 4.cxp

Share this post


Link to post
Share on other sites
20 hours ago, Wasan said:

Please check that you config Modbus parameter on AD-4402 match with CIF11 parameters and set D1300 to #0001 that means Modbus slave address 1.

modbus coba coba euy V 4.cxp

i think cx programmer is work, and the output is in memory d1355 or more. but i have a question, why the output is just <1 second and after that back to "0", how to repair that?

thank you

Share this post


Link to post
Share on other sites

example: 5 second still "0" after that output is "1234" after < 1 second back to "0".

i just want the output "1234" stay >1 second

Edited by riandanualdy

Share this post


Link to post
Share on other sites
1 hour ago, riandanualdy said:

example: 5 second still "0" after that output is "1234" after < 1 second back to "0".

i just want the output "1234" stay >1 second

Please change D1303 to #0005 and D1304 to #0006 then check D1350 should be 1 and D1352 should be 0 and D1354 to D1359 should be data that read from AD-4402.

Please capture data monitor screen to check result.

Share this post


Link to post
Share on other sites
4 hours ago, Wasan said:

Please change D1303 to #0005 and D1304 to #0006 then check D1350 should be 1 and D1352 should be 0 and D1354 to D1359 should be data that read from AD-4402.

Please capture data monitor screen to check result.

sir, the problem is change value the memory just <1 second so i can't print screen the memory, how to show the value for >1 second ?

1 person likes this

Share this post


Link to post
Share on other sites
15 minutes ago, riandanualdy said:

this is the result of your cx programmer and i change D1303 to #0005 and D1304 to #0006  . the 4402 show the value of scale is 20,68kg

Untitled.jpg

modbus coba coba euy V 4.cxp

D1355 is #0008 D1356 is #1400 When you combine it will be #0814 that equal 2068 at decimal (use calculator in program mode).

For decimal point number read address #0001.

1 person likes this

Share this post


Link to post
Share on other sites
15 hours ago, Wasan said:

D1355 is #0008 D1356 is #1400 When you combine it will be #0814 that equal 2068 at decimal (use calculator in program mode).

For decimal point number read address #0001.

can you explain me about function of memory d1302,d1303,d1304,d1305 ?

i know this cx programmer for input register, because i still confused for coil, input status, and holding register how to use it in cx programmer?

coil work like switch, holding register is to write and read data, input status is like output lamp (indicator lamp)

Thankyou

coil status.png

holding register.png

input register.png

input status.png

Share this post


Link to post
Share on other sites
7 hours ago, riandanualdy said:

can you explain me about function of memory d1302,d1303,d1304,d1305 ?

i know this cx programmer for input register, because i still confused for coil, input status, and holding register how to use it in cx programmer?

coil work like switch, holding register is to write and read data, input status is like output lamp (indicator lamp)

Thankyou

For Function of D1300 to D1304 describe as follow

D1300 --> Slave Address

D1301 --> Function Codes (01, 02, 03, 04, 05, 06, 16)

D1302 --> Number of Communication bytes (count byte data from D1303 to Finish byte for example use D1303 and D1304 are 4 bytes [1 word = 2 bytes])

D1303 --> For Function Code 04 (Read Input Registers) are Start Address that you need to read

D1304 --> For Function Code 04 (Read Input Registers) are number of address that you need to read

For other modbus functions please check this manual first to understand about modbus data frame for each function

http://modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf

Share this post


Link to post
Share on other sites
On 9/28/2018 at 5:10 PM, Wasan said:

For Function of D1300 to D1304 describe as follow

D1300 --> Slave Address

D1301 --> Function Codes (01, 02, 03, 04, 05, 06, 16)

D1302 --> Number of Communication bytes (count byte data from D1303 to Finish byte for example use D1303 and D1304 are 4 bytes [1 word = 2 bytes])

D1303 --> For Function Code 04 (Read Input Registers) are Start Address that you need to read

D1304 --> For Function Code 04 (Read Input Registers) are number of address that you need to read

For other modbus functions please check this manual first to understand about modbus data frame for each function

http://modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf

Finally i can use the modbus all of them, Thank you and have a nice day

Share this post


Link to post
Share on other sites

Hi Wasan & Riandanualdy,

I have been reading your topic and it helps me a lot to establish my connection, I have "CP1E-N60DT-D" and a modbus RTU RFID device.

I followed your " modbus coba coba euy V 4.cxp", I have a comm and see it flickering. The only problem is A641.00 gets stuck on ON status, and just flickers. I'm not getting any response at all from DM location D1350 onwards, I got zero values. Unfortunately, I cant attached the forum isnt allowing me.

I only got the response when I stop the CPU, and A641.01 turns ON. I got 2 questions;

1. From your program the bit "W0.01" on when A641.00 turns ON. Shouldn't this bit place on the "W0.15"  as the manual said so?

"Turn ON A641.00 (Execution Bit) to send command data stored starting at D1300." I am confused.

2. How will I fix the issue whereby I only got response when I stop the CPU? 

Thank you very much, still learning here.

 

Cheers :)

 

 

Share this post


Link to post
Share on other sites
On 28/9/2561 at 5:10 PM, Wasan said:

For Function of D1300 to D1304 describe as follow

D1300 --> Slave Address

D1301 --> Function Codes (01, 02, 03, 04, 05, 06, 16)

D1302 --> Number of Communication bytes (count byte data from D1303 to Finish byte for example use D1303 and D1304 are 4 bytes [1 word = 2 bytes])

D1303 --> For Function Code 04 (Read Input Registers) are Start Address that you need to read

D1304 --> For Function Code 04 (Read Input Registers) are number of address that you need to read

For other modbus functions please check this manual first to understand about modbus data frame for each function

http://modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf

Hi @M302015 You need to understand data on OMRON Modbus first. Start by config communication data on D1300 - D1304

D1300 --> Slave Address of your RFID Device

D1301 --> Assign Function code that you need (I guess maybe 03 or 04 please check RFID manual)

D1302 --> Number of communication bytes assign 4 byte from D1303 - D1304

D1303 --> Start Register : Assign first RFID register to read

D1304 --> Number of address : assign how many data to read

Share this post


Link to post
Share on other sites
On 9/26/2018 at 1:10 PM, Wasan said:

Please check that you config Modbus parameter on AD-4402 match with CIF11 parameters and set D1300 to #0001 that means Modbus slave address 1.

modbus coba coba euy V 4.cxp

Hi Wasan/Fellows,

My communication is doing good now using CP1L-EM to an RFID via Modbus RTU.

I am using the second serial port with 19200, 81E, Serial Gateway. Sometimes it works for an hour, and suddenly just stops as I can see A640.02 turns ON, and the COMM indicator no longer flickers.  I got an error code of "0x80 - Response timeout". I am thinking about lowering the baud rate. Do I need a terminating resistor? Please advice.

Thank you very much.

Cheers :)

 

RFID CP1L-EM_Mod4_2.cxp

Share this post


Link to post
Share on other sites

@M302015 It is up to how cable quality or cable length or are there noise in system. First you may try to increase timeout for wait longer response. If not may be you can reduce baudrate. You will need terminate resistor when your cable have very long length or to balance impedance on your cable.

Share this post


Link to post
Share on other sites

Hi Wasan,

You're so helpful, I need to check on that. 

I may need your help. I need to manually clear the RFID tag, to an 8 register. Can you please share the exact code for it?

I'm using the serial port 2 for CP1L-EM, I would be glad for your help.

Thank you so much.

Regards :)

Share this post


Link to post
Share on other sites

Hi, 

I would appreciate for your suggestion. The main issue is, I need to clear the RFID UID after I read it.

Im trying to read an RFID, and the read section works fine.

But the clear or write function turns on A640.02 when W0.05 manually set ON.

Kindly advice.

RFID CP1L-EM_ReadW.cxp

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