------home-purchasesupportnewsaboutliststipslinks-

 Serial logo

Version 4.5.1 for FileMaker 12, 13, 14 and 15

Troi Serial Plug-in gives FileMaker Pro the ability to read from and write to the serial ports of the computer directly from within FileMaker Pro without the need of a separate application. And it works completely cross-platform!

overview | download | details | comments | buy-it

Troi Serial Plug-in FMP6 conversion note

Serial Plug-in 3 is FileMaker 7 native

Troi Serial Plug-in 3.0 was the first version to use the FileMaker 7 syntax or API (Application Program Interface) to do its work..

NOTE The API is the same for FileMaker Pro 7, 8.x, 9, 10, 11, 12, 13, 14 and FileMaker Pro 15.

NOTE 2 Below we will discuss Troi Serial Plug-in 3.0, but this also applies to possible future versions with a higher number, like 3.2

To make use of the new API you have to make sure the calls to the plug-in are done the right way. Below are some considerations when converting to Troi Serial Plug-in 3.0.

New function syntax

The plug-in functions have a different syntax compared to the FileMaker Pro 6 plug-in.

For example the Serial_Open function has this syntax in the classic API:

External("Serial-Open", "portname|settings")

The syntax in the new native API looks like this:

Serial_Open(switches ; portname ; settings )

Note that functions look like a real function call, no longer a call to External(). Also a hyphen "-" is no longer allowed, so the hyphens have changed to underscores "_" instead. Note too that parameters don't have to be concatenated with a separator. Instead use a semicolon ";" to separate the parameters. For future enhancements we have added a new first parameter: switches.
Below is an example how this function would appear in ScriptMaker:

Set Field [errorCode ,
              Serial_Open("-unused" ; gPortname ; "baud=9600" ) ]

TIP Function names are no longer case sensitive and will change to the correct case after you close the "Specify Calculation" dialog box.

Multiple parameters and new switches

As seen from the syntax, plug-in functions now can have multiple parameters. To make this plug-in more consistent, most functions now have a switches parameter as the first parameter. This makes enhancing the plug-in in the future easier.

TIP Switches are not case sensitive.

Omitting optional parameters

It is now possible to have optional parameters, although Serial Plug-in currently does not have a function that allows optional parameters. But in general, when you omit an optional parameter be sure to add an extra semicolon after the last one, otherwise FileMaker will show an alert that there are too few parameters in this function. For example, taken from our File Plug-in, below we omitted the 3rd parameter at the end (initialfolder). This is the correct way to do this:

Set Field [theFile,
          TrFile_SelectFileDialog("-Unused" ; "Select a file" ; )]

New parameter limits

The plug-in functions now have a size limit of 1 Gb per parameter (up from the total of 64000 character limit for all parameters in FileMaker 6). The Troi Serial Plug-in 3.0 can handle those bigger parameters, however, displaying the results in FileMaker 7 or 8 can take a long time.

Converting the function call from FileMaker 6

When converting FileMaker does not change the plug-in call. So after conversion you need to do this manually. Here are the global steps:

  • remove the External(" at the beginning
  • in the function name: change - to _ and remove spaces, add a ( at the end.
  • change the name of the function (in some cases)
  • add as first parameter: "-Unused" ( if no switch parameter is there)
  • split the remaining parameters: separate each with a ;

Let's for example take this Serial Plug-in 2.1.6 call:

External("Serial-Send", gPortname & "|" & DataField )

This needs to be changed to this Serial Plug-in 3.0 call:

Serial_Send ( "-Unused" ; gPortname ; DataField )

TIP Just copy script or steps from the example files, they are all in the Serial Plug-in 3.0 format!

Specific functions notes

Native script triggering

FileMaker Pro 7 and later support native script triggering, simplifying getting data into FileMaker database. The list of changed functions reflect this change. See also the Terminal.fp7 example file to see how script triggering can be implemented.

Renamed functions

The table below will help you figure out the new names for changed function names:

Old function name

New function name

Notes

Serial-ToASCII

Serial_AsciiValueToText

Changed name to make functionality more clear.

Specific functions notes

The table below lists conversion issues with specific functions:

Function name

Notes

Serial_AsciiValueToText

Renamed from Serial-ToASCII; added switches and separator parameters

Serial_Close

added switches parameter

Serial_Control

IMPORTANT moved switches parameter to be the first parameter

Serial_DataWasReceived

Changed to return the port name instead of a boolean 1 or 0

Serial_Debug

not changed

Serial_GetPortNames

(Windows) Starting with version 3.0 the plug-in will now detect all existing serial ports on , instead of always returning with COM1...COM4.

Serial_Open

added switches parameter and optional trigger filename and trigger scriptname parameters

Serial_Receive

IMPORTANT moved switches parameter to be the first parameter

Serial_Reinitialize

not changed

Serial_Send

added switches parameter

Serial_SetDispatchScript

Added switches and port name parameter; removed triggering by ID, changed the parameter to scriptname

Serial_TextToAsciiValue

new function, complementary to AsciiValueToTxt

Serial_Version

not changed

Obsolete functions

Function name

Notes

Serial_SetSetting

This function is not implemented, as it was no longer needed.

Serial_RestoreSituation

This function is not implemented, as it was no longer needed. The plug-in does no longer need to bring the file and the window to the front to trigger a script.

Back to details Troi Serial Plug-in page



© 2017 Troi Automatisering, all rights reserved.