Code: Selecteer alles
Sub Main
If GetOEMLED(1000) Then ' is run
If IsActive(INPUT1)And (GetLed(116) = true) Then
DoOemButton(1004) ' 1004 DoOemButton stop
End If
End If
End Sub
Moderator: Moderators
Code: Selecteer alles
Sub Main
If GetOEMLED(1000) Then ' is run
If IsActive(INPUT1)And (GetLed(116) = true) Then
DoOemButton(1004) ' 1004 DoOemButton stop
End If
End If
End Sub
En jij zet het geheel tussen haakjes.... misschien zit daar de clou?
Ja , dat klopt.
Je wilt even naar de programmers manual kijken waar je voor programmeert dat verschilt per taal en toepassing.
IsActive
Function IsActive(Signal As Integer) As Boolean
This function returns a Boolean True if the current state of the specified input signal is its active state. Note that in terms of actual signal level, the term “active” depends on how the signal is defined. If the signal is defined in Config->Ports&Pins->InputSignals as ActiveLow, then IsActive() will return True when that signal is being driven to a logic low. If the signal is defined in Config->Ports&Pins->InputSignals as ActiveHigh, then IsActive() will return True when that signal is being driven to a logic high.
Arguments:
Signal is an integer value corresponding to one of pre-defined input signal constants.
Return Value:
False indicates the signal is currently in its inactive state True indicates the signal is currently in its active state
Example:
‘ Show the user the state of the INPUT #1 input
If IsActive(INPUT1) Then
Message “INPUT #1 input is active” Else
Message “INPUT #1 input is inactive”
Maar als ik jou was zou ik eerst alle drie de logische delen eerst testen met een "debug" message.The use of GetLED is no longer recommended practice and this function exists only to support preexisting legacy scripts. This function is deprecated, and its use is strongly discouraged.