Hello Guest it is April 16, 2024, 01:44:37 AM

Author Topic: Have you ever seen Mach doing this  (Read 7180 times)

0 Members and 1 Guest are viewing this topic.

Offline CJEls

*
  •  69 69
    • View Profile
Have you ever seen Mach doing this
« on: August 12, 2008, 03:30:46 PM »
Hi All
 
I have a weird problem with mach turn.When I call a tool the turret does not turn bur then I open vb editor and run the m6 script and then the turret will turn to the tool I called. I did en able tool Auto change in the general setup page .Any takers on this one.

Cj

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Have you ever seen Mach doing this
« Reply #1 on: August 12, 2008, 03:39:10 PM »
Have seen that before with VB, it will run fine stepping through in the editor but wont run from Mach.
Has your toolchange ever worked in Mach?
Hood

Offline CJEls

*
  •  69 69
    • View Profile
Re: Have you ever seen Mach doing this
« Reply #2 on: August 12, 2008, 03:53:08 PM »
Hi Hood

Yes it work with the hard drive that failed.

CJ

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Have you ever seen Mach doing this
« Reply #3 on: August 12, 2008, 03:54:13 PM »
can you attach the macro and maybe someone will find a problem.
Hood

Offline CJEls

*
  •  69 69
    • View Profile
Re: Have you ever seen Mach doing this
« Reply #4 on: August 12, 2008, 04:17:01 PM »
Hood

This is the code I hope some body can help.
 
   Old_tool = GetCurrentTool()
   New_Tool = GetSelectedTool()
   
 
   

If GetSelectedTool <1 Then   'If tool called is less than 1
MsgBox("Tool Out Of Range")  'show message
End                          'End macro
End If

If GetSelectedTool >8 Then  'If selected tool is greater than 12
MsgBox("Tool Out Of Range")  'Show message
End                          'End macro
End If

If GetselectedTool = GetCurrentTool Then  'If selected tool is the same as current tool then end macro
End
End If

 
 If GetSelectedTool=1  Then               'If selected tool = 1
 Do                                       'Start loop
 Call ActivateSignal(output4)             'start turret indexing
 If IsActive(Input1) And Not IsActive(Input2) And Not IsActive(Input3) And Not IsActive(Input4)  Then Exit Do             'Correct tool in position signal from PLC and exit loop
 Loop                                     'Continue loop if above signal is not present
 End If
 Call DeActivateSignal(OutPut4)            'Stops turret Indexing
 
 
If GetSelectedTool=2  Then               
 Do                                       
 Call ActivateSignal(output4)             
 If IsActive(Input1) And  IsActive(Input2) And Not IsActive(Input3) And Not IsActive(Input4)  Then Exit Do             
 Loop                                     
 End If
 Call DeActivateSignal(OutPut4)
 
 
                         
If GetSelectedTool=3  Then               
 Do                                       
 Call ActivateSignal(output4)             
 If Not IsActive(Input1) And  IsActive(Input2) And Not IsActive(Input3) And Not IsActive(Input4)  Then Exit Do             
 Loop                                     
 End If
 Call DeActivateSignal(OutPut4)
 
 
 
 
If GetSelectedTool=4  Then               
 Do                                       
 Call ActivateSignal(output4)             
 If Not IsActive(Input1) And  IsActive(Input2) And  IsActive(Input3) And Not IsActive(Input4)  Then Exit Do             
 Loop                                     
 End If
 Call DeActivateSignal(OutPut4)
 
 
 
If GetSelectedTool=5  Then               
 Do                                       
 Call ActivateSignal(output4)             
 If Not IsActive(Input1) And Not IsActive(Input2) And  IsActive(Input3) And Not IsActive(Input4)  Then Exit Do             
 Loop                                     
 End If
 Call DeActivateSignal(OutPut4)
 
 
 
 
If GetSelectedTool=6  Then               
 Do                                       
 Call ActivateSignal(output4)             
 If Not IsActive(Input1) And Not IsActive(Input2) And  IsActive(Input3) And  IsActive(Input4)  Then Exit Do             
 Loop                                     
 End If
 Call DeActivateSignal(OutPut4)
 
 
 
If GetSelectedTool=7  Then               
 Do                                       
 Call ActivateSignal(output4)             
 If Not IsActive(Input1) And Not IsActive(Input2) And Not IsActive(Input3) And  IsActive(Input4)  Then Exit Do             
 Loop                                     
 End If
 Call DeActivateSignal(OutPut4)
 
 
 
If GetSelectedTool=8  Then               
 Do                                       
 Call ActivateSignal(output4)             
 If IsActive(Input1) And Not IsActive(Input2) And Not IsActive(Input3) And  IsActive(Input4)  Then Exit Do             
 Loop                                     
 End If
 Call DeActivateSignal(OutPut4)

CJ

Offline CJEls

*
  •  69 69
    • View Profile
Re: Have you ever seen Mach doing this
« Reply #5 on: August 12, 2008, 04:20:04 PM »
Hi

It seems that Mach is not seeing the m6 command.

Cj

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Have you ever seen Mach doing this
« Reply #6 on: August 12, 2008, 05:07:29 PM »
Ha ha I recognise that code ;)
 Ok I have half tested it here and it seems to be working in as much as its switching  OutPut 4 on (seen on Diags screen)
Are you getting that?
If not then can you attach your xml to the thread.
Hood

Offline CJEls

*
  •  69 69
    • View Profile
Re: Have you ever seen Mach doing this
« Reply #7 on: August 13, 2008, 12:11:56 AM »
Hi Hood

The turret turnsd to the correct posistion when iI run the code in Vb.The output4 does work.

CJ

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Have you ever seen Mach doing this
« Reply #8 on: August 13, 2008, 02:16:47 AM »
Please attach your xml.
Hood

Offline CJEls

*
  •  69 69
    • View Profile
Re: Have you ever seen Mach doing this
« Reply #9 on: August 13, 2008, 12:29:42 PM »
Hi Hood

got it sorted and it is working like a charm now it is the modbus that I must sort out.I can talk to the board if I run Xp cominications.I can set the port .baudrate but with mach it does not want to talk.

CJ