Hello Guest it is March 28, 2024, 07:24:53 AM

Author Topic: Lathe Toolchanger in VB via Modbus and PLC  (Read 12085 times)

0 Members and 1 Guest are viewing this topic.

Offline Dan13

*
  •  1,208 1,208
    • View Profile
    • DY Engineering
Lathe Toolchanger in VB via Modbus and PLC
« on: February 07, 2013, 03:29:54 PM »
Hi,

Need some help with setting a toolchanger via modbus. Just can't get my head around this. All the toolchange sequence is going to be handled by the PLC, only need to send a command to initiate a toolchange and then get a confirmation from the PLC that it was successful. Now to do this in Mach3 I think I need a VB macro to send the requested tool number to the PLC and then wait for the confirmation. Have no idea how it can be accomplished with a Brain.

However, to use a VB macro with Modbus I need to use the standard Modbus, while I do need the plugin Modbus to implement other stuff, like FRO and SRO, in Brains, since as far as I know Brains don't work with the standard Modbus. Besides the plugin Modbus should be more stable as far as I know.

Whats the correct way to do this?

Thanks,
Dan
Re: Lathe Toolchanger in VB via Modbus and PLC
« Reply #1 on: February 07, 2013, 04:40:10 PM »
It's fairly simple.
Using the plugin
 Modbus, the M6start macro needs to tell a brain (via a user DRO) to put the new tool into the Modbus register to send it to the PLC.

Another brain needs to monitor the Modbus register from the PLC, to determine when the change is done. Once done this brain informs the M6 Start macro that the change is done (via another user DRO)

Meanwhile the M6Start Macro has been sitting in a loop waiting for the change to complete by checking the user dro that will indicate this.

Cheers,

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com

Offline Dan13

*
  •  1,208 1,208
    • View Profile
    • DY Engineering
Re: Lathe Toolchanger in VB via Modbus and PLC
« Reply #2 on: February 08, 2013, 12:33:56 AM »
Hi Peter,

Thanks a lot for the help.

Dan
Re: Lathe Toolchanger in VB via Modbus and PLC
« Reply #3 on: February 20, 2013, 08:37:56 AM »
What would be a good suggestion of what user DRO to use or create for the tool change start and tool change complete

thanks
Adam

Offline Dan13

*
  •  1,208 1,208
    • View Profile
    • DY Engineering
Re: Lathe Toolchanger in VB via Modbus and PLC
« Reply #4 on: February 20, 2013, 10:08:48 AM »
Hi Adam,

Just any DRO from 1000 to 2255. They are all user DROs.

Dan
Re: Lathe Toolchanger in VB via Modbus and PLC
« Reply #5 on: May 03, 2013, 05:39:19 PM »
Hi, Everybody.
I'm looking for any help about  Modbus and Macro use. I have everything working after long time of work and search. I have my Mach 3 working with PLC DL05, I want to ask anybody that could help and tell me, how can I activate a macro without use a brain, I mean direct from Modbus/PLC? I dont know if it is possible or not.

Thanks in advance.

Darli
Re: Lathe Toolchanger in VB via Modbus and PLC
« Reply #6 on: May 03, 2013, 11:27:12 PM »
Hi Darlly01:

I believe you are unclear on how Mach3 and ModBus communicate. There are several pretty good posts regarding this topic, especially those posted by Scott Schaefer.

Basically, Mach3 is continually scanning the "registers" in the ModBus Serial page, and the "registers" each relate to an output from the PLC. This scan is about 10 times a second.

If the PLC output is a panel button changing from 0v to 5v, the register scanned by Mach3 will change from a 0 to a 1.

Mach3 "knows" what to do with this information through a Brain, which is written so Mach3 can take the appropriate action, for instance turning on/off a Mach3 OEM function such as a coolant relay.

Brains can handle digital and analog inputs, like a Feed Rate override potentiometer, or a simple on/off relay switch.

The "Brain" is the method by which Mach3 responds to an external input that is not one of the basic Input channels, which are limited in the basic parallel port.

 
Re: Lathe Toolchanger in VB via Modbus and PLC
« Reply #7 on: May 04, 2013, 07:17:49 AM »
Thanks Mrprecise44,

I develop all my project this way you described. I'm clear about this way of brain works, it was a long path I walk to get here. My project is working, it is not a regular cutter cnc, I did a glue dispenser to speaker production line, but I just want make it more fast, and I notice that modbus/PLC communication with brain take a little more time and sometimes is not consistent because of this communication process, since I'm using mach3 for different propose that it was developed. My process is a repeating task and not a regular cnc which make different task.
Anyway thank you for your attention to my post, as you said you mean that is not possible to do what I want without use the brains, Am I right?

thanks

Darli
Re: Lathe Toolchanger in VB via Modbus and PLC
« Reply #8 on: May 04, 2013, 12:28:21 PM »
ModBus is NOT a high-speed communication protocol as compared to the speed that a PC runs at. Most PC's run in the Giga-hertz range. If your application is very "time-sensitive", ModBus is not the way to go.

If you watch the videos on Brains, their function is defined. Brains are VERY, VERY fast, but the ModBus scan time is still only about 10 scans per second.

Brains are designed to run within the Mach3 environment, and trigger the appropriate Mach3-OEM code by means of LOGIC such as; compare two inputs, apply a formula to an analog signal, make a "AND" decision, make an "OR" decision, etc.



Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Lathe Toolchanger in VB via Modbus and PLC
« Reply #9 on: May 06, 2013, 08:03:10 AM »
Modbus and Brians confusion.

You can get to the Modbus Serial plugin via Brains OR plugins, and that is it.
BUT.......  if you use the Old Style serial modbus, you can get to its data via VB scripting, Brains or Plugins.

Scott
fun times