Phidgets - Digital Input

Navigation:  Widget Designer > Devices > Phidgets >

Phidgets - Digital Input

prev main next

Navigation:  Widget Designer > Devices > Phidgets >

Phidgets - Digital Input

prev main next

Please wait. Due to its content this page might take a while to load...

Example: 4x Digital Input Phidget - P/N DAQ1200_0 (Image licensed by Phidgets under CC BY-NC-ND 3.0)

Example: 4x Digital Input Phidget - P/N DAQ1200_0
(Image licensed by Phidgets under CC BY-NC-ND 3.0)

A Phidgets Digital Input connects to a digital input (e.g. of an InterfaceKit) or VINT Hub port.

 

The depicted 4x Digital Input Phidget for example can be connected to a VINT Hub.

 

Note that all Phidget devices are only available in the licensed Widget Designer edition, not the Free version.

Adding a New Phidgets Digital Input

To add a Phidgets Digital Input device, open the Devices menu and select Phidgets Device > Digital Input Device. This opens the Configuration dialog. Alternatively, you can add a new device in the Configuration dialog with the "+" button.

On the right side, you can name, dis-/enable the device or configure it as explained in the next paragraph.

The name is the unique identifier for this Phidgets Digital Input object in WD and the general rules for naming objects apply here as well (only letters, numbers and underscore are allowed, the first symbol must be a letter).
If you like, you can change the default name to a more descriptive one. When scripting, enter the name to access available members as described further down.

The "Enable" check box is ticked per default. On the left side, you should see that the icon in front of your Phidgets Digital Input is a filled blue circle. An empty blue circle indicates an enabled device which is not connected. A filled gray circle indicates a disabled device.

You can close the dialog at any time. The newly created device will also be added to the Devices menu > Phidgets Device > Digital Input Device and can be opened from here or with Devices menu > Configuration.

The Phidgets Digital Input Settings

click to enlargeSelect the Serial number of the connected device from the drop-down. If your device is connected to a Hub or InterfaceKit, use their serial number respectively.
If the correct serial does not show in the drop-down, make sure that the device (or Hub or InterfaceKit) is shown in the Phidget Control Panel.
To access devices connected via the Network Server feature, you need to add the respective Phidgets Server device first.

Fill out Hub Port, Channel and Is Hub Port Device according to the Phidget Addressing Information dialog.
The current State is indicated by a circle, blue for "on", gray means "off".
If you want to execute special scripts every time when the input state changes, you can enter the commands in the SwitchedToOn and SwitchedToOff fields.
 
Press Apply to confirm your settings.

Using the Device in Regular Scripting

After adding a Phidgets Digital Input, you can also use it via scripting which allows to perform actions on the device as well as retrieve information from it.

To send commands to the device, first create a CustomScript button or use the Macro editor or anything else with a scripting field. If you enter the device's identifier name into the script field (per default that is e.g. "Phidgets_DigitalInput1"), Script Assist will offer you a list of all available members.

You can for example disable the device:
Phidgets_DigitalInput1.Disable

You can also retrieve specific values via scripting in the same way as from other widgets:
vbool = Phidgets_DigitalInput1.DeviceSerial

The scripting structure for Phidgets provides two different approaches for setting and retrieving values.
If you are already familiar with the object-based notation and using properties, all device properties can be used like any other object property you have already encountered:
Label5.Text = "Current Input State: " + Phidgets_DigitalInput1.State

If you prefer a command structure that distinctly implies the action to be performed, you can use the "Get..." member:
Label5.Text = "Current Input State: " + Phidgets_DigitalInput1.GetState

Please keep in mind that some read-only properties, such as the "State". Its value can only be retrieved but not set.

For a list with all available members and commands with examples and descriptions, please refer to the chapter Phidgets Digital Input Members.

Using the Device with Event Listeners

Event Listeners can be added to the Configuration dialog and provide a simple way of listening to triggers from connected devices.

Please see the chapter Event Listener for a detailed description of its functionality and the Phidgets Digital Input Events chapter for a list (with examples and description) of the possible events raised by this device type.