Lua Plugins For VRInsight Devices
Lua Plugins For VRInsight Devices
Using VRInsight's SerialFP2 and FSUIPC together with re-programming using plug-ins.
Introduction
This document follows on from the Appendix in your FSUIPC Advanced Users Guide entitled "Handling VRInsight
devices in FSUIPC". If you have not read and acted upon that first, please do so before moving on to the facilities
detailed here.
This is not going to teach you how to completely program VRInsight devices in Lua, using the "com" library facilities.
You most certainly could do that if you so wished, but it is beyond the scope of this package.
What this will do is show how some parts of what the devices do can be changed a little to more suit your needs. To do
this we shall concentrate on two examples (both of which are useful now, but both of which have apparently been
promised as future SerialFP2 improvements by VRInsight):
VRI_SetMach: a plug-in to provide Mach speed control setting and readout from the MCP Combi device. This one is
well-tested on my own MCP Combi.
VRI_SetBaro: a plug-in to provide the option to show and adjust the altitmeter BARO setting on the M-Panel device
in millibars (hectoPascals) as an alternative to inches of mercury. At the time of publication this has not been tested at
all on the device (so look out for updates).
However, before the examples, some reference information about parameter setups in FSUIPC's INI file.
<name of plugin> gives the name of the Lua plug-in to be automatically loaded if this device is detected (and
for each such detection). Omit the '.lua' part.
It is the FILTER facility which allows your plug-in to take control of some aspects of the device actions without
interfering with it all. If you set this option then you add a list of filters afterwards. These are in this form:
WrFilter.n=<filter string>
for Write filters (that is, writes TO the device FROM SerialFP2, the driver, and
RdFilter.n=<filter string>
for Read filters (that is, reads FROM the device TO SerialFP2, the driver.
As already mentioned, but worth emphasising, the filters act between driver and device. The device reads are all
accessible to the Lua plug-in, as are the driver writes.
The number, 'n', starts at 1 for each of the groups (Rd and Wr) and increases normally, just being a listing reference.
You can have a maximum of 32 filters of each of the two types.
The strings listed in the filters represent those being sent back and forth between SerialFP2 and the device. The best
way for you to know what they are and understand what they do is to use the FSUIPC Log facility (the Debug=Please,
LogExtras=4 options detailed in the FSUIPC Advanced User's appendix). The log will show the exact command and
response strings being used.
However, there are some special facilities in the filter string specifications:
The character * at the end means "any characters at all, or none".
The character ? at the end means "any number of decimal digits, only, until the end"
The characters ?+ at the end means "any number of decimal digits, only, until the end or a + or -
Other special filtering options may be added if the need arises. Those are the few found to be needed for the examples
we shall look at. in detail below.