Hello Guest it is June 16, 2021, 01:16:55 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 - TPS

1481
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 06:16:34 AM »
the modify

For x=0 To CWPos -1

For y=0 To CCWPos -1

1482
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

1483
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

1484
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 ?

1485
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

1486
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

1487
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.

1488
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

1489
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


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

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