Troi Serial Plug-in FMP6 conversion noteSerial Plug-in 3 is FileMaker 7 nativeTroi 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 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 syntaxThe 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. Set Field [errorCode , 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 switchesAs 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 parametersIt 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, New parameter limitsThe 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 6When converting FileMaker does not change the plug-in call. So after conversion you need to do this manually. Here are the global steps:
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 notesNative script triggeringFileMaker 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 functionsThe table below will help you figure out the new names for changed function names:
Specific functions notesThe table below lists conversion issues with specific functions:
Obsolete functions
|
||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
|