vrinsight cdu and fsuipc v10

4
FSUIPC and VRInsight CDU – Also A Symbiosis Introduction This document is to document all the results and findings of me working and experimenting with two great Add-ons for Flightsimulator X: The VRInsight CDU Hardware and The registered version of FSUIPC from Pete Dowson I have been flying with various commercial and free addons, a lot of them having an FMS or FMC CDU in an extra window or (as is the case with AirbusX) in the virtual cockpit where it is difficult to get to. I had been looking at the VRInsight CDU II for quite some time but did not buy for two reasons: 1. It is very expensive (around 400+ Euro) 2. You need a separate VGA port which I don't have and buying new PC would make it even more expensive. Eventually I found that the predecessor, the VRInsight CDU without screen has become quite reasonable in price and I therefore bought it. The only thing you need here is the USB port and SerialFP which I had anyway as I own the MCP Combo as well. When you look through SerialFP and having experience with the Combo you realize quickly that many addons are not supported. These include vasFMC, ISG Gauges, AirbusX and other addons, especially the ones where the gauges are based on XML. FSUIPC I had for a long time as the unregistered option because one needed it for various tools but I never saw the need for spending money on it. That was because I did not know what I really get for it. Then one day I looked at my MCP Combo and the dreaded SerialFP thing and I was not happy at all because there were some aircraft I could not attach my MCP to (the ones with XML

Upload: bagarie2

Post on 29-Oct-2015

148 views

Category:

Documents


5 download

DESCRIPTION

manua

TRANSCRIPT

Page 1: Vrinsight Cdu and Fsuipc v10

FSUIPC and VRInsight CDU – Also A Symbiosis

IntroductionThis document is to document all the results and findings of me working and experimenting with two great Add-ons for Flightsimulator X:

• The VRInsight CDU Hardware and

• The registered version of FSUIPC from Pete Dowson

I have been flying with various commercial and free addons, a lot of them having an FMS or FMC CDU in an extra window or (as is the case with AirbusX) in the virtual cockpit where it is difficult to get to. I had been looking at the VRInsight CDU II for quite some time but did not buy for two reasons:

1. It is very expensive (around 400+ Euro)

2. You need a separate VGA port which I don't have and buying new PC would make it even more expensive.

Eventually I found that the predecessor, the VRInsight CDU without screen has become quite reasonable in price and I therefore bought it. The only thing you need here is the USB port and SerialFP which I had anyway as I own the MCP Combo as well.

When you look through SerialFP and having experience with the Combo you realize quickly that many addons are not supported. These include vasFMC, ISG Gauges, AirbusX and other addons, especially the ones where the gauges are based on XML.

FSUIPC I had for a long time as the unregistered option because one needed it for various tools but I never saw the need for spending money on it. That was because I did not know what I really get for it. Then one day I looked at my MCP Combo and the dreaded SerialFP thing and I was not happy at all because there were some aircraft I could not attach my MCP to (the ones with XML

Page 2: Vrinsight Cdu and Fsuipc v10

gauges that do not make use of the standard mechanisms). Being an old techie who had built his first computer himself in the seventies (and they looked still different then) and having helped to throw satellites into space I thought that it must be possible to get these aircraft connected. Once I set my mind to it there was no way back.

In this document I will describe my alternative approach to connecting the VRInsight CDU (and it could well be that the CDU II works as well) directly with FSX and FSUIPC via Lua scripting.

Inside the VRInsight CDULet's first have a look at the CDU. As all VRInsight the hardware components are connected to the PC via USB (and the S in USB stands for Serial) having a serial port connection via which commands can be sent and certain responses can be received. For us the sending of commands is the interesting bit. SerialFP is a tool that connects to the CDU and sends some initializing and resetting commands – that is when the CDU starts showing the initial status text in the display.

It then has all these general or aircraft specific drivers for connecting between the aircraft via FSUIPC (unregistered) and the CDU. An awkward configuration tool allows you to define something like a key press or a mouse macro for each of the buttons and dials available. Internally it translates these settings into FSUIPC commands and maps them to the activity codes coming from the CDU.

The CDU sends an activity code whenever you press a button or turn a dial. These codes are specific to each activity, some of them containing a value (such as ALT, HDG). It is these codes that we use later for Lua programming.

VRInsight CDU Activity CodesThere are types of codes depending on what you press.

Dials do usually send XXX+ or XXX- depending on how you turn. If you turn quickly they will send XXX++ or XXX-- so that you could increase the step size. Pressing any of the dials (they all can be) will send XXXSEL+ or XXXSEL- where the + and – toggle. You could use that for your scripting or ignore it and execute the same action at + and -.

Now, the CDU does NOT use dials.

Buttons usually send either a code without signs (EFIWX) or with signs for toggle (SPDSPD+ and SPDSPD-) but in both cases you know that the button had been pressed.

This is the list of codes the CDU sends can be found as a text file in my posting.

Making the ConnectionSerialFP detects what COM port the CDU is on and then automatically connects with it.

We need to do something similar but manually. For this we need to perform the following steps:

1. Edit the fsuipc4.ini in FSX\modules folder and add a section VRInsight if not already there:

[VRInsight]1=COM4,COM152=COM5,COM16

But you have to replace the first COMx with what SerialFP displays (if it shows COM3 then replace COM4 with COM3). Do this with every VRInsight device you own (I have two, the CDU and the MCP Combo).

Page 3: Vrinsight Cdu and Fsuipc v10

2. While in fsuipc4.ini also add a section called VRInsight.FMER for the MCP Combo:

[VRInsight.FMER]DriverReads=YESDriverWrites=YESLua=LuaDispatcher

The last line only if you want to use my dispatcher script to start/restart aircraft specific Lua scripts. Leave this out if you do not want to start anything automatically.

3. FSX needs restarting to pick up these new settings. We have told FSX/FSUIPC to make contact to COM4 and COM5 to prepare talking to the CDU or MCP if connected. Make sure the CDU is connected when FSX starts otherwise it is not sure that we can connect afterward (it works but not reliably).

4. Now we also need a special Lua script which handles all the communication and the connection to the aircraft. I will describe in the following how that will look like. It should be placed in FSX\modules with a file extension of .lua and you need to have it started either by programming some key or use the Lua option in the VRInsight.FMER section or any of the other ways to start a lua script.

The Lua Magic to Connect to VRInsight DevicesPete Dowson has extended the capabilities of FSUIPC registered with Lua scripting and with specialized “libraries” offering all kinds of functionality from serial port communication to modifying FSX offsets and issuing keys or controls etc...

We use some of this to connect to the CDU.

For one, the lua scripts we use here CANNOT be the ONE-SHOT functions you assign to a button or key which start and end shortly after. The type of lua we need are the “start once and keep running and reacting” type. They must NOT be assigned to a button or key but be started with FSX or when a specific airplane is started.

The basic lua script then looks as follows:-- General VRI CDU Interface for AirbusX

-- LUA Script V 1.1-- 14.09.2010-- Kosta Prokopiu

if VRImodel == nil then VRIdevice = "COM6"end

speed = 115200handshake = 0

dev = com.open(VRIdevice, speed, handshake)if dev == 0 then ipc.log("Could not open VRIdevice port") -- sometimes the port switches from 5 to 4 -- set your own here dev = com.open("COM6", speed, handshake) if dev == 0 then ipc.exit() end

Page 4: Vrinsight Cdu and Fsuipc v10

end

-- initialize MCP Combo-- com.write(dev, "CMDRST", 8)com.write(dev, "CMDCON", 8)

-- handle XXXfunction handleCDUXXX(handle, str)

-- LSKs -- -- LSK1

if str == "CDUR4C0" thenend

-- LSK2if str == "CDUR4C1" thenend

-- LSK3if str == "CDUR4C2" thenend

...

end

end

-- ---------- RESET CDU ---------------ipc.display("Resetting CDU please wait!!")

ipc.sleep(500)ipc.display("CDU Handler used: handleCDUXXX", 10)event.VRIread(dev, "handleCDUXXX")

This is only a skeleton and needs to be filled with live. But basically that is ALL you need to get going. Look on this forum in the User Contributions section for more on VRInsight, CDU and the aircraft/FMCs to control with it.

Kosta Prokopiu ([email protected])