News:

  • October 13, 2025, 01:51:26 AM

Login with username, password and session length

Author Topic: Need help getting Modbus working from BRX to Mach3  (Read 4112 times)

Garyhlucas

  • Hero Member
  • *****
  • Posts: 412
Need help getting Modbus working from BRX to Mach3
« on: December 14, 2020, 08:47:05 PM »
I am trying to get Modbus communication going between Mach3 and a BRX PLC.  This looks like it should be simple but I am stumped.  On the PLC Ethernet Monitor I can see packets going back and forth as the PLC programming software communicates with the PLC.  I have added some screen shots here that may give someone with expertise here in Modbus to help me.  At the moment the only thing I want to do is send the Spindle Speed S to the PLC as I have 3 different spindles and the PLC can then send the appropriate signals to each device.  That part works just fine already.

pbw

  • Hero Member
  • *****
  • Posts: 126
Re: Need help getting Modbus working from BRX to Mach3
« Reply #1 on: December 14, 2020, 10:41:16 PM »
I think Mach3 is Master and does the polling.
Not totally sure, but I was digging around a couple months ago and had the Modbus communications working with Mach3 being Master.
Can the BRX ping the computer?
Did you restart MAch3 after you enabled TCP Support?
« Last Edit: December 14, 2020, 10:46:50 PM by pbw »

brucek

  • Sr. Member
  • ****
  • Posts: 59
Re: Need help getting Modbus working from BRX to Mach3
« Reply #2 on: December 15, 2020, 07:08:15 AM »
I'd be careful using 192.168.0.1 since the .1 is usually the gateway. If your just using a switch not an issue but might be that simple.

Garyhlucas

  • Hero Member
  • *****
  • Posts: 412
Re: Need help getting Modbus working from BRX to Mach3
« Reply #3 on: December 15, 2020, 02:17:48 PM »
Bruce,
There is no network involved, just the PC talking to the PLC, and this is a standalone PC with no internet connection either as Anti-virus software plays hell with Mach3.  My cam program runs on the same PC so I don't move much by sneaker net.  However I will change the IP addresses and see.

Garyhlucas

  • Hero Member
  • *****
  • Posts: 412
Re: Need help getting Modbus working from BRX to Mach3
« Reply #4 on: December 22, 2020, 02:04:41 PM »
Still no joy trying to get this to work.  I think terminology is part of the problem.  As I understand it one device is the master (is that the server or client?) and the other is the slave.  The master can send a message with an address and data to a specific slave, or it can request data from a specific slave with the slave the slave then sending the data back.  Is this the correct interpretation?

I think Mach3 is set up only to be a master and can send data, in this case the requested spindle RPM to a slave.  So that means the BRX needs to be configured as a slave?  Does the BRX need to use MRX & MWX instructions to communicate?

If I can get this  to work it is going to be awesome, as the BRX can then translate the requested speed for each of my 3 spindles to give me the correct actual speed.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Need help getting Modbus working from BRX to Mach3
« Reply #5 on: December 22, 2020, 02:47:30 PM »
Still no joy trying to get this to work.  I think terminology is part of the problem.  As I understand it one device is the master (is that the server or client?) and the other is the slave.  The master can send a message with an address and data to a specific slave, or it can request data from a specific slave with the slave the slave then sending the data back.  Is this the correct interpretation?

I think Mach3 is set up only to be a master and can send data, in this case the requested spindle RPM to a slave.  So that means the BRX needs to be configured as a slave?  Does the BRX need to use MRX & MWX instructions to communicate?

If I can get this  to work it is going to be awesome, as the BRX can then translate the requested speed for each of my 3 spindles to give me the correct actual speed.


Master = Client
Slave = Server

Master/Client originates the transaction, sending a Modbus function request.
Slave/Server responds to the transaction, reading or writing local data as requested.

MRX/MWX are Master/Client instructions that are used to talk to Slaves/Servers. You do not need them in this case.

When BRX is acting as a server (from TCP  or serial ports), all read/write transactions reference the Modbus sandbox memories MI, MC, MIR, MHR. So if Mach writes Modbus Holding Register 3, that data will show up in BRX MHR3.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Garyhlucas

  • Hero Member
  • *****
  • Posts: 412
Re: Need help getting Modbus working from BRX to Mach3
« Reply #6 on: December 22, 2020, 07:48:44 PM »
Bob,
Thanks that makes a lot more sense. I'll give it a try. You guys make things easy and I make them difficult.

Garyhlucas

  • Hero Member
  • *****
  • Posts: 412
Re: Need help getting Modbus working from BRX to Mach3
« Reply #7 on: December 24, 2020, 08:51:25 PM »
Well I have somehow managed to clobber all communications with the BRX in playing with Ethernet settings!  The PLC is still running doing its thing but I can no longer get on line with it.  I thought no problem I have a USB POM module, I'll just use the USB port to reprogram the ethernet IP.  No joy that way either.  Both ports tell me there is a BRX ethernet PLC there but I can't communicate with it.  Any way to bash it over the head and force it to reset to default conditions?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Need help getting Modbus working from BRX to Mach3
« Reply #8 on: December 25, 2020, 10:01:36 AM »
I?d start with a power cycle. If that doesn?t fix it, I?d clear the PLC. If you can?t connect to it, there is a magic handshake to wipe it.

Really like to understand what?s happened though.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Garyhlucas

  • Hero Member
  • *****
  • Posts: 412
Re: Need help getting Modbus working from BRX to Mach3
« Reply #9 on: December 25, 2020, 03:00:30 PM »
Bob,
I power cycled both the PLC and the PC before I posted the last message. Didn?t help.

Garyhlucas

  • Hero Member
  • *****
  • Posts: 412
Re: Need help getting Modbus working from BRX to Mach3
« Reply #10 on: January 01, 2021, 02:25:02 PM »
Bob,
Figured you were on vacation but I see you posting here.  Power cycle didn't help, I still can't communicate with the PLC using Ethernet or USB POM, but it is still running and controlling the machine.  Got that brick I need to bash it into responding?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Need help getting Modbus working from BRX to Mach3
« Reply #11 on: January 01, 2021, 02:29:03 PM »
Bob,
Figured you were on vacation but I see you posting here.  Power cycle didn't help, I still can't communicate with the PLC using Ethernet or USB POM, but it is still running and controlling the machine.  Got that brick I need to bash it into responding?

You can't talk via USB POM either? Can you put it in program mode with the mode switch? Does it talk then?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Need help getting Modbus working from BRX to Mach3
« Reply #12 on: January 01, 2021, 02:30:05 PM »
Figured you were on vacation but I see you posting here. 

I am. I came down for coffee. Office's machine is always good.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Garyhlucas

  • Hero Member
  • *****
  • Posts: 412
Re: Need help getting Modbus working from BRX to Mach3
« Reply #13 on: January 01, 2021, 02:37:38 PM »
Bob,
Figured you were on vacation but I see you posting here.  Power cycle didn't help, I still can't communicate with the PLC using Ethernet or USB POM, but it is still running and controlling the machine.  Got that brick I need to bash it into responding?

You can't talk via USB POM either? Can you put it in program mode with the mode switch? Does it talk then?

Don't remember but worth a try. I'll let you know.

Garyhlucas

  • Hero Member
  • *****
  • Posts: 412
Re: Need help getting Modbus working from BRX to Mach3
« Reply #14 on: January 01, 2021, 06:16:02 PM »
Yep that worked! Communicated over USB and reset the IP address and I am back in business. I got Mach 3 to write data to the MHR memory using their test function. Still can?t figure out how to select the Spindle speed variable and send that. But progress comes in tiny little package while trouble comes in a 50 lb. bag!

Thanks for the help,