Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Garyhlucas 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.
-
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?
-
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.
-
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.
-
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.
-
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.
-
Bob,
Thanks that makes a lot more sense. I'll give it a try. You guys make things easy and I make them difficult.
-
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?
-
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.
-
Bob,
I power cycled both the PLC and the PC before I posted the last message. Didn?t help.
-
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?
-
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?
-
Figured you were on vacation but I see you posting here.
I am. I came down for coffee. Office's machine is always good.
-
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.
-
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,