The user can monitor digital inputs with the GetDigitalInputBit and GetDigitalInputState macro commands. These commands are accessable in the Macro edit pop-up window in LabChart Functions under the PowerLab group.
- GetDigitalInputBit returns a value of "1" if a digital bit input is present or a value of "0" if the digital bit input bit is not present.
- GetDigitalInputState returns the digital input connector's current bit pattern (also known as a 'byte') or a value of "0" if the digital input is not present.
For example, the following Macro text assigns digital input 1's current state to the variable "docGetDigitalInputBit" and outputs it in a pop-up message box:
Sub Macro ()
docGetDigitalInputBit = Doc.GetDigitalInputBit (1)
Call MsgBox (docgetdigitalinputbit, vbExclamation + vbOKOnly, "LabChart")
End Sub