Hello Guest it is April 23, 2024, 01:09:54 PM

Author Topic: Allen Bradley micro logix and Modbus  (Read 20408 times)

0 Members and 1 Guest are viewing this topic.

Allen Bradley micro logix and Modbus
« on: December 07, 2008, 03:54:00 PM »
I have Mach3 and a AB micro logix 1100 plc and trying to communicate with modbus
currently there are talking and the coils can be written to and read only in binary not word format contacts are the same way

AB modbus registors are like this

coils  ( 0001 to 4096)
contacts ( 10001 to 14096 )
Holding ( 40001 to 40256 )
inputs ( 30001 to 30256 )
« Last Edit: December 07, 2008, 04:02:02 PM by Cncman2nv »
Adam
Re: Allen Bradley micro logix and Modbus
« Reply #1 on: December 08, 2008, 07:34:45 PM »
Hi,

Not sure what your question is. Yes Coils and contacts are single bit ON/OFF discretes.
Holding registers and Input are 16 bit registers.

The Mach3 Modbus setup allows to to read/write to both 16 bit registers and single bit discretes.

Cheers,

Peter.
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Allen Bradley micro logix and Modbus
« Reply #2 on: December 08, 2008, 10:03:42 PM »
Don't know why but Mach can't read the input or holding registers or the AB PLC won't let Mach read them  Mach's mod test page gives a( Illegal Data )MSG
Does the 5 place AB modbus address mapping have any thing to do with it


here are the AB address mapping
Adam
Re: Allen Bradley micro logix and Modbus
« Reply #3 on: December 08, 2008, 11:15:09 PM »
Hi,

It is not Mach that is giving the error, it is your PLC. Mach is just reporting what is being returned.

I don't know what you mean by "Does the 5 place AB modbus address mapping have any thing to do with it "

Cheers,


Peter.

Don't know why but Mach can't read the input or holding registers or the AB PLC won't let Mach read them  Mach's mod test page gives a( Illegal Data )MSG
Does the 5 place AB modbus address mapping have any thing to do with it


here are the AB address mapping
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Allen Bradley micro logix and Modbus
« Reply #4 on: December 08, 2008, 11:26:52 PM »
Looking at your Memorty map definition you can only read the coil space as discretes and not packed into 16 bit registers.

Presumably your PLC allows you to write ladder logic in it. If so, write a ladder to pack the coils into a holding register, then rad the holding register via Modbus.

Cheers,


Peter.
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Allen Bradley micro logix and Modbus
« Reply #5 on: December 09, 2008, 08:29:02 AM »
Here are some screen shots from Ab software and Mach
Adam

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Allen Bradley micro logix and Modbus
« Reply #6 on: December 09, 2008, 11:16:19 AM »
The Bit-Of-Word does not work in Brains, so, in your PLC your going to have to read/write to a range of User Vars in your PLC, to do discrete set your PLC vars to 14000.0, 14001.0 etc. you will burn up an entire word in your PLC just to move a single bit, but until the Bit of word is fixed in brains that is the way it is.
ON the other hand, if you are brining this in via Serial cable to your PLC then, you can use the VB Mach Specific Modbus control launguage that allows in/out over discreate I/O and you CAN do Bit of word that way.....  More work for you though. You would have to run your code in the Macro pump for it to act as your Poller/interface between Mach and your PLC.

scott
fun times
Re: Allen Bradley micro logix and Modbus
« Reply #7 on: December 09, 2008, 11:23:04 AM »
So how does the VB and modbus work together can analog values be read or MPG thru script



Adam
Adam
Re: Allen Bradley micro logix and Modbus
« Reply #8 on: December 09, 2008, 02:30:49 PM »
Here are some screen shots from Ab software and Mach

The reason why it is failing with Mach is that you are setting up the MAch Modbus test page to read holding registers. From your table of addresses you posted, all the registeres in the 3***** range are input registers NOT holding registers 

In the Modbus  test  page, select input register, rather than holging register. See if it works now.

Cheers,


Peter.
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Allen Bradley micro logix and Modbus
« Reply #9 on: December 09, 2008, 03:39:08 PM »
Peter,

 Yes I see what you mean and i tried It the other way and still no luck


Is there any modbus VB script examples I saw the video in the feed pot  but i may need something more to fall back on
Adam