for example, you can have a UserDRO be your counting storage place, or a param. You can put this in the Macropump without a while statement
since it loops automatically for you. If you want it in a stand alone macro, then put the while in it.
'when LED 2000 is ON, it does not count (you can control the LED2000 via brains, a screen button, or hotkey).
''when LED 2000 is OFF, it does NOT count, and it resets your counter to "0"
counter = GetUserDRO(1500)
If Not GetUserLED(2000) then
If IsActive(INPUT1) then
counter = (counter + 1)
SetUserDRO(1500, counter)
'your code here........................
End If
End If
If GetUserLED(2000) then
SetUserDRO(1500, 0)
'your code here........................
End If
'scott