Background
Phidget is a company that provides products for USB Sensing and Control. Phidget specialize in making affordable, easy to use sensors and controllers that require minimal electronics knowledge. Phidget covers vast range of sensors and motors.
Sensors
Motors
Phidget Protocol Handler Flow
TQLEngine provides phidget protocol handler, which is essentially a wrapper over the Phidget Driver that is provided by Phidget. Note that the developers are required to install the phidget driver for different platform (Linux, Windows, Mac) from the phidget website.
Phidget Protocol Handler Parameters
Phidget has a broad range of sensors and motors. The phidget protocol handler provides wrapper implementation for following Device Types. Adding support for additional device types will be provided on a need basis.
Phidget Input Parameter List
Name | Description | How Used? |
---|---|---|
DeviceType | Specify the type of device that requires interaction. Supported values are: PhidgetRFID, PhidgetTextLCD, PhidgetGPS, PhidgetInterfaceKit, PhidgetAdvancedServo | DeviceType is passed as a modifier to Invoke. <Invoke Method="Get" DeviceType="PhidgetInterfaceKit"/> |
SerialNumber | This represents the interface port number to which the sensor or motor is connected. | SerialNumber is passed as a modifier to Invoke |
ServoAngle | Angle to be applied to a Advanced Servo Motor. | ServoAngle is passed as a payload to Invoke wrapped within Message/Value container. <Invoke Method="Post" DeviceType="PhidgetTextLCD"> <Message><Value><ServoAngle>110.0</ServoAngle></Value></Message> </Invoke> |
Simulated | Simulates Sensor Behavior by sending random integer values between 1 and 100 | |
- | Some time if you need to pass a String value to the handler as input - usually in case of RFID Writer or LCD Text Display, you can pass it as part of <Message><Value>Hello</Value></Message> as payload to Invoke. | Payload of <Invoke>. <Invoke Method="Post" DeviceType="PhidgetTextLCD"> <Message><Value>Hello</Value></Message> </Invoke> |
Phidget Output Format
Output from the Phidget Handler is simply a text value.
Special formatted case for GPS Sensors - In case of GPS the output text is aggregated and presented in a single formatted text as below:
Lon:<value>;Lat:<value>;Alt:<Value>;Vel:<Value>;Head:<Value>;Status:<Value> Default Value for Lon, Lat, Alt, Vel, Head is: Unknown Default Value for Status is false
Examples
Running Phidget Handler in Simulated Mode.
<ThingFacet Name="PhidgetSimulatedFacet"> <Integer Name="SimulatedValue" Update="auto" KnownBy="PhidgetSimAction"/> <String Name="DeviceType"/> <String Name="SerialNumber"/> <Action Name="PhidgetSimAction" Documentation="Returns integer values from 1 - 100 in Random order"> <Workflow Limit="1" Live="1" Timeout="-1"> <Task Name="Main" While="True"> <Event Name="Argument" As="ActionArgument"/> <Invoke Name="ReadValue" waitFor="Argument" Get="phid://" SerialNumber="[%:Event.Argument.SerialNumber.Value:%]" DeviceType="[%:Event.Argument.DeviceType.Value:%]" Simulated="true"/> <Output Name="Result" As="ActionResult"> <Value> <SimulatedValue>[%:[%:@Output:%]Invoke.ReadValue.Message.Value:%]</SimulatedValue> </Value> </Output> </Task> </Workflow> </Action> </ThingFacet>
Driver Installation Steps
Installing Phidget Driver
Linux: - To install Phidget libraries on your Linux system, the following steps must be performed.
- Install libusb-1.0 development libraries (libusb-1.0-0-dev). This libraries can be installed from the source (http://www.libusb.org/) or if you are running a debian based system you can simply run the command shown below
sudo apt-get install libusb-1.0-0-dev
- Download Phidget Libraries from this location
http://www.phidgets.com/downloads/libraries/libphidget.tar.gz
- Unpack the downloaded libraries using the command
tar -xzvf libphidget_2.X.X.XXXXXXXX.tar.gz
- Then run the following commands to install Phidget libraries
cd libphidget-2.X.X.XXXXXXXX/ sudo ./configure sudo make sudo make install
Note: - For additional information and troubleshooting visit the following website
(http://www.phidgets.com/docs/OS_-_Linux)