Jump to content
The simFlight Network Forums

fsuipc.dll & epicinfo.dll problem


Recommended Posts

Hi Pete,

I have a Flightlink KR1 Radiostack, and some analogs and buttons connected to the epic card. So I use EpicInfo.dll (tried all kinds of versions) to communicate with the radiostack.

Now, I have written this "analog intercepting program" in C++ which basicly get's analog values from the epic and some FS2002 variables trough fsuipc. After doing some calculations I send my new calculated analog values directly to FS2002 using fsuipc. All this happens at ±10Hz

(A timer that calls a function every 100ms to do all the stuff)

The bad effect is, that flightsim hangs sometimes, the instruments still move, but the 3d image freezes. After pressing the 'Alt' key to bring up the inflight menu, the 3d view moves again.

Also, when i shut down my program, and start it back up, it cannot connect to flightsim anymore. I thought it was my fault, because i'm quite a novice programmer :oops: , but I also tested Enrico's software, which also has that same problem.

After shutting down FS2002 (frequently with a 'end now' button from a popped up error) I see that there still is a FS2002.exe process in memory.

I removed EpicInfo.dll from the modules folder, and the problem was gone (but offcourse, the radiostack didnt work anymore then)

I also tried to set the MaxFreqScan in epicinfo.cfg, because i thought i overloaded fsuipc too much.. no effect either...

Any idea's ? :wink:

Kind Regards,

Van Ertvelde Wim

Link to comment
Share on other sites

I have a Flightlink KR1 Radiostack, and some analogs and buttons connected to the epic card.

This is an ISA card, or the newer USB version? What Windows operating system?

Now, I have written this "analog intercepting program" in C++ which basicly get's analog values from the epic and some FS2002 variables trough fsuipc.

And this is using what to communicate with the EPIC?

The bad effect is, that flightsim hangs sometimes, the instruments still move, but the 3d image freezes. After pressing the 'Alt' key to bring up the inflight menu, the 3d view moves again.

Also, when i shut down my program, and start it back up, it cannot connect to flightsim anymore. I thought it was my fault, because i'm quite a novice programmer :oops: , but I also tested Enrico's software, which also has that same problem.

After shutting down FS2002 (frequently with a 'end now' button from a popped up error) I see that there still is a FS2002.exe process in memory.

I removed EpicInfo.dll from the modules folder, and the problem was gone (but offcourse, the radiostack didnt work anymore then)

It sounds very much as if something your program is doing with the EPIC mucks up something that EPICINFO is doing with the EPIC. If this is with an ISA EPIC, using my own EPIC.VXD, theb you should be programming using only the joyGetPosEx calls as documented in my EPIC95 documentation. Otherwise you certainly run the risk of tying up the EPIC queues.

If it is using EPICIO.DLL to communicate with either the ISA EPIC or the USB EPIC, then are you sure you are using a version of the DLL which can support multiple simultaneous users? If the EPICIO.DLL is hanging during a call made from EPICINFO then this would obvously create problems, like hangs, in FS -- some threads might still be running of course, which could explain what you see. It would also explain why restarting your program doesn't work (the EPICIO.DLL is hung) and why when you think you've closed FS you really haven't -- a DLL is still not closing because it is hung.

I really am no longer an EPIC developer or even much of a user, though I do have a USB EPIC here connected and used for a few buttons.

Certainly, if I experienced such problems I would have to ask Ralph Robinson at R&R (EPIC makers) about them. This is most particularly true for EPICIO.DLL, which is just a black box to me. Maybe he can tell you how to enable some sort of diagnostics. Maybe he has a later version whivh can cope with the demands you are making?

Whatever, I'd be glad to hear of the outcome.

Regards,

Pete

Link to comment
Share on other sites

hmm, I havent seen it from that perspective!

I'm using the EPICUSB on, WinXP-Pro, and i communicate trough epicio.dll "_GetAnalogs();"

I'm gonna remove the epicpart of my program and try it again. (But, this doesnt explain why Enrico's IFRDemo also has this strange behaviour)

Thanks Pete !!

Link to comment
Share on other sites

I'm gonna remove the epicpart of my program and try it again. (But, this doesnt explain why Enrico's IFRDemo also has this strange behaviour)

Ah, perhaps I misunderstood that part of your report. Are you saying that, starting FS from scratch with a newly-initialised EPIC (to make sure it is behaving), and not running your program at all, EPICINFO still seems to hang FS? In other words, with only my modules accessing EPIC?

If so I can only think that it is a problem with the EPIC firmware, or the EPICIO.DLL, or the EPL coding for the KR-1, or some incompatibilities between these things. There has been no significant change in EPICINFO.DLL nor in the EPIC parts of FSUIPC and WideServer for a long time.

Try it all without actually loading the EPL for the KR-1 into the EPIC. Just load a default program or leave it as it is when it starts. EPICINFO, with the same EPICINFO.CFG file, will still be doing pretty much the same things. This may show whether it is something in the EPL or EPIC firmware.

There is also extensive logging in the EPICINFO armoury. You could try some of that and see if you can spot what might be going on there.

Otherwise I am really at a loss. The KR1 program was originally mine, many years ago, but the EPICUSB version was rewritten by Ralph. You may in the end need to get back to him to help sort this out. At least he will suggest ways of debugging the EPICIO and EPIC firmware side of it.

There must be quite a few KR1 users about with USB EPICs, so FlightLink themselves may know more about this. If it happens without any of your software touching anything then I think those are your possible courses of action.

If you do produce any interesting EPICINFO logs I can help you interpret them, if necessary.

Regards,

Pete

Link to comment
Share on other sites

I commented-out all of my 'epic' code, and it seems to work for now. This evening I'll test it on a second simulator.

I believe the first theory of you is correct.. that only one program at the time can interface with the usb-epic card.

The problem was really random though.. so more testing will be needed to have 100% certainty.

Another problem arises though.. If epicio.dll cannot support multiple connections, how do I intercept all analogs before they are applied to fs2002? I guess through the win32 joystick api, and leave epicio.dll for what it is :)

I'll contact Ralph, and if I have any updates, i'll share them here on the forum.

Thanks,

Van Ertvelde Wim

Link to comment
Share on other sites

I believe the first theory of you is correct.. that only one program at the time can interface with the usb-epic card.

I'm sure that isn't the intention, but I'm equally sure that multiple users weren't possible in the early days. It might be worth seeing if there's a later version of the EPICIO.DLL -- check with R&R. I expect Ralph can clarify the issue.

Another problem arises though.. If epicio.dll cannot support multiple connections, how do I intercept all analogs before they are applied to fs2002? I guess through the win32 joystick api, and leave epicio.dll for what it is :)

Yes. You'd have to disassociate the axes from FS (i.e. delete the asignments), and use either the joyGetPosEx or DirectInput methods to read the values yourself. The former is easier unless you are into COM and are a bit of a masochist! :)

I don't know what you are trying to do, but if it is only the main flight controls (aileron, rudder, elevator, and throttles) that concern you in this, you can let FS read the values, and intercept them in FSUIPC instead. See offsets 310A and 3328-3336. Doing things this way has the advantage of using standard calibrated values in FS terms, not the devices.

I'll contact Ralph, and if I have any updates, i'll share them here on the forum.

Okay. thanks!

Regards,

Pete

Link to comment
Share on other sites

A little update (but no info from Ralph yet)

2 out of 3 simulators work fine when I removed my epic-code.

1 simulator still has that problem. And it looks like it's the same 'black screen' problem like many FS2004 users experienced.

When i startup my program, i hit the windows key, so FS2002 loses focus. going back to fs2002 -> 3d view freezes, or has a black screen.

(Same diagnose as you once posted on this forum Pete...)

Tomorrow I'll update some drivers, and maybe a DX9 update.

Also, that sim has the latest intel CPU, while the other two has the slower amd xp2000+ cpu

don't you just hate this kind of debuggind.. :cry:

Link to comment
Share on other sites

So, for the record, the "Back Screen Bug" that was on the forums a month ago, also exists on FS2002.

There have been similar such assorted bugs with different drivers in all versions of FS and DX as long as I can remember. The trouble is they are all hardware configuration dependent. The first thing to try, as even advised by MS support, is later or even just different video drivers.

Regards,

Pete

Link to comment
Share on other sites

Sorry, have had no internet access for over a week.

----- Original Message -----

From: Van Ertvelde Wim

To: Ralph Robinson

Sent: Monday, December 01, 2003 11:16 AM

Subject: question about epicio.dll

Hi Ralph,

I asked this question first to Pete Dowson:

We have a FlightLink KR-1 Radiostack, and a usb-epic. They communicate with epicinfo.dll. I wrote this program that intercepts epic's analogs (using _getAnalog();) and reads some FS2002 variables trough fsuipc.dll. After some calculations I resend new analog values to fsuipc.dll.

All this happens at about 10Hz.

I have this strange problem, that sometimes, the 3dview from FS2002 freezes, while the instrument panel is still moving. When pressing the 'alt' key to bring in the inflight menu, the 3d view unfreezes. This effect seems to be random.

Also, when I close my program, and reload it, it cannot connect to FS2002 anymore, and FS2002 tends to lock up.

Pete dowson told me that it could be that epicio.dll only accepts one connection. And that could be the reason that epicinfo.dll or my program behaves weird.

Do you have any information regarding this ?

Early versions of EPICIO.DLL did only allow one connection. Now it accepts multiples, however there were some handle issues between processes. I am working on this now. This should be done in a couple of days.

The fix will allow EPICenter to be minimized while FS is running, EPICINFO running, other programs communicating with EPICIO and multiple EPICUSBs communicating with each other.

Which version of the DLL are you running and how are you getting your handle. If you are using just OpenDevice(EPICdevice); that will not work with EPICINFO. Version 1.6 of the DLL will allow you do use _OpenEPIC(EPICdevice, destID) where destID is your program's ID. Since EPICINFO does not do this yet, it is assigned a destID of 9.

More on this later/

Second question:

How does epicenter reads the analog inputs, before and after calibration ? (the in's & out's) I only see one getAnalog command in the sdk.

GetAnalogs returns the output analogs.

Output analogs are defined in the device descriptor and can have various sources. IF a source is an input analog, that analogs value is scaled depending on calibration then passed to the output analog where the value can go thru offsets, max delta, rate curves, etc before it comes out as the resultant output analog.

also, how does epicenter reads out the buttons ?

You do not want to read buttons the way EPICenter does. If you are interested in certain switch activity you can use a device with option(SEND_BUTTON_DLL) and a devid set . Your program can request a devid's actions and these will be passed to you. You can get the device's initial states by using GetDeviceState.

There is a bug in that area and I will be fixing that soon and put up an example of reading the device states, SEND_BUTTON_DLL, etc.

__________

Ralph Robinson

R&R Electronics

rrelect@mindspring.com

http://www.mindspring.com/~rrelect

Kind Regards,

Van Ertvelde Wim

"If you find yourself falling off a cliff, you might as well try to fly.....................What have you got to lose."

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.