Hello Guest it is December 26, 2024, 03:24:03 PM

Author Topic: Lathe turret, VB, PLC, MODBUS, Position  (Read 22095 times)

0 Members and 2 Guests are viewing this topic.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #10 on: November 16, 2009, 05:07:40 PM »
Heres the part of the ladder that works the rear turret on my lathe, the front toolpost is similar.

Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #11 on: November 16, 2009, 05:10:17 PM »
Sorry, snipped the start of the toolchange ladder off, heres the relevant  screenshot.
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #12 on: November 16, 2009, 05:16:29 PM »
Actually looking at that I have the mod inputs named wrong, B2000.0  should be named in the ladder as Modin0 not modin1 as I have there. That is only a reference for me looking at so it wont affect the VB but would muddle me up if I was looking at it LOL.

Hood
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #13 on: November 16, 2009, 05:18:29 PM »
Hood, Yeah, I am hoping rigidity is not an issue here, I think that would be a bad sign :-)

Hmm, Hopefully the home switches that are on there are good enough, they are the stock Takisawa ones so I am assuming they are fairly accurate, as long as I go at them with the same feedrate.

Dustin
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #14 on: November 16, 2009, 05:21:28 PM »
Hood, Thanks for the ladder snippets, I think that will be really helpful.  The big picture is becoming clearer...

Dustin

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #15 on: November 16, 2009, 05:24:28 PM »
No probs, if you  need help just shout, not the best at it but have managed to muddle through a few.
If you go the plugin route then Poppabear or Peter are probably the ones to ask as I know nothing about the plugin.

Hood
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #16 on: November 16, 2009, 06:02:30 PM »
Peter, how do the click PLC's connect to modbus, serial? TCP?
I use a D0-06 and the old style serial interface and there is no need for a Brain.

Hood

Hi Hood,

If you use the old legacy Modbus interface, you are correct as there are VB functions to access the Modbus buffers. This is what I used for my ModIO controlled toolchanger

With the newer Modbus with PlugIn support module, the only way to access the modbus buffers is either via a plugin or by Brains. There is no support to access them via a VB Script macro. :( This is a big limitation as I see it. I've asked Brian to add them in, and I think that they will be there for Mach4. It is a real shame that they can't be added in to Mach3 as it is just 4 simple functions that are required.

Accessing them through Brains is a pain. The brain has to copy the data to a User DRO, then the Macro read the DRO.  Same for data going the other way.

I came up with a tool-change macro that  I was hoping could be the basis of a standard toolchange interface to Modbus devices, ModIO, PLCs, etc.

I've seen a number of toolchange macros that don't really have any safety features built in.

Cheers,

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

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #17 on: November 16, 2009, 06:11:15 PM »
Thanks for the clarification Peter, I have never used the plugin, looks too complicated for me ;D

I know my toolchange is fine anyway, tried to index to tool 7 the other day, its on the front toolpost rather than the turret, when I came back expecting the part to be finished all I saw was the turret indexing. One of the limit switches has gotten drowned (supposed to be IP65 LOL) and Mach was patiently waiting for the signal that the tool was in position. Took 5 mins to replace the switch and off it went, luckily I have a few spares :)

Hood
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #18 on: November 17, 2009, 12:31:15 PM »
OK, I'm getting there, but am having trouble getting the PLC to talk to Mach, I think mainly because I'm confused about terminology.  I have input FROM the PLC to Mach working but activating input auto-polling and setting it to "coils" (whatever that means :-))  In the PLC the inputs are called X and the address starts at hex 0000, so that is where I started the addressing in mach, seems to work fine, I told mach to look for Y home on port 0, pin 0 and if I activate the first input on the PLC the DRO lights up in Mach, everything is OK-Dokey.

The other way is where I am confused.  The PLC outputs are labeled Y, but I don't think that is what I want.  There is also a "thing" in the PLC called "C" which seem to be internal registers and I figured they would be what I need to write to, as they are the only other thing that seems to make sense.  Their Modbus addresses start at 4000 HEX.  If I enter 4000 hex into Mach it says that is an invalid address depending on where it is set.  I've tried what seems like every combo of Holding, Coils, Input, and Discrete in the test page and while some seem to write values into the PLC somewhere, they don;t seem to change the "C" state....

Does that make any sense :-)?  Thanks so much for all the help so-far, I appreciate it!
Dustin

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Lathe turret, VB, PLC, MODBUS, Position
« Reply #19 on: November 17, 2009, 01:57:00 PM »
Which serial interface in Mach are you using? Normal or Plugin?

Hood