Bridge for Phidgets 4.0.1 Syntax

Syntax revision: 20, 2022-12-05.

Known limitations

Hosting friendly functionality

In order for plugin function to work on the server you have to create a config file on server and set the read permission to everyone:

Toolbox pluginBridge For ArduinoBridge For Phidgets functions won't work on server in these cases:

NOTE: If file 24uPluginsAllowedFunctions.txt doesn't exist -> all functions are enabled.

Format of 24uPluginsAllowedFunctions.txt file

Every line represent one database, first is the name of the database followed by tabulator and then function names separated by '|' (vertical bar).
Or name of the database followed by tabulator and then the word "any" if you want to allow all the plugin functions. You can find template of 24uPluginsAllowedFunctions.txt in Examples.

Example

In following example:

Registered Custom Script Steps

Registered Calculation Functions

Complete syntax of plugin functions

Supported Devices

You can find all the supported devices in file SupportedDevices.html

Phidget_Version ( { versionFormat } )

Returns version string of the active 24U Phidgets Plug-In, formatted as requested by the parameter.

Parameters

versionFormatDefines the format of the returned version.

Parameter values for versionFormat

"short"To get just the version number
"long"To get the plug-in name followed by its version number
"platform"To get the platform of the code currently running
"autoupdate"To get autoupdate compatible (comparable) version number.
"phidgetlib"To get the version of Phidget library

Examples

Phidget_Version("phidgetlib")
This will return for example: "Phidget22 - Version 1.3 - Built May 24 2019 10:38:17"

Phidget_Register(selector)

Provides special functionality to operate with plugin serial numbers.
Also available as a custom script step.

Parameters

selectorDefine the type of operation.

Parameter values for selector

SerialNumberRegister given SerialNumber and return an error code.
EmailAddressTries to activate with given email address and return an error code. Not supported in iOS version and will return error -4 Not implemented.
Hash Activate a serial number with a hash received from 24U. Used for offline activation.
"Registration window"Show the "Registration window" and return 0. Not supported in iOS version and will return error -4 Not implemented.
"About window"Show the "About window" and return 0. Not supported in iOS version and will return error -4 Not implemented.
"Status"Return the actual registration state of the plugin: Demo, Demo expired, Trial, Trial Expired, Registered or Dead.
"Unregister"Unregister all serial numbers related to the product and return an error code.
"ActivationChallenge" Returns generated challenge string. This string is sent to 24U.

Description

Use this function to register or unregister 24U Phidgets Plug-In, to get information about current registration state, or to invoke GUI providing basic registration information and purchase capabilities.

Result

Returns zero or error code depending on the selector.

Examples

Phidget_Register( "address@example.com" )
This will send email on address@example.com for confirmation, if you confirm than you will get trial version on this product verified by this email.

Phidget_Register( "PHD40C666-4B7B-37PH-Q2E6-1UKY" )
This will register this product with key: "PHD40C666-4B7B-37PH-Q2E6-1UKY".

Phidget_Register( "Unregister" )
This will remove all registered keys. After this call product is no longer registered.

Phidget_Read ( device ; valueID { ; index ; { extra } } )

Reads data from the Phidget.

Parameters

deviceIdentification of device
valueIDSpecifies which data should be read.
indexDefault to 0. Index of the port of IO Phidget or another index information if needed
extraSpecifies some options for specific Phidget type.

Parameter values for valueID

valueIDPhidget typeDescription
"inputValue" GeneralReturns value of the default input
"inputState" Interface KitReturns the value of the digital input
"sensorValue" Interface KitReturns the value of the analog input or value of a supported VINT sensor
"sensorRawValue"Interface KitReturns the raw value of the analog input
"outputState" Interface KitReturns the value of the analog output
"outputState" RFIDReturns the state of the designated digital output
"tag"RFIDReads the RFID tag value. Note: before reading antenna on device has to be on. See Phidget_Set.
Warning: 24U Phidget Plug-In 1.x compatibility mode is no longer available. If you still maintain tag values that used to be returned by the old version, you may have to re-read the tags before upgrading to this version.
"motorPosition" ServoReads the position of the motor
"bridgeValue" BridgeReads the value of port (port has to be enabled)
"voltage"AnalogReads voltage level on port of Phidget Analog

Parameter values for extra

extraPhidget typeDescription
"autoDetect" RFID Use this flag to autodetect the tag protocol from the tag. Without this flag, the first 5 characters of the tag content is converted into 10 character long string to ensure backward compatibility with solutions created for plug-in version 1.x.
Note: all new solutions are recommended to use this flag.

Description

The "General" Phidget Type can be used with all Phidgets. The default input for all Phidgets is the first valueID for each phidget in this list. For example calling Phidget_Read( -1 ; "inputValue" ) is the same as Phidget_Read( -1 ; "motorPosition" ) for PhidgetServo.

Result

Function returns data from Phidget if everything is OK. In case of error the function returns "?". You can use Phidget_Get("lastError") for more detailed error description.

Examples

Phidget_Read(-1 ; "inputValue")
The most basic reading. This command will read an "inputValue" from a connected Phidget. If more than one device is connected the plug-in will choose the first device which was connected.

Phidget_Read(335882 ; "sensorValue" ; 3)
Reads a value from the fourth sensor of the InterfaceKit. If the field device does not contain correct serial number of the the Interface Kit Phidget (which must be connected in the time of reading) than the function will fail and returns "?".

Phidget_Read("335882:3"; "bridgeValue" ; 1)
Reads value from port 1 on Phidget Bridge with Phidget serial number 335882 connected to 3rd VINT port. If the port is disabled or any other error occured than the function will fail and returns "?".

Phidget_Read(335882 ; "tag")
Reads tag value from Phidget RFID.

Phidget_Read(335882 ; "tag")
Assume, that tag contains value "hello world!" using protocol PHIDGET. Because "autoDetect" is not used, output value is converted to "68656c6c6f".

Phidget_Read(335882 ; "tag" ; 0 ; "autoDetect")
Assume, that tag contains value "hello world!" using protocol PHIDGET. This returns "hello world!".

Phidget_Write( device ; valueID ; data { ; index { ; tagProtocol { ; tagLocking } } } )

Data to the Phidget are written or set.
Also available as a custom script step.

Parameters

deviceIdentification of device
valueIDSpecifies which data should be written
dataData to write or set. Please use FileMaker number type for numbers and text for strings. The plug-in will try to convert them if necessary.
indexDefault to 0. Index of the port of IO Phidget or another index information if needed.
tagProtocolDefault to PHIDGETS. See tag protocols for more information.
tagLockingCan be "lock" or empty string. In case of "lock" read/write tag will be locked and cannot be rewritten in the future. Default value is "".
This is a one way process. Locked tag cannot be unlocked

Parameter values for valueID

valueIDPhidget typeDescription
"outputState" GeneralWrite value to default output
"outputState" Interface KitWrite data to digital output
"outputState" RFIDNew value to the output is written
"tag" RFIDNew tag is written. Note: antenna has to be turned on before reading. See Phidget_Set.
"motorPosition" Servo and StepperSets the new motor position
"displayString"TextLCDNew text to LCD is written on the first row
"voltage"AnalogAllows to set voltage level of given port. Don't forget to enable port in order to make it work.

Description

The "General" valueIDs can be used with all sensors. The default output for all Phidgets is the first valueID for each Phidget in this list. For example calling Phidget_Write( -1 ; "outputState" ; 20 ) is the same as Phidget_Write( -1 ; "motorPosition" ; 20 ) for PhidgetServo.

Result

Function returns 0 if everything is OK. In case of error the function returns "?". You can use Phidget_Get("lastError") for more detailed error description.

Examples

Phidget_Write(-1 ; "outputState" ; 20)
This will write a value "20" to the first connected phidget if it is possible.

Phidget_Write( Device ; "motorPosition" ; 215)
It rotates the servo in PhidgetServo to 215 degrees. Device parameter should contain a valid serial number of connected servo phidget.

Phidget_Write( 69418 ; "outputState" ; 1 ; 5)
Sets the sixth output of the interface kit phidget with serial number 69418 to 1.

Phidget_Write( 335882 ; "tag" ; "Your text." )
New tag is written. Used tag protocol: PHIDGETS (See tag protocols for more information.)

Phidget_Write( Device ; "tag" ; "999123456789012"; 0 ; "ISO11785_FDX_B" )
New tag is written. Used tag protocol: ISO11785_FDX_B (See tag protocols for more information.)

Phidget_Write( Device ; "tag" ; "123456789a"; 0 ; "EM4100" )
New tag is written. Used tag protocol: EM4100 (See tag protocols for more information.)

Phidget_Write( Device ; "displayString" ; "Hello World!"; 0)
New text is written on the first row. Note: Rows are indexed from zero. If text is not visible, please check backlight, brightness and contrast.

Phidget_Write( Device ; "displayString" ; "special chars: "& char(224) & char(225) & char(226) & char(227) ; 1)
Special characters on the first row are written. More about special characters can be found here.

Phidget_Write( Device ; "outputState" ; 2,6 ; 1)
Set output voltage to 2,6V on port 1 (assuming this port is enabled).

Phidget_SetScriptEvent( device ; event/time ; scriptName { ; index { ; changeAmount { ; threshold } } } )

Tell the plug-in to launch the script when specified event is triggered by the Phidget or in specified time intervals. This functionality is not implemented for FileMaker Server.
Also available as a custom script step.

Parameters

deviceIdentification of device
eventThe event when the script should be triggered. Use FileMaker text to describe it. I.e. "onSensorChange".
timeThe time interval on which the script should trigger. Use FileMaker number i.e. 1.8. Time is in [s]. Time must be a positive number. Setting time lower than 1 s is not recommended.
scriptNameThe name of script which should be triggered. The script will receive a parameter which will contain at least Device on the first row. More values can be added depending on the event.
indexThe index of analog input or output to trigger the script. The script will be triggered only if the value will exceed changeAmount. If omitted the script will be triggered every time when any of inputs/outputs are changed regardless of its number.
changeAmountThe amount of change that should exist between the last reported value and the current value before an event triggers. The default is 1. This cannot be changed for binary inputs or outputs. Use FileMaker number. Param changeAmount can be used only on onSensorChange event, it is ignored on other events.
thresholdThe script will not be triggered until the sensor value exceeds threshold. Use it as a simple noise filter. It has no meaning for binary inputs/outputs. The default value is 0 - no filtering.

Parameter values for event

eventPhidget typeDescriptionScript is given parameters (return-delimited):
"onAttach" GeneralRun the script when some phidget is attached. Device must be set to "all". device
"onDetach" GeneralRun the script when some phidget is detached. Device must be set to "all". device
"onInputChange"GeneralRun the script when default input is changed device index value
"onInputChange"Interface KitRun the script when digital input is changed device index value
"onSensorChange"Interface KitRun the script when the value from connected sensor or VINT sensor is changed. The amount can be set by the changeAmount. device index value
"onOutputChange"Interface KitRun the script when output is changed device index value
"onTag" RFIDRun the script when a tag approaches RFID sensor device index tagBackwardCompatibleString tagValueString
"onTagLost" RFIDRun the script when a the sensor losts the connection with a tag device index tagBackwardCompatibleString tagValueString
"onOutputChange"RFIDRun the script when output is changed device index value
"onMotorPosChange"Servo and StepperRun the script when the motor position is changed device index value
"onBridgeData" BridgeRun the script when dataRate time has passed device
"onStepperStop" StepperRun the script when stepper motor stops. device index value

Description

Some events are the same for more Phidgets. The "General" event "onInputChange" can be installed to all listed Phidgets and it will behave as their default input event. For example: Phidget_SetScriptEvent( -1 ; "onInputChange" ; "Do Something" ) has the same meaning as Phidget_SetScriptEvent( -1 ; "onMotorPosChange" ; "Do Something" ) for PhidgetServo or Phidget_SetScriptEvent( -1 ; "onTag" ; "Do Something" ) for PhidgetRFID. If "onInputChange" is used, the phidget type is detected automatically and the event is installed to it.
Param changeAmount can be used only on onSensorChange event. On other events it is ignored.

In both cases (event/time) the script will receive a parameter containing the value list with device, inputIndex and inputValue. Values for digital input can be "0" or "1" for analog it varies by the type of the event.

To remove event call Phidget_SetScriptEvent( device ; event/time ; "" ).
To remove all events from some phidget call Phidget_SetScriptEvent( device ; "" ; "" ).
To remove all events from all Phidgets call Phidget_SetScriptEvent( "" ; "" ; "" ) or Phidget_SetScriptEvent( "all" ; "" ; "" ).

Result

Function returns 0 if event is successfully installed or uninstalled. In case of error the function returns "?". You can use Phidget_Get("lastError") for more detailed error description.

Examples

Phidget_SetScriptEvent(-1 ; 1.2 ; "Default Script")
This will install the script named "Default Script" to the first available connected phidget. The script will run every 1.2 second and it will obtain a parameter which consist of serial number, "0" and input value. Each on new line. The "0" signals that the input on index 0 is beeing read.

Phidget_SetScriptEvent(device ; "onTag" ; "Process new tag")
The script "Process new tag" will be triggered every time the new RFID tag is in the vicinity of the RFID phidget. The script will receive a parameter with phidget serial number, "0" and RFID value of the tag. Each on the new line. The zero means, that the first input of RFID phidget is used.

Phidget_SetScriptEvent(69418 ; "onSensorChange" ; "Read sensor" ; 6 ; 10 ; 5)
This will install "onSensorChange" event to the interface kit phidget with serial number 69418. The phidget must be connected. The "Read sensor" script will be triggered when the seventh sensor's value on the interface kit phidget with SN 69418 will change more than 10 points and will be higher than 5. The script will receive the parameter which will contain: "69418", "6" and sensor value. Each on the new line.

Phidget_SetScriptEvent("all" ; "onAttach" ; "New phidget attached")
The script "New phidget attached" will be called every time when user will connect a new phidget to the system. The script will receive a parameter with serial number of the new connected phidget.

Phidget_SetServerEvent( login; password; device ; event/time ; eventType ; databaseName ; layoutName ; tableName/scriptName {; fields/params { ; index { ; changeAmount { ; threshold } } } } )

This functionality is implemented for FileMaker Server. Tell the plug-in to write the records into the table or run a script when specified event is triggered by the Phidget or in specified time intervals.
Also available as a custom script step.

Parameters

loginUser name to access server solution (this account has to have rights for accessing dataAPIFileMaker Data API).
passwordPassword to access solution on the master FileMaker Server
deviceIdentification of device.
eventThe event when the data should be written or the script should be triggered. Use FileMaker text to describe it. I.e. "onSensorChange".
timeThe time interval on which the data should be written or the script should trigger. Use FileMaker number i.e. 1.8. Time is in [s]. Time must be a positive number. Setting time lower than 1 s is not recommended.
eventTypeWhat event should be triggerd. Either "data" or "script".
databeseNameThe name of the FileMaker solution which contains the tableName or the scriptName. The script will receive a parameter which will contain Device on the first row, channel on the second, and value on the third.
layoutNameThe name of the layout. The script will receive a parameter which will contain Device on the first row, channel on the second, and value on the third.
tableNameThe name of table where the data will be written.
scriptNameThe name of script which should be triggered. The script will receive a parameter which will be based on "params" parameter.
fieldsFields of the table where data plugin will write data.
paramsString that will be send to script as parameter where key-words: <device>, <channel>, <value> and <timestamp> will be replaced by real device, channel, value and timestamp values.
indexThe index of analog input or output to trigger the script. The data will be written (or script will be triggered) only if the value will exceed changeAmount. If omitted tha data will be will be written (or the script will be triggered) every time when any of inputs/outputs are changed regardless of its number.
changeAmountThe amount of change that should exist between the last reported value and the current value. The default is 1. This cannot be changed for binary inputs or outputs. Use FileMaker number. Param changeAmount can be used only on onSensorChange event, it is ignored on other events.
thresholdThe data will not be written (the script will not be triggered) until the sensor value exceeds threshold. Use it as a simple noise filter. It has no meaning for binary inputs/outputs. The default value is 0 - no filtering.

Parameter values for event

eventPhidget typeDescription
"onInputChange"GeneralStore data (run the script) when default input is changed
"onInputChange"Interface KitStore data (run the script) when digital input is changed
"onSensorChange"Interface KitStore data (run the script) when the value from connected sensor or VINT sensor is changed. The amount can be set by the changeAmount.
"onOutputChange"Interface KitStore data (run the script) when output is changed
"onTag" RFIDStore data (run the script) when a tag approaches RFID sensor
"onTagLost" RFIDStore data (run the script) when a the sensor losts the connection with a tag
"onOutputChange"RFIDStore data (run the script) when output is changed
"onMotorPosChange"Servo and StepperStore data (run the script) when the motor position is changed
"onBridgeData" BridgeStore data (run the script) when dataRate time has passed
"onStepperStop" StepperStore data (run the script) when stepper motor stops.

Parameter values for field

You can choose 1 or more params delimited by ¶.

eventDescription
"deviceField=<device>"The device identification (sn:hubport) will be put into field whose name is "deviceField"deviceField.
"channelField=<channel>"The channel will be put into field whose name is "channelField"channelField.
"valueField=<value>"Value will be put into field whose name is "valueField"valueField
"timestampField=<timestamp>"Date and time when the the event occured will be put into field whose name is "timestampField"timestampField
"eventField=Outside Temperature"Text "Outside Temperature" will be put into "eventField"

Limitations and requirements

Description

When event occures depending on the parameter 'fields' plugin will insert records into the FileMaker table or plugin will try to run the script 'scriptName'. Values for digital input can be "0" or "1" for analog it varies by the type of the event. As mentioned before this function uses FileMaker DataAPI, so it has to be allowed and properly set on the master FileMaker Server. If you run this function on client, nothing happens.

To remove data event call for database MyDatabase Phidget_SetServerEvent("user" ; "password" ; device ; event/time ; "data" ; "DatabaseName" ).
To remove script event call for database MyDatabase Phidget_SetServerEvent("user" ; "password" ; device ; event/time ; "script" ; "DatabaseName").
To remove all data events from some phidget call Phidget_SetServerEvent("user" ; "password" ; device ; event/time ; "data" ; ""; "" ).
To remove all script events from some phidget call Phidget_SetServerEvent("user" ; "password" ;device ; event/time ; "script" ; ""; "" ).
To remove all events from some phidget call Phidget_SetServerEvent("user" ; "password" ;device ; "" ; "" ; "" ; "" ; "").
To remove all events from all Phidgets call Phidget_SetServerEvent("user" ; "password" ; "" ; "" ; "" ; "" ; "").

To remove event(s) call the function with the layoutName parameter empty. Leaving any other parameter empty will make that parameter ignored when matching events to remove (see Examples).

Result

Function returns 0 if event is successfully installed or uninstalled. In case of error the function returns "?". You can use Phidget_Get("lastError") for more detailed error description.

Examples

Phidget_SetServerEvent("user" ; "password" ; "355999:1" ; "onSensorChange" ; "data" ; "MyFilemakerSolution" ; "tableWithValuesFromSensor" ; "dateAndTime=<timestamp>¶temperatureSensorID=<device>¶temperature=<value>" ; 0 ; 1)
This will install data event on sensor attached to the VINT hub 355999 on hubport 1. When temperature changes by 1 degree plugin will insert data to the table.
dateAndTimetemperatureSensorIdtemperature
15/8/2019 13:12:11.232315355999:125.7
15/8/2019 13:55:14.277715355999:126.9
15/8/2019 14:15:22.668791355999:125.8

Phidget_SetServerEvent("user" ; "password" ; "355911" ; "onTag" ; "script" ; "MyFilemakerSolution" ; "Process new tag" ; "dateAndTime=<timestamp>¶rfid=<device>¶tag=<value>")
The script "Process new tag" from solution MyFileMakerSolution will be triggered every time the new RFID tag is in the vicinity of the RFID phidget. The script will receive a parameter: "dateAndTime=15/8/2019 13:12:11.232315¶rfid=355999¶tag=123456".

Phidget_SetServerEvent(Phidget_SetServerEvent("" ; "" ; "355999:1" ; "" ; "" ; "" ; "" )
This will remove all events associated with device 355999:1

Phidget_SetServerEvent(Phidget_SetServerEvent("" ; "" ; "355999:1" ; "" ; "script" ; "" ; "" )
This will remove only script events associated with device 355999:1

Phidget_Get( what { ; more ; index } )

Function to get plug-in or phidget settings and other useful data.

Parameters

whatWhich data should be get
moreAdditional specifier to concretize the request
indexAdditional specifier to get data for specific part (see example)

Parameter values for what

whatPhidget typeDescription
"lastError" Not usedReturns the error code of the last error. If no error occurred 0 is returned.
"lastErrorMessage"Not UsedReturns error text description from the last plugin call
"libraryVersion" Not usedGet version of Phidget Library installed on system
"attachedDevices" Not usedGet number of attached devices
"activeEvents" Not usedOn FileMaker Client returns JSON array of all active ScriptEvents. On Server returns JSON array of all active ServerEvents.
"connectedSBCs" Not usedReturns JSON array of all currently connected SBCs.
"serialNumber" Phidget IndexSerial number of the device with index specified in "more" parameter
"deviceType" DeviceType of the device specified by Device
"deviceName" Device/td>Name of the device specified by Device
"deviceVersion" DeviceVersion of the device specified by Device
"deviceLabel" DeviceLabel of the device specified by Device
"numInputs" DeviceThe number of default inputs
"numOutputs" DeviceThe number of default outputs
"numSensors" Interface KitNumber of sensors
"ratiometric" Interface KitReturns phidget ratiometric status
"antennaOn" RFIDThe status of the antenna of the RFID reading device
"ledOn" RFIDThe status of the LED
"tagProtocol" RFIDReturns RFID tag protocol. See tag protocols for more information.
"backlight" TextLCDGets the backlight brightness
"brightness" TextLCDThis parameter is deprecated since version 3.0, please use "backlight" instead. For backward compatibility, this parameter returns the same value as "backlight" parameter.
"contrast" TextLCDGets the last set contrast value
"numRows" TextLCDGets number of rows on LCD display
"numColumns" TextLCDGets number of columns on LCD display
"cursorOn" TextLCDGets '1' if cursor is on
"cursorBlink" TextLCDGets '1' if cursor should be blinking
"enabled" Bridge and AnalogGets "1" if port is enabled
"dataRateMin" BridgeGets minimal possible data rate
"dataRateMax" BridgeGets maximum possible data rate
"dataRate" BridgeGets actual data rate for getting values from bridge automatically.
"gain" BridgeGets the value of actual gain (something and precision)
"bridgeMin" BridgeGets bridge minimal possible value on port
"bridgeMax" BridgeGets bridge maximal possible value on port
"voltageMin" AnalogGets voltage minimal possible value on port
"voltageMax" AnalogGets voltage maximal possible value on port
"servoMin" AdvancedServoGet minimal value for servo position
"servoMax" AdvancedServoGet maximal value for servo position
"engaged" AdvancedServo and StepperGets '1' if servo on position is on
"acceleration" Stepper Get current acceleration of stepper
"velocity" Stepper Get current velocity of stepper
"minAcceleration" Stepper Get minimal possible acceleration
"maxAcceleration" Stepper Get maximal possible acceleration
"controlMode" Stepper Get control mode, possible values are "run" (continuos movement), "step" (motor will move to given target).
"targetPosition" Stepper Get target position
"acceleration" Stepper Get current acceleration of stepper
"velocity" Stepper Get current velocity of stepper
"currentLimit" Stepper Get value of current limit. Current limit allows to control maximal power output for given Stepper.
"correctionTemperature" PH Sensor Get value of correction temperature for PH Sensor
"portMode" VINT Hub Get current port mode. Possible values are "digitalOutput", "digitalInput", "voltage", "voltageRatio", "vintDevice".

Description

The "more" parameter is usually used to specify Phidget Serial Number. Some commands need specificDevice (of specific type) otherwise they will fail. Some commands are more general. You can use PhigetSN value "-1" to specify the default Phidget.

The boolean values are returned in number form. For example Phidget_Get("antennaOn" ; -1) returns 0 if backlight is off and 1 if backlight is on.

Result

Function returns data if everything is OK. In case of error the function returns "?". You can use Phidget_Get("lastError") for more detailed error description.

Examples

Phidget_Get("attachedDevices")
This will return the number of attached devices. If no phidget is attached to the machine it will return 0. It is a good command to start with to check if any phidget is connected.

Phidget_Get("serialNumber" ; 3)
If you have four Phidgets connected to the machine this will return the serial number of the fourth one. Use this command in the loop (along with previous one) to enumerate serial numbers of all Phidgets connected to the machine.

Phidget_Get("deviceType" ; 69418)
This will check the connected phidget with SN 69418 and returns its type. The types are textual in human readable form. For the supported types the result can be: "PhidgetInterfaceKit", "PhidgetRFID" and "PhidgetServo". In general the type names are the same as the official ones.

Phidget_Get("deviceType" ; 120538 ; 1)
This will return device type of given Device, however it will try to locate the second type of given Device. Example: you have TextLCD combined with InterfaceKit, this allows you to get device type of the second device.

Phidget_Get("enabled" ; 140923 ; 2)
This will check if port 2 on Phidget Bridge is enabled. Port has to be enabled, if we want to read data.

Phidget_Get("dataRateMin" ; 140923)
This will return minimal rate in Phidget Bridge. Value is in ms and if you set data rate, it should be lesser or equal.

Phidget_Get("numColumns" ; 120538)
This will return number of columns of Text LCD with SN 120538.

Phidget_Get("numRows" ; 120538)
This will return number of rows of Text LCD with SN 120538.

Phidget_Get("contrast" ; 120538)
This will return current value of contrast of Text LCD with SN 120538.

Phidget_Get("backlight" ; 120538)
This will return current value of backlightm brightness (within range of 0-255) of Text LCD with SN 120538.

Phidget_Get("connectedSBCs")
This will return currently connected SBCs:

  [{
	"address": "phidgetsbc.local",
	"password": "*****",
	"port": 5661
  }]

Phidget_Get("activeEvents")
This will return currently active Script/Server events depending on Client/Server:

Server:
   [{
	"changeAmount": "",
	"device": "355911",
	"event": "140",
	"eventType": "script",
	"fields": "dateAndTime=<timestamp>\rrfid=<device>\rtag=<value>",
	"index": "0",
	"layout": "Attach",
	"login": "user",
	"password": "password",
	"table/scriptName": "Process new tag",
	"threshold": ""
   }]
Client:
   [{
	"changeAmount": "10.000000",
	"device": "69418:0",
	"event/time": "onsensorchange",
	"fileName": "iOS.fmp12",
	"index": "6",
	"scriptName": "Attach",
	"threshold": "5.000000"
   }]

Phidget_Set( what ; value { ;device ; index } )

Function to set plug-in or phidget settings and other useful data.
Also available as a custom script step.

Parameters

whatWhich data should be set.
valueThe new value.
deviceIdentification of device
indexIndex of changed value.

Parameter values for what

whatPhidget typeDescription
"ratiometric" Interface KitSets phidget ratiometric. The phidget with ratiometric will measure more precise if ratiometric sensor (marked with R) is attached.
"antennaOn" RFIDSets the status of the antenna of the RFID reading device
"ledOn" RFIDSets the status of the LED
"backlight" TextLCD
"brightness" TextLCD
"contrast" TextLCDSets the contrast value. Possible values of contrast are 0-255.
"cursorOn" TextLCDThis allows to turn on/off cursor
"cursorBlink" TextLCDIf cursor is on, then you can turn on/off its blinking
"enabled" Bridge and AnalogThis will enable port on given index
"gain" BridgeThis will allow you to set gain of data from the bridge
"dataRate" BridgeThis will allow you to set data rate of incomming data
"motorOn" Servo and StepperTurns a Motor On & Off. Before you turn servo on, first you have to configure target position.
"servoMax" AdvancedServoAllow to set minimal value for servo (prevents servo from being damaged)
"servoMin" AdvancedServoAllow to set maximal value for servo (prevents servo from being damaged)
"portMode" VINT Hub Sets the hub port mode. Possible values are "digitalOutput", "digitalInput", "voltage", "voltageRatio", "vintDevice". Default value for hub port is "vintDevice" mode. Hub Port will ignore all VINT devices if it is not set to VINT device mode. Only one mode is active at time. Setting mode unsets all other modes.
"controlMode" Stepper Set motor mode, possible values are "step" (motor will move to given position) and "run" (continuos movement). After you set controlMode you should also reset velocity, acceleration and target position.
"acceleration" Stepper Set current acceleration of stepper
"velocity" Stepper Set current velocity of stepper
"currentLimit" Stepper Set the current limit. Current limit allows to control maximal power output for given Stepper.
"correctionTemperature" PH Sensor Set value for correction temperature for PH Sensor
"serverLog" NoneTurns on/off log for helper app on FMS. Supported values "0" and "1". Default is "0". Path to log file on macOS: "/Library/Application Support/24U/24UPhidgetManager/ServerLog.txt", on Windows: "%public%\24u\24UPhidgetManager\ServerLog.txt"

Description

Use this funtion to set various value on Phidgets.

Result

Function returns set value if everything is OK. In case of error the function returns "?". You can use Phidget_Get("lastError") for more detailed error description.

Examples

Phidget_Set("ratiometric" ; 1 ; 69418)
This will set the ratiometric value to 1 (turns on) in the phidget with SN 69418. This phidget must be interface kit phidget otherwise "?" is returned.

Phidget_Set("ratiometric" ; 1 ; -1)
This will set the ratiometric value to 1 (turns on) in the first phidget it founds. This phidget must be interface kit phidget otherwise "?" is returned. Use this form if you have only one phidget connected to the computer and you are sure that you will never connect any other phidget otherwise the result can be unpredictable.

Phidget_Set( "backlight" ; 127,5 ; 120538)
This will set the backlight brightness value. Possible values 0-255.

Phidget_Set( "contrast" ; 155 ; 120538)
This will set the contrast value. Possible values 0-255.

Phidget_Set( "motorOn" ; 1 ; 170192 ; 3)
This will turn on the fourth motor.

Phidget_Set( "motorOn" ; 0 ; 170192 ; 0)
This will turn off the first motor.

Phidget_Set( "enabled" ; 1 ; 140912 ; 3)
This will enable port 3 on Bridge.

Phidget_Set( "dataRate" ; 200 ; 140923)
This will set data rate of Phidget Bridge on 200 ms. Be careful - data rate should be between data rate min and data rate max.

Phidget_Set( "enabled" ; 1 ; 131907 ; 3)
This will enable port 3 on Analog (assuming proper phidgetSN was given).

Phidget_Set( "portMode" ; "digitalOutput" ; "335882:3")
This will set digital output mode on port 3 on VINT Hub with serial number 335882. You can use the port as digital output the same way as with the Interface kit.

Phidget_Set( "portMode" ; "vintDevice" ; "335882:3")
This will set VINT device mode on port 3 on VINT Hub with serial number 335882. After you set port, you can connect to the port one of the supported VINT devices.

Phidget_Set( "serverLog" ; "1" )
This will turn on log file on FMS.

Phidget_Connect( address { ; password {; port } )

Function to connect to an SBC or a computer running the Phidget Network Server via network.
Also available as a custom script step.

Parameters

addressAddress of SBC in network
passwordPassword for security
portPort of service. In case you wont use, port 5661 is used.

Description

Use this function to connect to an SBC or Phidget Network Server.

Result

Function return 0, if everything OK, if function returns "?". You can use Phidget_Get("lastError") for more detailed error description. However, even if function returns 0, it doesn't mean that SBC is already connected. If you have slow network, then it can take some time. Connected SBC will trigger "onAttach" script (if set).

Examples

Phidget_Connect("10.0.3.51" ; "111111")
Try to establish connection to address 10.0.3.51 with password "111111" on port 5661.

FileMaker example of using this feature can be found here.

Phidget_Disconnect( address )

Function to disconnect from an SBC or a computer running the Phidget Network Server.
Also available as a custom script step.

Parameters

addressAddress of SBC in network

Description

Use this function to disconnect from an SBC or Phidget Network Server.

Result

Function return 0, if everything OK, if function fails - it returns "?". You can use Phidget_Get("lastError") for more detailed error description.

Examples

Phidget_Disconnect("10.0.3.51")
Disconnects from address 10.0.3.51.

Device identification

There are several different ways to identify a Phidget device:

Type Example Description
Phidgets SN 335882 Use Phidget serial number for Phidgets connected directly to computer or SBC (Single Board Computer).
First available-1Use value -1 for the first available device.
Phidgets SN + ":" + VINT port "335882:4" Use Phidget serial number and VINT port for Phidgets connected via VINT hub.

Please note that if the Phidgets is connected via network, you will have to use Phidget_Connect function first.

Tag protocols of RFID

This section explain tag protocols used for writing on RFID tag.
Tag protocol specifies, which format of input data is accepted. Table below shows supported protocols.

Tag protocol Accepted value
PHIDGETS Strings or numbers (integer)
ISO11785_FDX_B Strings with 15 numbers (3 state code, 12 animal code)
EM4100 Strings of 10 hexadecimal numbers (0-f)

Script Steps

Since version 16 of FileMaker Pro and FileMaker Pro Advanced new feature called "External script steps" has been added. This feature allows plug-in to offer its functionality as FileMaker script steps.
Following table shows, which functions of plug-in can be also called as script step.
Plug-In function Script Step
Phidget_Version Phidget Version
Phidget_Register Phidget Register
Phidget_Connect Phidget Connect
Phidget_Disconnect Phidget Disconnect
Phidget_Write Phidget Write
Phidget_Set Phidget Set
Phidget_SetServerEvent Phidget Set Server Event
Phidget_SetScriptEvent PhonePhidget Set Script Event

24U Phidget Plug-In status codes

-50Parameter errorMeans paramErr, Phidget_ has wrong parameters.
-36Missing RFID tagReturned when RFID Reader / Writer has no RFID tag to read / write.
-37Antenna is offRFID Reader is not able to provide this functionality with antenna off.
-23Invalid Script NameReturned when plugins function Phidget_SetScriptEvent can't find script in the file
1 - 1000Phidget Library errorsYou can get error description by calling Phidget_Get("lastErrorMessage").
24001 Demo mode expired If you want to keep using the plug-in, you must register it or buy it for particular environment.
24002 Product expired Trial period is over. If you want to keep using the product, you must buy it for particular environment.
24003 SN limit was met The serial number is already registered on too many computers.
24004 Product is dead The product expired and cannot be used any more. Please download the new version from 24U Software.
24005 Invalid serial number Serial number you entered is not valid.
24006 Activation failed Activation failed probably due to some network error. Please, check your connection to the internet and try again later.
24007 Deactivation failed Deactivation failed probably due to some network error. Please, check your connection to the internet and try again later.
24008 Unknown serial number The given serial number cannot be used for the current product. It has been stored so that other product can try to use it.
24009 Blacklisted serial number The given serial number has been blacklisted and cannot be used anymore. Please, contact 24U Support if you need more information.
24010 eSellerate engine not installed This product uses eSellerate to validate user registration and purchases, but its installation failed. Please, reboot the computer or try again later.
24011 Device limit met The purchased license has a limitation of used devices.
24099 Function forbidden on server by configuration. Hosting friendly functionality related error occurred, get exact issue by calling Phidget_Get("lastErrorMessage") function.