Phidgets - Spatial 3/3/3

Navigation:  Widget Designer > Devices > Phidgets >

Phidgets - Spatial 3/3/3

prev main next

Navigation:  Widget Designer > Devices > Phidgets >

Phidgets - Spatial 3/3/3

prev main next

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

PhidgetSpatial Precision 0/0/3 - P/N 1044_1B (Image licensed by Phidgets under CC BY-NC-ND 3.0)

PhidgetSpatial Precision 0/0/3 - P/N 1044_1B
(Image licensed by Phidgets under CC BY-NC-ND 3.0)

The Spatial 3/3/3 is a sensor family providing an accelerometer, a gyroscope and a compass all in one device.

WD supports the Basic and the Precision model of the USB connected PhidgetSpatial 3/3/3, as well as the VINT connected Spatial Phidget.

 

Additionally, any Spatial 3/3/3 Phidget can be set up as a Spatial 0/0/3 device, if only the acceleration values are needed.

 

 

Adding a New Phidgets Spatial 3/3/3

To add a Phidgets Spatial 3/3/3 device, open the Devices menu and select Phidgets Device > Spatial 3/3/3 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 Spatial 3/3/3 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 Spatial 3/3/3 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 > Phidgets Spatial 3/3/3 Device and can be opened from here or with Devices menu > Configuration.

The Phidgets Spatial 3/3/3 Settings

click to enlargeSelect the Serial number of the connected device from the drop-down. If your device is connected to a Hub, use its serial number respectively.
If the correct serial does not show in the drop-down, make sure that the device (or Hub) 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.
Select an update Interval time according to your needs.

When you are using the compass function of this Phidget, you can perform a magnetic error correction beforehand. Follow the instructions on the product website for calibrating the device and copy/paste the parameters displayed in the text box to the Compass Correction in the WD configuration.

Press Apply to confirm your settings.

After the connection is established, the Value fields will update as soon as a change is registered.

Using the Device in Regular Scripting

After adding a Phidgets Spatial 3/3/3 device, 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_Spatial_3_3_3_1"), Script Assist will offer you a list of all available members.

You can for example enable the device using scripting:
Phidgets__Spatial_3_3_3_1.Enable

You can also read out the minimum acceleration value (in g) which triggers a response of the device:
vdouble = Phidgets_Spatial_3_3_3_1.CompassY

To compensate for the drift that is inherent to all gyroscopes, execute the ZeroGyroscope method:
Phidgets_Spatial_3_3_3_1.ZeroGyroscope

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 X acceleration: " + Phidgets_Spatial_3_3_3_1.AccelerationAxisX + "g"

If you prefer a command structure that distinctly implies the action to be performed, you can use the "Set..." and "Get..." members:
Label5.Text = "Current X acceleration: " + Phidgets_Spatial_3_3_3_1.AccelerationAxisX + "g"

Both approaches can be used interchangeably.

Please keep in mind that some properties are read-only properties, e.g. the measured acceleration values for the three axis, and do not provide a "Set..." member.
Furthermore, the higher-level properties of the device itself, like 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 Spatial 3/3/3 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 Spatial 3/3/3 Events chapter for a list (with examples and description) of the possible events raised by this device type.

Using the Device in the Node System

After creating a Phidgets Spatial 3/3/3 device, you can also use it in the node system as an input node to retrieve acceleration, compass and gyroscope information.

Please see the chapter "Phidgets Spatial 3/3/3 Input" for more information about the node itself or the chapter "Tutorial: Nodes" for information about the node system.