Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello,

Years ago I wrota a small utility to read and write to / from flightsim via the serial port, using FSUIPC offsets, in my case using PIC microcontrollers.

Unfortunatley it only works with FS2002 or below, and I have lost the source code, so I would have to start from scratch to do it again. I am not much of a PC programmer, so this is a daunting task.

The way it worked was to send a serial message to the program in the form; Read or write, FSUIPC offset, size of variable, value to be written (if it is a write).

My question is: Is there a similar tool out there that I could just install & use, and save myself alot of head scratching?

Kind regards

Bob...

Posted

My question is: Is there a similar tool out there that I could just install & use, and save myself alot of head scratching?

Hi Bob,

I don't know of a pre-built tool, but you might want to look at the LUA scripting language that's integrated into FSUIPC now.

It has facilities to read and write from FSUIPC offsets and also to read and write data to/from the serial port.

You'll need to learn the LUA language but there are plenty of examples provided with FSUIPC and the syntax is very simple. It might be easier than using a compiled language like VB, C# or C++ etc.

See this thread for the details: Latest LUA Package for FSUIPC

You'll need a registered version of FSUIPC to use the LUA facilities.

I've never really used LUA so I wouldn't be able to help with the specifics, but others here (and Pete when he gets back from holiday) will be able to help.

Paul

  • 2 weeks later...
Posted

Years ago I wrota a small utility to read and write to / from flightsim via the serial port, using FSUIPC offsets, in my case using PIC microcontrollers.

Unfortunatley it only works with FS2002 or below

FSUIPC is always intended to be backward compatible, so that even today's FS9 version (FSUIPC 3.99) should be okay with FS2002, FS2000, FS98, CFS2 and CFS1. Conversely, a program written to work with FS2002 and earlier should work with FS2004 using FSUIPC3 and FSX, ESP and Prepar3D using FSUIPC4. If not I'd like to know why.

My question is: Is there a similar tool out there that I could just install & use, and save myself a lot of head scratching?

As Paul says, the Lua plug-in facilities should make it pretty easy to do what you want.

Regards

Pete

Posted (edited)

Hi Pete,

Thank you for your reply.

You have me thinking now. I'm sure I tried it with FS9, but I will give it another try.

The program is still there on flightsim.com, if anyone is interested Just do a search for "Bob Edge". It is called FS Comm 1.

What I liked about this is that it was universal, and could read or write any FSUIPC offset, without writing any code on the PC side. From what I gather (though I have not done much research yet) the LUA would need code for every offset you want to read or write.

Anyway this has answered my question, thank you.

Best regards

Bob.

Edited by Bob Edge
Posted

What I liked about this is that it was universal, and could read or write any FSUIPC offset, without writing any code on the PC side.

Something must be determining what offset to read and write, and how big, and what format.

From what I gather (though I have not done much research yet) the LUA would need code for every offset you want to read or write.

Why? The parameters to the read/write functions (especially the read/write structure functions, which are very flexible) determine offset, size, format, exactly the parameters you'd need for any other program. The wouldn't need to be explicit, but supplied as data.

Maybe I am misunderstanding what you are saying?

Pete

Posted

Hi,

As I said, I have not really researched the LUA yet. Better get reading.

The offset, size, etc was sent to the PC from the microcontroller. Then my program passed this info to FSUIPC.

Bob.

Posted

The offset, size, etc was sent to the PC from the microcontroller. Then my program passed this info to FSUIPC.

Yes, you can do that in Lua. If you use the read/write structure functions you can batch the operations much as you would with multiple FSUIPC_Read/Write requests before the FSUIPC_Process call, except there would be a separate function call for reads and writes.

Regards

Pete

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.