Hello,
I need to check a boolean signal then switching another. I use for this purpose VBA macro, but the result while is not present. How to start macro VBA with the function "Execute VBA macro"?
Public Sub SELECT_ALARM(obElem As Element)
MsgBox "Hello"
Set zVAR = thisProject.Variables.Item(obElem.ItemVariable(var0).Name)
s_var_close = Left(z_var.Name, InStr(1, z_var.Name, ".") - 1) + ".Close"
s_cmd = Left(z_var.Name, InStr(1, z_var.Name, ".") - 1) + ".Cmd"
s_var_open = z_var.Name
If (thisProject.Variables.Item(s_var_open).Value = 0 And thisProject.Variables.Item(s_var_close).Value = 0) Or (thisProject.Variables.Item(s_var_open).Value = 1 And thisProject.Variables.Item(s_var_close).Value = 1) Then
thisProject.Variables.Item(s_cmd).Value = 1
Else
thisProject.Variables.Item(s_cmd).Value = 0
End If
End Sub
This is a migrated post! Originally posted on 24.11.2009 by user captain. Please be aware that information can be outdated.