Phidgets - InterfaceKits

Navigation:  Widget Designer > Devices > Phidgets >

Phidgets - InterfaceKits

prev main next

Navigation:  Widget Designer > Devices > Phidgets >

Phidgets - InterfaceKits

prev main next

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

Example: Interface Kit 8/8/8 - P/N 1018_2 (Image licensed by Phidgets under CC BY-NC-ND 3.0)

Example: Interface Kit 8/8/8 - P/N 1018_2
(Image licensed by Phidgets under CC BY-NC-ND 3.0)

Phidgets InterfaceKits provide Digital Inputs, Digital Outputs and Voltage Channels (Analog Inputs) in varying numbers.

WD currently has three InterfaceKits natively implemented:
- InterfaceKit 8/8/8
- InterfaceKit 0/16/16
- InterfaceKit 0/0/4

 

If you would like to use other InterfaceKits, you can still add each In- or Output individually as single Digital Inputs, Digital Outputs, Voltage Inputs, or Voltage Ratio Inputs.
Keep in mind to enter the respective in- or output number as Channel parameter.

Adding a New Phidgets InterfaceKit

To add a Phidgets InterfaceKit device, open the Devices menu and select Phidgets Device > InterfaceKit X/X/X 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 InterfaceKit 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 InterfaceKit is a filled blue circle. An empty blue circle indicates an enabled device which is not connected. An empty 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 > InterfaceKit X/X/X Device and can be opened from here or with Devices menu > Configuration.

The Phidgets InterfaceKit Settings

click to enlargeSelect the Serial number of the connected device from the drop-down.
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.

Depending device connected, you also have access to the Digital Outputs, Digital Inputs and / or Voltage Channel configuration.

click to enlarge
Digital Outputs:
The On / Off button can be used to manually set the on / off state of all digital output channels. A blue circle indicates that the current state is on, gray means off.
This option is available for all three implemented InterfaceKits, the number depends on the model used.

click to enlargeDigital Inputs:

The current State of each digital input channel is indicated by a circle, blue for "on", gray means "off".
If you want to execute special scripts every time when the input state of a channel changes, you can enter the commands in the SwitchedToOn and SwitchedToOff fields.

This option is only available for the InterfaceKits 8/8/8 and 0/16/16, the number depends on the model used.

click to enlargeVoltage Channels:
Select the product number of the each connected sensor from the Sensor Type drop-down.
You can also adjust update Interval time and a Trigger value (for sensitivity) according to your needs for every single channel.

After the settings are applied, the Current Value field will update as soon as a change was registered on each channel and also display the correct value units.

This option is only available for the InterfaceKit 8/8/8.

Press Apply to confirm your settings.

Using the Device in Regular Scripting

After adding a Phidgets InterfaceKit, 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_InterfaceKit_8_8_8_1"), Script Assist will offer you a list of all available members.

You can for example set the digital output with ID 3 to its "on" state:
Phidgets_InterfaceKit_8_8_8_1.SetOutputState(3,True)

You can also retrieve specific values via scripting in the same way as from other widgets:
vint = Phidgets_InterfaceKit_8_8_8_1.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:
Phidgets_InterfaceKit_8_8_8_1.Output3.State = True
Label5.Text = "Output 3 Current State: " + Phidgets_InterfaceKit_8_8_8_1.Output3.State

If you prefer a command structure that distinctly implies the action to be performed, you can use the "Set..." and "Get..." members:
Phidgets_InterfaceKit_8_8_8_1.Output3.SetState(True)
Label5.Text = "Output 3 Current State: " + Phidgets_Phidgets_InterfaceKit_8_8_8_1.Output3.GetState

Both approaches can be used interchangeably.

Please keep in mind that some properties are read-only properties, e.g. "Input.State" or "Voltage.Value", and do not provide a "Set..." member.
Furthermore, the higher-level properties of the device itself, like the Serial number or the Enabled state, need to be scripted as properties and do not provide the "Set..." and "Get..." members.

For a list with all available members and commands with examples and descriptions, please refer to the chapter Phidgets InterfaceKits 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 InterfaceKits Events chapter for a list (with examples and description) of the possible events raised by this device type.