Hello Guest it is April 19, 2024, 10:05:31 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Peter Homann

331
General Mach Discussion / Re: Lathe turret, VB, PLC, MODBUS, Position
« on: November 17, 2009, 06:16:00 PM »
Hi Dustin,

You probably need to start reading some of the Modbus specs, it will help with the understanding.

X are discrete inputs. They connect to the outside world.
Y are discrete outputs. They connect to the outside world.
C are internal coils. Thinkof them as temporary memory.

With the addressing, Modbus has 2 schemes. 'Hex' addressing and '984' addressing.

So in 984 format the first C1 bit coil is located at address 16385. In hex format, the address of C1 is 0x4000 which is 16384.

Try to write to coil 16384 from Mach3.

I know it sounds really weird, but in 984 addressing each data type is offset by a certain amount depending on its data type. It was initially to do with how PLCs used to be built.

Mach uses hex addressing but in decimal form. So hex 4000 is decimal 16384

Ad to the holding registers DS, there addresses start at 0000 hex.  or 400001 in 984.

I hope this is not to confusing.

Cheers,

Peter.








332
General Mach Discussion / Re: Lathe turret, VB, PLC, MODBUS, Position
« 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.

333
General Mach Discussion / Re: Lathe turret, VB, PLC, MODBUS, Position
« on: November 16, 2009, 04:15:10 PM »
Hi Dustin,

All your VB script stuff should be in your M6Start macro. You will need to use a brain to transfer info between the M6 start macro and the modbus config data areas.

Basically your M6 start macro should indicate to the plc what tool it wants, then the plc does its stuff and returns after it is done with a success or error status.

If this is not clear, let me know?

Cheers,

Peter.

334
General Mach Discussion / Re: Lathe turret Tool Changer, PLC, VB Scripts
« on: October 29, 2009, 01:14:01 AM »
Hi Dustin,

That's OK I understand.  The new ModIP I'm working on will allow you to write your own basic scripts in it. But it is some months away.

A PLC is also a good way to go.

Cheers,


Peter.

335
General Mach Discussion / The ModIP is alive. (Almost)
« on: October 28, 2009, 07:21:55 PM »
Hi all,

 Over the last 12 months (or longer), I've been working on the ModIP. The ModIP
 is a Modbus slave on steroids.

 Firstly it connects to Mach3 via Ethernet, hence the IP in ModIP. It uses
 Modbus over TCP/IP for communications. AS such it allows for much faster
 transfers with the versatility and robustness of Modbus.

 Another advantage of using TCP/IP is that the configuration of the device can
 be done through web pages. Additionally, firmware upgrades are as simple as
 loading the update file through the webpage.

 The ModIP also includes a Gateway function. Currently MAch3 is capable of only
 opening one TCP/IP Modbus port at a time. This limitation means that you can
 only communicate with a single TCP/IP device. The ModIP overcomes this
 limitation by providing a gateway function that allows you to the route Modbus
 messages to multiple Modbus slaves based on the subaddress value in the
 message. The Gateway function allows you to add up to 8 additional TCP/IP
 Modbus slaves.

 If the ModIP can't find a match in the gateway routing table, the message is
 sent out on a serial port (RS232 or RS485) so you can also use your existing
 ModIO's or serial based PLCs, VFDs etc.


 The ModIP will also contain a scripting language. You can upload an edit a
 basic sript language that can will be continuously run, very similar to the
 Mach3 macropump, but a lot faster. This should be a great help for
 toolchangers, Pendants etc.

 I'm still deciding on the amount of I/O, but it will have plenty. Additional
 I/O modules will communicate via the industrial strength CAN bus interface.

 There is still a long way to go but what I have now is running on a prototype
 development board. The device can be accessed by setting your browser to:
 http://114.78.173.122/


 You can can even access it via Mach3. Set up your Mach3's TCP Modbus
 configuration to use IP address 114.78.173.122 then set up a cfg# to use:
 Subaddress: 1
 Start address: 1000
 Number of registers: 10 (or 100)
 Register type:  Read Holding registers

 The best way to do this is via the Modbus test page. Currently the registers
 just hold the address value of the register.

 I'm really excited about the development of the ModIP as I see great potential
 for industrial strength I/O expansion.


 Enjoy,

 Cheers,

 Peter.

336
General Mach Discussion / Re: Lathe turret Tool Changer, PLC, VB Scripts
« on: October 28, 2009, 04:49:33 PM »
Hi All,


1-Would one program all of the timing functions in VB, or would that be done in the PLC "ladder logic" and the VB would just do "something" via Modbus after the M6start?
2-Is Modbus a robust enough interface for a serious machine like this?  With a 15 HP spindle and 2KW servo motors I want this thing under control at all times :-)

Thanks for any help or suggestions!
Dustin
www.protoplant.com



Hi Dustin,


2. Modbus was designed specifically for industrial control. It is robust enough.


1. There are 2 parts to the story.  Basically, the M6 toolchange Macro tells the ModIO or PLC to 'go to tool X'. The PLC does it's stuff and reports back "Now at tool X, or reports an error".

For example, below is the M6Start Macro I use for all the ModIO based toolchangers.


Code: [Select]
' Macro To interface To ModIO/TC
'
' The Mach3 Modbus interface should be configured:
' ModIO Checkbox NOT checked
' First line of AutoPolling Input not checked - No inputs can go to Ports
' and Pins
' Second line of Inputs Checked, Slave = x, Start Regs = 1200, # Regs = 3
' First line of Autopolling Output not checked - no output Ports & Pins
' Second line of Output Slave = x, Start Regs = 1100, # Regs = 2

' This macro should be used with M990 in the Mach3 Init string. This is needed
' to synchronisethe Initiation flag values in ModIO and Mach3.
' M999 must be called after a ModIO reset too.

Option Explicit ' requires declarations

Dim tool As Integer
Dim ChangesCalled As Integer
Dim Dummy As Integer

Dim ChangesWere  As Integer ' value before this request
Dim ChangerCount As Integer ' value returned from the ModIO
 

Dim ErrNo as Integer

Const ChangerCurrPos  = 64 ' Inputs  1200 Current tool
Const ChangerCountReg = 65 ' 1201 Change done indicator - this is the
' same as 1101 when done
Const ChangerErrCode  = 66 ' 1202 Error code reply if problems

Const ChangerReqPos   = 64 ' Outputs 1100
Const ChangerInitReg  = 65 ' 1101 initiates a change when made different
' to 1201

Const CallDRONo = 1080


' This just keeps count of the number of changes done
ChangesCalled = GetUserDRO (CallDRONo) ' what we think is current
ChangesCalled = ChangesCalled + 1
SetUserDRO CallDRONo, ChangesCalled ' remember new value in Mach3



' Now lets kick the ModIO/TC
tool = GetSelectedTool() ' what tool does user want

SetModOutput ChangerCurrPos, tool ' output requested tool number

ChangesWere = GetInput (ChangerCountReg) ' read current ChangerCountReg

SetModOutput ChangerInitReg, ChangesWere+1 ' initiate the turret change

ChangerCount = ChangesWere ' How many does it think is has done so far

While (ChangesWere = ChangerCount) And (GetInput (ChangerErrCode) = 0)
' not failed or finished
Sleep(50)
ChangerCount = GetInput (ChangerCountReg)
Wend ' loop until changer tells is it done something

If GetInput (ChangerErrCode) <> 0 Then
ErrNo = GetInput (ChangerErrCode)
Message "Toolchanger raised error " & ErrNo
Code "M0" ' chuck it all in.
' *** Must be a better solution here
Else
Message "Tool changed " & ChangesCalled & " times"
End If

     SetCurrentTool GetInput (ChangerCurrPos)

SetModOutput ChangerCurrPos, 0 ' Clear tool number incase the Mach3 and
' ModIO initiate counters get out of step
' when we might get a spurious change

   
' end of Toolchanger macro
 
' *** Note M6End.M1S should be empty     

337
SmoothStepper USB / Re: What FPGA uses SmoothStepper ?
« on: October 23, 2009, 06:17:01 PM »
And you need to know that because?

338
General Mach Discussion / Re: 16 atc via modbus
« on: October 23, 2009, 02:19:15 AM »
Hi,

If you haven't already, go into the config menu Config->General Config and change the Toolchnge mode  to'Auto Tool Changer'

Cheers,

Peter.


339
Modbus / Re: Modbus Function Code 43/13
« on: October 13, 2009, 07:32:38 PM »
Hi,

My understanding is that the answer is no. Mach3 only used the basic Modbus commands.

Cheers,

Peter.

340
General Mach Discussion / Re: Mach 3 and Geckodrive G540
« on: October 13, 2009, 07:24:55 AM »
Hi Clive,

Assuming your Steppers are size 23, then the Gecko G540 should be a perfect match. You may be able to use your existing power supply, depending on what it is. Anything up to 50V will be fine. If you need to get a new power supply, look at a 48V 6A linear supply.

Cheers,


Peter.