Hello Guest it is May 24, 2019, 11:45:42 PM

Author Topic: 16 atc via modbus  (Read 8248 times)

0 Members and 1 Guest are viewing this topic.

Offline jve

*
  •  128 128
    • View Profile
Re: 16 atc via modbus
« Reply #10 on: October 10, 2009, 12:02:29 PM »
then you are writing to "coils" in the PLC, you need to write to a "Holding register", or user memory.  Then do a "Bit-of-word" operation on that register to grab the Tool requested, from there you can do compare statements that then activate your sensor for your Binary input patteren your looking for.

scott
ok scott finally i did my tool changer and it seems it is working well i only have one problem by now when the tool finish it has to activate input 4 of mach 3 i am receiving a bit on the discrete but the input 4 is not activated i have enable input 4 on port 0 pin 1 but not sure if i done it right
do you have some kind of example how i can do the last operation m6 drop out
many thanks in advance
jekran

Offline poppabear

*
  • *
  •  2,231 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: 16 atc via modbus
« Reply #11 on: October 10, 2009, 07:47:42 PM »
you need to use Brains to bring in/ out, your modbus from Serial Plugin modbus.

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline jve

*
  •  128 128
    • View Profile
Re: 16 atc via modbus
« Reply #12 on: October 22, 2009, 02:08:07 AM »
ok scott i made the brain and when i have a toolchange the input 4 led is off and when the toolchange is ready the input 4 led it is on but i dont know y the m6 it does not drop out  what do i have wrong ?
thanks in advance
jekran

Offline jve

*
  •  128 128
    • View Profile
Re: 16 atc via modbus
« Reply #13 on: October 22, 2009, 09:59:51 AM »
 this is my vb may be i have some thing wrong on this

Sub Main()
z= GetUserDro(1202)
code"G53 G0z"&z
While IsMoving()
wend
NewTool = GetSelectedTool()
OldTool = GetCurrentTool()
MaxToolNum = 16 'Max number of tools for the changer

While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend

If NewTool = OldTool Or NewTool = 0 Then
Exit Sub
End If

If OldTool <> NewTool Then
SetUserDRO(2000, NewTool)
End If

SystemWaitFor (INPUT4) 'when the PLC is done, it can turn on input4 so the M6 will drop out.

SetOEMDRO(824,NewTool)

While IsMoving
Wend

End Sub
Main   

Offline jve

*
  •  128 128
    • View Profile
Re: 16 atc via modbus
« Reply #14 on: October 22, 2009, 12:05:38 PM »
i found the mistake on the vb but how i did it when i load a g code with some tool change the system does not wait for the toolchange finish the g code will run and does not wait for the tool change first can some one tell me what i have wrong iv been working on this for two weeks now and i am really tyerd now
this is the last vb

Sub Main()
z= GetUserDro(1202)
code"G53 G0z"&z
While IsMoving()
wend
NewTool = GetSelectedTool()
OldTool = GetCurrentTool()
MaxToolNum = 16 'Max number of tools for the changer

While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend

If NewTool = OldTool Or NewTool = 0 Then
Exit Sub
End If

If OldTool <> NewTool Then
SetUserDRO(2000, NewTool)
End If

'SystemWaitFor (21) 'when the PLC is done, it can turn on input4 so the M6 will drop out.

SetOEMDRO(824,NewTool)

While IsMoving
Wend

End Sub
Main  
« Last Edit: October 22, 2009, 12:09:30 PM by jekran »

Offline poppabear

*
  • *
  •  2,231 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: 16 atc via modbus
« Reply #15 on: October 22, 2009, 09:44:37 PM »
Use

   While Not(IsActive(INPUT4))
wend

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline jve

*
  •  128 128
    • View Profile
Re: 16 atc via modbus
« Reply #16 on: October 23, 2009, 02:10:33 AM »
i try that but the program still does not stop when i have a toolchange m6
do i need to put some where code "m0"
so the program stop and wait for toolchange to be ready
regards
jekran
Re: 16 atc via modbus
« Reply #17 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.

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

Offline jve

*
  •  128 128
    • View Profile
Re: 16 atc via modbus
« Reply #18 on: October 23, 2009, 02:21:38 AM »
yes it is allready in auto toolchange

Offline jve

*
  •  128 128
    • View Profile
Re: 16 atc via modbus
« Reply #19 on: December 21, 2009, 02:08:49 AM »
i made the tool changer but i still have an other problem which is when i reboot mach 3 the tool changer go to position 1 , i dont know why this is happins but the current tool still read the old tool number then when i make an other tool change it works fine  i made also a dro which i can see the oem dro 2000 and as i reboot first it is 0 after i press reset it go to 1 and toolchange go to position 1
can some one help