You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old April 12th, 2012, 02:51 AM   #1
Andreik
Member
Philippines

Andreik is offline
 
Join Date: Mar 2009
Location: Makati City
Posts: 74
Simultaneous Read/Write (CP1E ModbusRTU)

Good day,

I have a problem with Modbus-RTU. In fact I'm new in this one and having slow progress grasping it. I'm using Omron "CP1E-N60DT-D" connecting to Oriental Motor "ARD-KD".

I've understood how to Read/Write data one at a time during my tests. However, in application, I need to Read(03h) and Write(06h) at the same time (like our usual PLC I/O's) but I can't imagine how to do it.

By the way I'm using "CP1W-CIF11". I've read something about the built-in RS232C port capable for Modbus-RTU but I'd never found any technical data regarding this or is it possible to use 2 ports at the same time.

I'd appreciate any help I can get. Thank you very much.

Sincerely,
Andrei K.
  Reply With Quote
Old April 12th, 2012, 07:25 PM   #2
Andreik
Member
Philippines

Andreik is offline
 
Join Date: Mar 2009
Location: Makati City
Posts: 74
up
  Reply With Quote
Old April 12th, 2012, 09:23 PM   #3
Andreik
Member
Philippines

Andreik is offline
 
Join Date: Mar 2009
Location: Makati City
Posts: 74
Please see attached
Attached Files
File Type: pdf CP1E_taModbus [Compatibility Mode].pdf (37.9 KB, 50 views)
  Reply With Quote
Old April 12th, 2012, 11:33 PM   #4
danw
Member
United States

danw is offline
 
danw's Avatar
 
Join Date: Oct 2004
Location: midwest, USA
Posts: 1,975
It can not be done, unless both devices have the capability of running two Modbus separate Modbus routines simultaneously, each routine having with their own comm ports.

It seems like you've already discovered that Modbus is a Master-Slave protocolm where a message from the master to the slave can have only one function/command code. Since any given function/command code is either a read or a write instruction, and there is no function code that combines the two, a Modbus operation is either read or write.

Your idea of paralleling ports will not work because the slave drive has only the one port. Even if you could somehow configure the master to read on its one port and write on its other port at the same time, that would create a bus conflict, with two masters fighting each other on a single bus line (which is why one of the Modbus RTU RULES is that only one master is allowed).
  Reply With Quote
Old April 13th, 2012, 12:03 AM   #5
Andreik
Member
Philippines

Andreik is offline
 
Join Date: Mar 2009
Location: Makati City
Posts: 74
I see, guess I have to choose either to command or monitor the Slave. Thank you very much for the input, now I should be able to move on.

Quote:
Originally Posted by danw View Post
It can not be done, unless both devices have the capability of running two Modbus separate Modbus routines simultaneously, each routine having with their own comm ports.

It seems like you've already discovered that Modbus is a Master-Slave protocolm where a message from the master to the slave can have only one function/command code. Since any given function/command code is either a read or a write instruction, and there is no function code that combines the two, a Modbus operation is either read or write.

Your idea of paralleling ports will not work because the slave drive has only the one port. Even if you could somehow configure the master to read on its one port and write on its other port at the same time, that would create a bus conflict, with two masters fighting each other on a single bus line (which is why one of the Modbus RTU RULES is that only one master is allowed).
  Reply With Quote
Old April 13th, 2012, 12:24 AM   #6
KalleOlsen
Member
Norway

KalleOlsen is offline
 
Join Date: Oct 2008
Location: Middle of Norway
Posts: 1,520
The function code 23 is 'bidirectional'. I.e. you send and request data with one telegram. I don't think it is supported by all Modbus equipment. I've used it with Wago PLC and Vacon VFDs running ModbusTCP.

Kalle
  Reply With Quote
Old April 13th, 2012, 02:04 AM   #7
Andreik
Member
Philippines

Andreik is offline
 
Join Date: Mar 2009
Location: Makati City
Posts: 74
It doesn't support that in this case.

Guess I really have to choose 1 of the 2. Thank you very much.

Quote:
Originally Posted by KalleOlsen View Post
The function code 23 is 'bidirectional'. I.e. you send and request data with one telegram. I don't think it is supported by all Modbus equipment. I've used it with Wago PLC and Vacon VFDs running ModbusTCP.

Kalle
  Reply With Quote
Old April 13th, 2012, 02:18 AM   #8
BobB
Lifetime Supporting Member
Australia

BobB is offline
 
BobB's Avatar
 
Join Date: Jun 2002
Location: Sydney
Posts: 3,614
You can read and then write but have to program the two operations in the PLC - only one at a time.
__________________
The Old Pfhaart

  Reply With Quote
Old April 13th, 2012, 04:04 AM   #9
Andreik
Member
Philippines

Andreik is offline
 
Join Date: Mar 2009
Location: Makati City
Posts: 74
@BobB,

It can't handle fast transitions though. And the data are jamming like party.
  Reply With Quote
Old April 13th, 2012, 08:42 PM   #10
lostcontrol
Member
New Zealand

lostcontrol is offline
 
lostcontrol's Avatar
 
Join Date: May 2009
Location: NeverSayNever
Posts: 606
Quote:
Originally Posted by Andreik View Post
@BobB,

It can't handle fast transitions though. And the data are jamming like party.
What do you mean by fast transactions? What sort of speeds are you expecting with modbus Serial?
There is no need for the data to be jamming like a party if the code is executed correctly.

We have tried to give you plenty of help & lead you in the right direction...
  Reply With Quote
Old April 15th, 2012, 09:01 AM   #11
danw
Member
United States

danw is offline
 
danw's Avatar
 
Join Date: Oct 2004
Location: midwest, USA
Posts: 1,975
Quote:
Originally Posted by KalleOlsen View Post
The function code 23 is 'bidirectional'. I.e. you send and request data with one telegram. I don't think it is supported by all Modbus equipment. I've used it with Wago PLC and Vacon VFDs running ModbusTCP. Kalle
That's right. I'd forgotten about 23 because it's so seldom implemented. Interesting to know that Wago/Vacon supports it.
  Reply With Quote
Old April 15th, 2012, 02:05 PM   #12
lostcontrol
Member
New Zealand

lostcontrol is offline
 
lostcontrol's Avatar
 
Join Date: May 2009
Location: NeverSayNever
Posts: 606
The last time I looked at or used the 23 code, I found it quite slow compared to individual read/writes... but that could of been to do with the slave device also
  Reply With Quote
Old April 15th, 2012, 02:14 PM   #13
KalleOlsen
Member
Norway

KalleOlsen is offline
 
Join Date: Oct 2008
Location: Middle of Norway
Posts: 1,520
Do you happen to remember which device it was, and if it was UDP, TCP or serial?

Just curious,
Kalle
  Reply With Quote
Old April 15th, 2012, 02:23 PM   #14
lostcontrol
Member
New Zealand

lostcontrol is offline
 
lostcontrol's Avatar
 
Join Date: May 2009
Location: NeverSayNever
Posts: 606
Was a Altivar 31 I think, Modbus Serial.
I can try & dig up the application to see what way I left it if that helps?
  Reply With Quote
Old April 15th, 2012, 03:14 PM   #15
KalleOlsen
Member
Norway

KalleOlsen is offline
 
Join Date: Oct 2008
Location: Middle of Norway
Posts: 1,520
Quote:
Originally Posted by lostcontrol View Post
Was a Altivar 31 I think, Modbus Serial.
I can try & dig up the application to see what way I left it if that helps?
Thank you, but you don't need to do that. When we use Altivar, it is with Profibus.

Kalle
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
MSG read/write versus HMI read/write - most efficient rguimond LIVE PLC Questions And Answers 7 January 6th, 2010 05:32 PM
FT View read/write Controllogix mapping PLC5 data files? wilsonzhu LIVE PLC Questions And Answers 0 April 11th, 2008 01:44 PM
fishenguy fishenguy LIVE PLC Questions And Answers 54 November 13th, 2007 08:33 PM
1769-hsc Bob O LIVE PLC Questions And Answers 4 December 23rd, 2004 05:23 AM


All times are GMT -5. The time now is 11:13 PM.


.