Hello Guest it is March 04, 2021, 11:22:09 AM

Author Topic: System wait macro function help  (Read 1064 times)

0 Members and 1 Guest are viewing this topic.

Online TPS

*
  •  2,015 2,015
    • View Profile
Re: System wait macro function help
« Reply #10 on: January 31, 2020, 08:05:36 AM »
it is GetInBit(x,y) for sure, i have used this in my own macros.

can you see the Input Led on the fron of the Controller comming on?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Online TPS

*
  •  2,015 2,015
    • View Profile
Re: System wait macro function help
« Reply #11 on: January 31, 2020, 08:17:10 AM »
btw i see you are using a csmio/a

there is no Input 90,16 if you are using Input16 it will be 91,0
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: System wait macro function help
« Reply #12 on: January 31, 2020, 10:54:28 AM »
btw i see you are using a csmio/a

there is no Input 90,16 if you are using Input16 it will be 91,0

You where right. Input is 91,0 for 16 and 91,1 for 17.    But the problem is that, when it comes to If GetInBit(90,17) = False Then,   it does not wait here till it is active.  It goes further to other lines all the way to the end of macro.  Can I use GetIn bit with While Not IsActive command?

Signal is coming to machine, I also have LEDS os screen to see them
         
« Last Edit: January 31, 2020, 10:59:13 AM by BGelektronika »
Re: System wait macro function help
« Reply #13 on: January 31, 2020, 11:12:23 AM »
For reference, attached is my working macro.  But Instead of LEDs and inputs I would like to use CSMIO inputs directly as sometimes happens that don't detect input signal 2, even so led on CSMIO input comes on.  This could end up catastrophically.

Online TPS

*
  •  2,015 2,015
    • View Profile
Re: System wait macro function help
« Reply #14 on: January 31, 2020, 01:45:59 PM »
... But the problem is that, when it comes to If GetInBit(90,17) = False Then,   it does not wait here ...         

that is the Problem i tryed to explain ....GetInBit(90,17) will not work it has to be GetInBit(91,1)
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: System wait macro function help
« Reply #15 on: January 31, 2020, 02:12:42 PM »
... But the problem is that, when it comes to If GetInBit(90,17) = False Then,   it does not wait here ...         

that is the Problem i tryed to explain ....GetInBit(90,17) will not work it has to be GetInBit(91,1)

Yes I understand, and I test with GetInBit(91,1), but when it come to this line it doesnt stay here till this imput get active.
Is it possible that lines not in right order?  I mean where line starts?
-if
   -
       -
              -    ?
Or
-
-
-
-
-?

Online TPS

*
  •  2,015 2,015
    • View Profile
Re: System wait macro function help
« Reply #16 on: February 01, 2020, 02:46:41 AM »
can you please post the actual macro you are testing with?
and witch Input led is coming on at the Controller?
if you look on CSMIO webside for macro examples they are using also the GetInBit like me on all my three machines.
so the Problem must be somewhere else.

BTW, if you copy and paste your code into Operator -> VB Script Editor Window and use the >|| button you can step through your
code and see where it goes.
« Last Edit: February 01, 2020, 02:51:09 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: System wait macro function help
« Reply #17 on: February 03, 2020, 05:58:07 AM »
can you please post the actual macro you are testing with?
and witch Input led is coming on at the Controller?
if you look on CSMIO webside for macro examples they are using also the GetInBit like me on all my three machines.
so the Problem must be somewhere else.

BTW, if you copy and paste your code into Operator -> VB Script Editor Window and use the >|| button you can step through your
code and see where it goes.

Attache are two Macros. First with Input, and second with GetInBit. With input 2 is working 100% but like I said, it It happens that sometimes don't detect input 2 signal , even so led 17 on CSMIO input comes on.
When I change from  While Not IsActive(input2)  to If GetInBit(91,1), it is not wait on that line till it get signal from csimo /ip-s input 17, but it just go forward to other line till the end.

Thank you so much for helping me...
Re: System wait macro function help
« Reply #18 on: February 03, 2020, 05:59:01 AM »
Attachments

Online TPS

*
  •  2,015 2,015
    • View Profile
Re: System wait macro function help
« Reply #19 on: February 03, 2020, 06:05:13 AM »
Sorry my fault.

code corrected:
Code: [Select]
If GetOemLED(821) Then      'Bar end signal
Code "G0 G54 Z110"
ResetOutBit(90,11)  'Collet close reset
SetOutBit(90,9)     'Collet Open
        SetOutBit(90,6)     'Collet Open
        SetUserLed(1001,1)  'Set Collet open LED ON
        While Not(GetInBit(91,1))    'Wait for Start signal from Bar fedder
                Sleep(100)
        Wend       

                Code "G0 G54 Z-35"
                Sleep 1000
                If GetInBit(91,1) = 0 Then     'Wait for Start signal from Bar fedder
                Sleep(100)
                End If       

                ResetOutBit(90,9)   'Reset Collet Open
                ResetOutBit(90,6)   'Reset Collet Open
                SetOutBit(90,11)    'Collet Close
                Sleep 100
                SetUserLed(1001,0)  'Set Collet open LED OFF
                Sleep 2000
       
               
Else
ResetOutBit(90,11)  'Collet close reset
sleep 100
SetOutBit(90,9)     'Collet Open
        SetOutBit(90,6)     'Collet Open
        SetUserLed(1001,1)  'Set Collet open LED ON
        While Not(GetInBit(91,1)) 'Wait for Start signal from Bar fedder
                Sleep(100)
        Wend       
        ResetOutBit(90,9)   'Reset Collet Open
        ResetOutBit(90,6)   'Reset Collet Open
        SetOutBit(90,11)    'Collet Close
        sleep 100
        SetUserLed(1001,0)  'Set Collet open LED OFF
        Sleep 2000

End If 

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.