Hello Guest it is April 25, 2024, 01:56:19 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 - natefoerg

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 »
111
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 25, 2011, 06:02:47 PM »
Hi Peter,

I'm stuck at the point of referencing registers from Cubloc. My test code in Cubloc is:

Do
   If _D(66) = 1 Then
      High 40
   End If

   If _D(66) = 0 Then
      Low 40
   End If
Loop

Basically, turning on a relay when holding register 66 is set to 1. When I manually change holding register 66 through Test ModBus, the relay is set. However, when I use the following VBA code in Mach3:

Call SetModOutput (66,1)

The relay is not set- it seems like it's referencing a different register. My AutoPolling Options are set with Input Start Addresses of 1025 and 1536, and Output Start Address is 2048. I'm using this setup based on someone's post who had a similar project, but I have no idea what it means. Could you explain how the Start Addresses are used?

Do you have any idea where I'm going wrong?

Thanks,
Nate

112
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 24, 2011, 12:07:50 PM »
Thanks hood. I appriciate it.

113
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 24, 2011, 12:11:40 AM »
Yes. About five times today already. I have printed it and will read it till it makes sense!

114
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 23, 2011, 11:53:47 PM »
That would be great. I'm dying over here...

115
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 23, 2011, 11:25:48 PM »
Peter-

Thanks so much for chiming in. I have been studing the things you have written about Modbus. I have also watched several of your videos. I would prefer to use the legacy interface.

Can you please explain to me with an example how to use GetInput(*) and SetModOutput(*,*)?

I dont think that I can really wrap my head around this until I see how they are used in an example.

I know you are very busy, but if it make a difference, everytime anyone (like you and Hood) helps me get closer, you are helping others get closer in the future also, as I am diocumenting my turret conversion here http://www.cnczone.com/forums/hardinge_lathes/129658-chnc_turret_plc_conversion_log.html in great detail. 

My goal is to doccument the process so throughly, that anyone in the future can do the same or simmilar with very little research or effort. I find it very frustrating, that I am having to "reinvent the wheel" I have found that everyone who has done this in the past has left large or small holes in their postings about how they did it. these holes are not easily filled. I am making a post that leaves NOTHING out. I want the next guy to be able to buy the right parts, wire them up, plug in my settings and have it work. I hope the next person does not need to spend weeks trying to tease enough information out of people/books/wikis to get it functional.

We should be building upon each others expierence and knowledge, not relearning the same stuff over and over again.

Ok, I'm done ranting now....   ;) 



116
I continue to slog away at trying to get my toolchanger working, see here- http://www.machsupport.com/forum/index.php/topic,17567.0.html

Note: the last 3 or 4 pages are the only ones that are germain currently. The earlier pages applied to a totally different setup than the one I am trying to get working now.

Truth is, that their are several people who have done exactly what I am trying to do now. Sadly, I cannot get any of them to help me. Believe me, I tried!

Anyway, I am dead stopped until I can get some samples of what people have running as M6Start and the VB/LL code running on their PLC. I have established modbus communication, but cant figure out how to get registers in Mach and on the PLC, communicating. mabie I should say that I, need help getting Mach to talk to the PLC and vice versa. I can only do this by writing code for the PLC. I have what is proven good code for Mach, but cannot find anything as far as samples of what people have running on their PLC's

I am in need of samples of M6start code and PLC code that work together on your machines. I hope that this will help me write what I need for my PLC. BTW, if anyone well versed in these things will help me out on the phone or via email, I stand ready to GLADLY accept such help! I also stand ready to send you a case or two of beer. Yes, I am getting desperate!

Best,
Nate.

 

117
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 23, 2011, 09:11:33 PM »












Hood. I have your settings that allowed you to have communication between Mach and your PLC, if you could please share your Mach macro and the code on the PLC, I would then be able to decipher how they talk to each other and start to figure out how to write the code for my PLC.

I have searched, but have been unable to locate anyone who has posted both the VB they run as M6start in mach and the code they have running on their PLC. I can find lots of M6start examples, but nothing on the PLC side...

Is your PLC code in ladder or basic?











118
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 23, 2011, 07:36:15 PM »
No luck raising Fdos. Sadly.


"It passes the requested station # to the Cubloc PLC via a holding register mapped to 66 in mach and D12 on the Cubloc.

The Cubloc always has it's actual station # available in D13 (67 in Mach) via it's turret encoder routine.   = 0 when invalid = 1 to 4 for valid stations."

Can anyone explain the above quote from Fdos?

It appears to say that holding register 66 in mach is autopolled and reported to D12 on the plc. Furthermore,  that the plc code writes a station number to D13 and Mach autopolls this and reports this on holding register 67.

Am I right?

119
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 21, 2011, 11:17:57 PM »
I sent Fdos an Email also, to see if he can chime in and give me some guidance. I hope he gets the email!

120
General Mach Discussion / Re: Mach 3 toolchange for dummies???
« on: June 21, 2011, 11:08:20 PM »
Thanks Hood, I am going to do testing with the following tool change macro-

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'Toolchange Macro for Mach3 and Hardinge CHNC 8 station turret.
'June 20th 2011 (based upon Macros from Hood and Fdos & possibly others)
 

   
   
Tool = GetSelectedTool() 
If Tool = GetCurrentTool() Then           'Ignore and Exit if already there
  End
End If
 

   


If Tool <1 Then                  'If tool called is < 1
  MsgBox ("Error! Tool "& tool & " Out Of Range")   'error message
  DoOemButton (1003)                       'Stop Button
  End                                      'End macro
End If

If Tool >8 Then                  'If tool called is > 8
  MsgBox ("Error! Tool "& tool & " Out Of Range")
  DoOemButton (1003)                   
  End                                     
End If




Message ("Waiting for Turret Station " & tool)




If Tool=1 Then                            'tool = 1

  Call SetModOutput (66,1)            'Reg D12
    Do
      If GetInput (67) = tool  Then          'Reg D13
        Call SetModOutput (66,0)         'Reset D12
        Exit Do
      End If
    Loop
End If


 
If Tool=2 Then                            'tool = 2

  Call SetModOutput (66,2)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If


 
If Tool=3 Then                            'tool = 3

  Call SetModOutput (66,3)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If


 
If Tool=4 Then                            'tool = 4

  Call SetModOutput (66,4)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If
 
 
 
If Tool=5 Then                            'tool = 5

  Call SetModOutput (66,1)           
    Do
      If GetInput (67) = tool  Then         
        Call SetModOutput (66,0)         
        Exit Do
      End If
    Loop
End If


 
If Tool=6 Then                            'tool = 6

  Call SetModOutput (66,2)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If


 
If Tool=7 Then                            'tool = 7

  Call SetModOutput (66,3)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If


 
If Tool=8 Then                            'tool = 8

  Call SetModOutput (66,4)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If
 
 
Message ("Station " & tool & " OK")      'Status Msg       
SetCurrentTool( tool )

End
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



I have the above saved as M6Start.m1s in my mach3/lathe/macro folder. I know that the macro runs because I get a "Waiting for turret X" message when I manually enter in a toolchange like T0101.

Now that I have Modbus communication, the next step is to figure out how Fdos acomplished the following-



$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
For anyone thats interested here's the M6Start macro for the 4 station turret on my Hardinge.

It passes the requested station # to the Cubloc PLC via a holding register mapped to 66 in mach and D12 on the Cubloc.

The Cubloc always has it's actual station # available in D13 (67 in Mach) via it's turret encoder routine.   = 0 when invalid = 1 to 4 for valid stations.

I'll probably post the Cubloc program when it's developed a bit more.

The Macro below is partially based on Hoods Churchill Macro.  Thanks Robin...


Wayne.....
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

*********, I'm lost...

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 »