Jump to content
The simFlight Network Forums

Cannot read variables when using internal DLL


Recommended Posts

Hi,

I build a home cockpit http://jetvision.de/flightdeck.shtml and use a registered FSUIPC V3.65.

The interface between the hardware and FSUIPC is my own Delphi code, using the libraries provided with the module. When I started I used the external EXE method and I was able to write and read variables without any problem. I have no converted the EXE type to an internal DLL (no code changes other than an OPEN2 call now and the array definition as described in the docs) that works well except - I am not able to read variables through FSUIPC anymore. All values are ZERO. I still can write values though.

Am I missing something here? From my understanding of the doc I do not need to get an application key even for a DLL as long as the client is registered?

By the way, thank you for providing all your support to the community.

Andy

Link to comment
Share on other sites

I build a home cockpit http://jetvision.de/flightdeck.shtml and use a registered FSUIPC V3.65.

Sorry, old versions are not supported. Please refer to the Announcements above. 3.65 is very old.

Am I missing something here?

Use the latest version then re-ask your question, but first of all please try using the facilities provided for you to check things yourself. Look in the FSUIPC Options and you will see a "Logging" tab. Go there and check IPC read logging. See if your requests are being logged correctly. Logging is provided to help developers.

Pete

Link to comment
Share on other sites

Maybe I can help you, I have managed to create a DLL using Delphi...

Make sure you have done the following things:

- create a buffer variable e.g. as an array [0..65534] of byte (let's call it fsuipc_buffer for now), and make sure that it is globally accessible for all following code

- use fpcinternal instead of fpcuser

- use open2 instead of open. as additional parameters, pass on info about your buffer, e.g.

FSUIPC_Open2(SIM_FS2K4, dwResult, @fsuipc_buffer[0], sizeof(fsuipc_buffer));

the @ and the [0] are important, as this will result in a pointer to the first element of the array

All other things should be the same. It sounds to me that maybe you just forgot to make the variable accessible globally. Keep me posted, maybe I can help you if this doesn't work. And by the way, since some time, you don't need to have a registered version of FSUIPC if you only use the data I/O functions.

Greetings

Florian

Link to comment
Share on other sites

Why did I even write this? Did you even read this?

Well, I think you might sometimes feel the same, Pete. By the way, is there maybe some space in the manual for the SDK to include the above checklist for the Delphi version of the interface? It would make a transition from external to internal usage easier.

Greetings

Florian

Link to comment
Share on other sites

Pete. By the way, is there maybe some space in the manual for the SDK to include the above checklist for the Delphi version of the interface? It would make a transition from external to internal usage easier.

Do you mean this?

- create a buffer variable e.g. as an array [0..65534] of byte (let's call it fsuipc_buffer for now), and make sure that it is globally accessible for all following code

- use fpcinternal instead of fpcuser

- use open2 instead of open. as additional parameters, pass on info about your buffer, e.g.

FSUIPC_Open2(SIM_FS2K4, dwResult, @fsuipc_buffer[0], sizeof(fsuipc_buffer));

the @ and the [0] are important, as this will result in a pointer to the first element of the array

I'm not at all familiar with the Delphi section, it is supplied as I received it. Is the are place for it in there?

Best Regards

Pete

Link to comment
Share on other sites

Hey Pete, thanks for your reply,

there is a zip file called "Library for FS Internal Users" in the SDK, which includes a Delphi Unit for the internal interface to FSUIPC (if you coded a module for FS). There is a readme file that you wrote in 2006 ("Important Read Me"), but it does not tell how to use the unit. Maybe that would be a nice place for the info.

Greetings

Florian

Link to comment
Share on other sites

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.