Hello Guest it is December 26, 2024, 07:13:06 AM

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

0 Members and 1 Guest are viewing this topic.

Re: System wait macro function help
« Reply #20 on: February 03, 2020, 06:07:14 AM »
I also try to make just half of macro working, but the same all the time.

If I can get this Half macro working then I would also manage first part of it.
I write all scripts in Mach3 VBscript editor, and for that one, when I press play button, it just plays whole macro, without waiting on GetInBit for signal.
Re: System wait macro function help
« Reply #21 on: February 03, 2020, 06:10:09 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 


This one Works at least in VB script editor. I'll Test it on machine in few hours and let you know result.

Thank you
Re: System wait macro function help
« Reply #22 on: February 03, 2020, 09:32: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 


This one Works at least in VB script editor. I'll Test it on machine in few hours and let you know result.

Thank you

Well, this is working, but there must be no Sleep in middle of Whille and Wend. Like this:
 While Not(GetInBit(91,1))
              Wend

But Unfortunately this didn't solve my problem. Still some times don't get input. Led on CSMIO controller illuminates, but looks like in program doesn't detect it. I also try different inputs, but always the same result.
It really is frustrating. Whole retrofit end up terrific, machine is working great, but without bar feeder is useless.

Do you have any clue what could be the cause of that problem?


Offline TPS

*
  •  2,539 2,539
Re: System wait macro function help
« Reply #23 on: February 04, 2020, 01:34:51 AM »
do you mean macro will not wait until Input is on, or does the macro not goin Forward after Input is on?
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 #24 on: February 11, 2020, 06:37:14 AM »
Problem solved.

I was running .066 version of Mach3 and then TPS member suggested to try with .062 version. Well since then no problem. Looks like older version solve my problem.

Thank you

Best regards

Gasper