706
« on: December 02, 2020, 09:34:08 AM »
code for macropump would be something like this:
'------------------------------------------------------------------------------------------------------------
Private Declare Function GetTickCount Lib "kernel32" () As Long
'------------------------------------------------------------------------------------------------------------
Const LastMsDRO = 1300 'DRO for data
Dim CurrentMs As Long
Dim LastMs As Long
'------------------------------------------------------------------------------------------------------------
Const BlowTime = 1000 'Blowing Time
Sub Main
'Read data
'-------------------------------------------------------
CurrentMs = GetTickCount()
LastMs = GetUserDRO(LastMsDRO)
If(CurrentMs < LastMs) Then
LastMs = CurrentMs
End If
'check OEMLED to activate
If GetUserLed(1300) = True Then
SetUserLed(1300,0)
ActivateSignal(OUTPUT2)
LastMs = CurrentMs
End If
If(CurrentMs > (LastMs + BlowTime)) Then
DeactivateSignal(OUTPUT2)
End If
'save Data
'-------------------------------------------------------
SetUserDRO(LastMsDRO, LastMs)
End Sub
code for activation macro would be this:
SetUserLed(1300,1)