I'm using object to access the value of control in the panel,
the code I used is list as below:
Code: Select all
Sub test()
Dim MyIpf, MyCtrl
set MyIpf = Documents("MyIpfFileName.ipf").ActiveWindow.Object
Set MyCtrl = MyIpf.Scenes(1).Controls("Button1")
msgbox "MyCtrl = " & MyCtrl.Value
End Sub
CASE-1. When "myControl" is a "Value Edit Control" which is bounded to a numeric CAN signal, the value can be returned by myCtrl.Value
CASE-2. When "myControl" is a "Value Edit Control" which is bounded to a Enum attribution CAN signal, it will return the Enum string when using "myCtrl.Value"
CASE-3. When "myControl" is a "Button Control" or "ToggleSwitch control", the marco file(.pem) can be built, but it returns an error message while running.
My questions are: ,
1. how do I get the Enum value(1,2...n) in CASE-2 ?
2. how to read the toggle switch and/or button status in CASE-3 (ex: 0 = Off and 1 = On)?
3. where can I find the doc/help which describes the properties and method of each controls/indications in instrument panel?
Thanks!