Hello Guest it is April 18, 2024, 09:22:36 PM

Author Topic: MACH4 - Modbus  (Read 80730 times)

0 Members and 1 Guest are viewing this topic.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
MACH4 - Modbus
« on: May 06, 2014, 11:51:07 AM »
Just wanted to get a thread started with Modbus in the title.

So far, I have not been able to get Modbus working. No help from the developers except to claim that Modbus works 100% and that there is no documentation available.  I asked the developers for a brief explanation of the procedure, but did not gat an answer.

I can get MACH4 to connect with Serial and TPC, but there is no Modbus communication. I have searched the internet and the forum for any clues, conversation, documentation and have found no information at all.

Has anyone gotten Modbus running with MACH4?

 


Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: MACH4 - Modbus
« Reply #1 on: May 06, 2014, 12:16:08 PM »
Hey Simpson,
  I had a spindle controlled by Modbus working a couple of versions back. I had some help though. I hope to get a chance to load the latest soon and can hopefully give a little more information. It worked for a bit but on the next power up I had no spindle control. I am not sure if it was something I did or a bug and I need to investigate a little more before commenting.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: MACH4 - Modbus
« Reply #2 on: May 06, 2014, 12:52:44 PM »
Hey Simpson,
  I had a spindle controlled by Modbus working a couple of versions back. I had some help though. I hope to get a chance to load the latest soon and can hopefully give a little more information. It worked for a bit but on the next power up I had no spindle control. I am not sure if it was something I did or a bug and I need to investigate a little more before commenting.

Brett

Thanks Brett. Any info you can provide will be appreciated. I can't make any sense out of the config because I have no idea what data it is asking for. It wants a 'name' for example. No idea what it is looking for . . .  ???

Even the most basic stuff would be useful. The developer claims Modbus is 'working 100%' but without some help, I'm dead in the water at this point.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: MACH4 - Modbus
« Reply #3 on: May 06, 2014, 01:02:09 PM »
I understand Simpson. I have attached a couple of screen shots I hope will help. Hopefully I will get to play with it some more later today.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: MACH4 - Modbus
« Reply #4 on: May 06, 2014, 02:14:48 PM »
We are trying to program Mach4 and fix bugs at this time. Doing tech support for modbus is to much of a distraction at this point. Let us get more core issues solved then we can see what we need to do to get your modbus working.

You should start by telling us what you are connecting too for hardware.

Thanks
Brian
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: MACH4 - Modbus
« Reply #5 on: May 06, 2014, 09:39:30 PM »
Here is a Modbus BitOfWord Packing/Unpacking example using VB and a test screen, but could be adapted easily for M4 Lua,
to interface with PLCs etc.

http://www.machsupport.com/forum/index.php/topic,27165.msg191745.html#msg191745
fun times

Offline smurph

*
  • *
  •  1,546 1,546
  • "That there... that's an RV."
    • View Profile
Re: MACH4 - Modbus
« Reply #6 on: May 07, 2014, 01:00:22 AM »
The M4 modbus uses the newer Modicon table/register convention.  Not the hex addressing that Mach3 used.  There tables in the modbus spec that pertain to functions that operate on them.  Modbus devices usually give the addresses in either hex addresses or the table/register format.  And sometimes they will give both.  Also, sometimes they prefix the addresses a bit differently. 

Some do the T:RRRRR format where T is the modbus table and RRRRR is the base 1 register.
Others do a TRRRR format where an address may look like 40001.  This is really table 4, register 1.  

IMPORTANT:  Addresses are base 0 and registers are base 1.  The M4 modbus uses registers.  

If the device documentation gives the old hex addressing format, convert the hex number to decimal and then add 1 (base 1 remember!).  If the address is given in decimal, simply add 1.

Attached is a document that you may find useful.

Also, here is a good page that explains a lot. http://www.csimn.com/CSI_pages/Modbus101.html

Steve

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: MACH4 - Modbus
« Reply #7 on: May 07, 2014, 08:35:55 AM »
This is the one I usually see in VFDs, and other industrial MB devices.
Quote
Others do a TRRRR format where an address may look like 40001.  This is really table 4, register 1. 

Thanks for the heads up Steve!

Scott
fun times

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: MACH4 - Modbus
« Reply #8 on: May 07, 2014, 10:58:49 AM »
We are trying to program Mach4 and fix bugs at this time. Doing tech support for modbus is to much of a distraction at this point. Let us get more core issues solved then we can see what we need to do to get your modbus working.

You should start by telling us what you are connecting too for hardware.

Thanks
Brian

You can't train somebody in Modbus on this forum. And that is not the focus. I get that.

However,  I did not ask for tech support on Modbus per se. I have had Modbus working with MACH3 for a couple of years now. I am familiar with Modbus and since Modbus is '100% working' in MACH4 Demo, I am willing to spend some time on MACH4 Modbus and report back my findings.

What I need is just a brief explanation of how Modus is implemented specifically in MACH4. Really I don't think it would take more than 15 minutes for describe what data the config screens are looking for. 'Name'  can be interpreted a million ways.

All I need (I think) are the following answers and I *should* be off and running

1) What data are the config screens looking for? 'Name' of what?

2) How do you read a register in MACH4

3) How do you write a register in MACH4

That's it, I think. MACH3 had brains and they are gone. What replaces them. Scripts I would imagine. Fine, so how do you read and write the registers with a script?  I have the hardware talking to MACH4. I just have no idea how to move the data. These are all MACH4 specific questions.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: MACH4 - Modbus
« Reply #9 on: May 07, 2014, 11:07:59 AM »
The M4 modbus uses the newer Modicon table/register convention.  Not the hex addressing that Mach3 used.  There tables in the modbus spec that pertain to functions that operate on them.  Modbus devices usually give the addresses in either hex addresses or the table/register format.  And sometimes they will give both.  Also, sometimes they prefix the addresses a bit differently. 

Some do the T:RRRRR format where T is the modbus table and RRRRR is the base 1 register.
Others do a TRRRR format where an address may look like 40001.  This is really table 4, register 1. 

IMPORTANT:  Addresses are base 0 and registers are base 1.  The M4 modbus uses registers. 

If the device documentation gives the old hex addressing format, convert the hex number to decimal and then add 1 (base 1 remember!).  If the address is given in decimal, simply add 1.

Attached is a document that you may find useful.

Also, here is a good page that explains a lot. http://www.csimn.com/CSI_pages/Modbus101.html

Steve

Thank you. This may explain why my Modbus only sees a constant zero function coming from MACH4. It should be relatively simple to make this change in the Modbus code. I'll tinker with that.

I am not asking for Modbus 101. I just need to know basic MACH4 stuff like config the plugin and how to read/write a register.