Jump to content
The simFlight Network Forums

Connecting hardware to flightsim


Recommended Posts

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...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.