Hello Guest it is November 22, 2019, 02:15:46 AM

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 - TPS

711
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 05:52:18 AM »
no you should put this part of code into

main menu -> Operator -> VB Script Editor window

an test the code wirh the green >|| button,
without running any M6 T someting in MDI

Code: [Select]
Function CW()'Rotation CW
   Dim x As Integer
   Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
   CTPos=0

CWPos = 2

   ActivateSignal(OUTPUT9)'Turns the AC Motor On cw
   Sleep(50)

   For x=0 To CWPos
      While IsActive(INPUT4)'Wait for INPUT4 is off
        Sleep(10)
      Wend
      While Not IsActive(INPUT4)'Wait for INPUT4 is on
        Sleep(10)
      Wend
   Next x
   CTPos=x
   DeactivateSignal(OUTPUT9)

it is only a prticular test of this part of code

712
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 05:17:17 AM »
then put this part of code:

Function CW()'Rotation CW
   Dim x As Integer
   Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
   CTPos=0

CWPos = 2

   ActivateSignal(OUTPUT9)'Turns the AC Motor On cw
   Sleep(50)

   For x=0 To CWPos
      While IsActive(INPUT4)'Wait for INPUT4 is off
        Sleep(10)
      Wend
      While Not IsActive(INPUT4)'Wait for INPUT4 is on
        Sleep(10)
      Wend
   Next x
   CTPos=x
   DeactivateSignal(OUTPUT9)

End Function


into Operator -> VB Script Editor  window  and use the green >|| button to step through code to see what is going on

713
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 05:02:17 AM »
so direction an number of step's where right ?

714
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 04:56:11 AM »
for the next add two msgbox instructions, to see that the right fuction is called, and the right Count is calculated


Function CW()'Rotation CW
   Dim x As Integer
   Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
   CTPos=0

MSGBox "CW Rotation: " &CWPos

   ActivateSignal(OUTPUT9)'Turns the AC Motor On cw
   Sleep(50)

   For x=0 To CWPos
           While IsActive(INPUT4)'Wait for INPUT4 is off
      Sleep(10)
      Wend
           While NOT IsActive(INPUT4)'Wait for INPUT4 is on
      Sleep(10)
      Wend
        Next x
    CTPos=x
   DeactivateSignal(OUTPUT9)

End Function

Function CCW()'Rotation CCW
   Dim y As Integer
   Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
   CTPos=0

MSGBox "CCW Rotation: " &CCWPos


   Activatesignal(OUTPUT9)'atc motor revirsing relay
   ActivateSignal(OUTPUT10)'Turns the AC Motor On
    Sleep(50)
   
     For y=0 To CCWPos
           While IsActive(INPUT4)'Wait for INPUT4 is off
      Sleep(10)
      Wend
           While NOT IsActive(INPUT4)'Wait for INPUT4 is on
      Sleep(10)
      Wend
        Next y
   CTPos=y
   DeactivateSignal(OUTPUT9)
   Deactivatesignal(OUTPUT10)'atc motor revirsing relay
End Function

715
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 04:40:04 AM »
see my last post on page 1

716
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 04:31:48 AM »
sorry seems i going to get bild

Function CW()'Rotation CW
   Dim x As Integer
   Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
   CTPos=0
   ActivateSignal(OUTPUT9)'Turns the AC Motor On cw

   Sleep(50)

   For x=0 To CWPos
           While IsActive(OEMTrig9)'Wait for OEMTrig9 is off
      Sleep(10)
      Wend
           While NOT IsActive(OEMTrig9)'Wait for OEMTrig9 is on
      Sleep(10)
      Wend

            x=x+1
        Next x
this is wrong,not needed, the for next Loop is counting itselv.

717
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 04:24:43 AM »
if you put some Addition MSGBox instruction to your CW Routine you can how often
Input gets triggered

Function CCW()'Rotation CCW
   Dim y As Integer
   Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
   CTPos=0
   Activatesignal(OUTPUT9)'atc motor revirsing relay
   ActivateSignal(OUTPUT10)'Turns the AC Motor On
    Sleep(50)
    
     For y=0 To CCWPos
           While IsActive(OEMTrig9)'Wait for OEMTrig9 is off
      Sleep(10)
      Wend
MSGBox "Input is off"
           While NOT IsActive(OEMTrig9)'Wait for OEMTrig9 is on
      Sleep(10)
      Wend
MSGBox "Input is on"
            y=y+1
        Next y
   CTPos=y
   DeactivateSignal(OUTPUT9)
   Deactivatesignal(OUTPUT10)'atc motor revirsing relay
End Function

718
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 03:50:34 AM »
so why do you not read the Input drectly.
this work 100%, if have used it many times.

for eample

While GetCsmioIn(91,15) = False  
   Sleep(20)
Wend


'CSMIO read input
Public Function GetCsmioIn (ByVal adr As Integer, ByVal n As Integer) As Boolean
   If(GetInBit(adr, n)) Then
      GetCsmioIn = true
   Else
      GetCsmioIn = false
   End If
End Function




here is a links witch Shows the adresses:

http://en.cs-lab.eu/wp-content/uploads/2016/06/csmio-ip-s-konfiguracja-we_wy-artykul.pdf


719
a simple search for "tooltable Import" in the Forum:

http://www.machsupport.com/forum/index.php/topic,27640.0.html

720
VB and the development of wizards / Re: centerpiece full (change)
« on: April 05, 2018, 01:43:43 AM »
Rem VBScript To center probe outside diameter Metric Version
Speak (" psizionarsi CINQUE millimetri sopra il pezzo") 'Avviso Vocale
response = MsgBox ("   5 mm    SOPRA IL PEZZO")

Sleep (1000) ' pausa di 1 secondi
Speak (" CONFERMARE centro pezzo pieno") 'Avviso Vocale
Message "INIZIO CENTRO PEZZO PIENO"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE CENTRO PEZZO PIENO")
 
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentToolDiameter = GetOemDRO(43) 'gets the current tool diameter

If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty

    Call ProbeGrounded()
    Exit Sub

Else

    XCurrent = GetDro(0)
    YCurrent = GetDro(1)
    OutsideDiameter = GetUserDRO(1152)

    Code "G4 P1" 'Pause 1 second to give time to position probe plate
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    Code "F50" 'slow feed rate to 100mm/sec
    Code "G90 G0 X" &XNew + OutsideDiameter * .6
    Code "G91 G0 Z-10"



anyhow this XNew is set nowhere before it is used.