Use this function to troubleshoot the serial port and test scripting.
Serial_Debug ( switches )
|switches||determines the behaviour of the function|
switches can be one of this:
|-BeepWhenDataArrives||the plug-in will beep when data arrives at the serial port|
|-BeepOff||the plug-in no longer beeps when data arrives at the serial port|
|-TestTriggerScript||the plug-in will trigger the dispatch script with some test data|
You can also add this switch in combination with the -TestTriggerScript switch:
|-UseTextAllBytes0To255||sends a string with all bytes from 0-255 as the test data to the trigger script|
Data type returned
If successful it returns 0. If unsuccessful it returns an error code starting with $$ and the error code. Returned error codes can be:
|$$-28||notOpenErr||make sure you have opened a port and specified a dispatch script|
|$$-50||paramErr||there was an error with the parameter (an unknown switch was given)|
Other errors may be returned.
Troi Serial Plug-in 3.0
FileMaker Pro 16 to 19
To be able to test the trigger script the serial port must be opened and a dispatch script must be specified.
See the Debug.fmp12 example file.
NOTE The wait time to trigger the script is now 5 seconds (was 10 seconds).
Set Field [ gErrorCode ; Serial_Debug ( "-BeepWhenDataArrives" ) ]
The plug-in will now beep when data arrives at the serial port. If data keeps on coming in, the plug-in will beep every 2 seconds.
How to test if data comes in:
– Set the plug-in to beep if data comes in.
– Get the device attached to the serial port to send data to the serial port.
– When you hear beeps you know data is arriving at the serial port and in the plug-in.
– To stop the beeping use this command:
Set Field [ gErrorCode ; Serial_Debug ( "-BeepOff" ) ]
Serial_Debug ( "-TestTriggerScript" )
will trigger the dispatch script after 5 seconds.
You can also give this command:
Serial_Debug ( "-TestTriggerScript -UseTextAllBytes0To255" )
This will trigger the dispatch script after 5 seconds, the data received is a string with all the bytes from 0 to 255.
Used in example file
Related script steps
|Beep for Serial Data|
|Trigger Serial Test Script|