PDA

View Full Version : Help with DeviceLink



FCIProject
09-17-2005, 07:00 AM
I have written an interface bewteen IL2 and SimKits dials (http://www.simkits.com). The interface is written in Java and is working quite well.

I am trying to make the interface as fast and efficient as possible, but I am having a problem sending Flight Control information to IL2.

If I send two different packets, e.g;

R/85\0.18
R/87\-0.33

The stick, in IL2 moves properly.

If I try and combine these two DeviceLimk commands only the first command works.

Should I be able to send;

R/85\0.18\R/87\-0.33

and have the Ailerons and Elevators move?

I know I can request multiple commands, like this;

R/30/32/40

and get a response;

A/30\0.21/32\0.00/40\241.67

Can anyone help?

This is not stopping the program from working, but would be more efficient. I would also like to combine the Throttle and Rudder data into the one packet as well.

I will be making the interface program available soon.

TIA

vanjast
09-17-2005, 07:26 AM
You're serious about this flight sim thingy.
If you want it to be more efficient you have to get rid of Java and the Java engine. to have the java engine and IL2 with DirectX/OpenGL competing with each other for resources is...well going to slow things down.

What you really need is a adapted USB joystick connection to the simkits. This you can do by pulling a broken joystick's USB pcb board and rewire all the connections. You must also replace the potentiometers on the new joystick, etc, so they match the originals. It's quick and easy and you don't have to do any development.

Another thing is that I don't think IL2 outputs it's dial variables for you to read, so unless other flight sims do, this might be a wasted exercise.

http://forums.ubi.com/groupee_common/emoticons/icon_cool.gif

FCIProject
09-17-2005, 07:59 AM
Actually Java is doing rather nicely, thank you. At the moment the program uses TCP/IP to communicate with IL2 and the SimKits. I am looking at using Java Native Interface (JNI) for the SimKits, to see if this is faster. FYI The main loop of the Java program is updating the dials at nearly twenty times a second.

One of my reasons for writing the interface was to improve my Java programming skills. The only other way to make the whole lot faster is use C++. I have never liked C++ and don't want to go down this route. There is also a native compiler for Java, which converts the bytecode to Win32 code. I will use this if I need to make Java quicker.

As for the Flight Controls I have built my own Flight Stick and Throttle. These are attached to the SimKits control board.

You are, also, incorrect when you say IL2 does not output its dial telemetry. Have a look at a file called DeviceLink in the IL2 directory.

You will also find MS FS, thru FSUIPC, and X-Plane make its Telemetry data available. This is not a wasted excercise, by any means.

TAGERT.
09-17-2005, 08:18 AM
Originally posted by FCIProject:
I have written an interface bewteen IL2 and SimKits dials (http://www.simkits.com). The interface is written in Java and is working quite well.

I am trying to make the interface as fast and efficient as possible, but I am having a problem sending Flight Control information to IL2.

If I send two different packets, e.g;

R/85\0.18
R/87\-0.33

The stick, in IL2 moves properly.

If I try and combine these two DeviceLimk commands only the first command works.

Should I be able to send;

R/85\0.18\R/87\-0.33

and have the Ailerons and Elevators move?

I know I can request multiple commands, like this;

R/30/32/40

and get a response;

A/30\0.21/32\0.00/40\241.67

Can anyone help?

This is not stopping the program from working, but would be more efficient. I would also like to combine the Throttle and Rudder data into the one packet as well.

I will be making the interface program available soon.

TIA Most of what I have done has been on the request side, so, all I can say is the multi command seems to be the case for getting different engine info too. That is to say you can not request info like temp for all 4 eng of a 4 eng bomber in one command, you need to break it up into 4 seperate request too.. So Im told.

Which still does not explane you senario, in that even though they are both joystick commands, one is X and the other is Y so it *should* have work within one command. Sorry I was not more help.

FCIProject
09-17-2005, 08:33 AM
Thanks Tagert. Atleast you put sometihng positive in your post.

The DeviceLink interface works very well, however I believe this may be a small bug or sometihng the IL2 Team didn't think of; multiple commnads, with parameters, in one packet.

If anyone has managed to get this scenerio to work, please let me know.

It would mean I could send one packet with the requested dial information and the Flight Control input data. This would cut packet transmission down from 5 to 1 packet per cycle.

BaldieJr
09-17-2005, 09:14 AM
Devicelink doesn't do two sets per packet. I don't know if its a bug or a feature. Maddox has never said either way.

FCIProject
09-17-2005, 09:28 AM
Hello BaldieJr

Is this documented on the forums anywhere or is this a 'rumour'?

I need to know either way. If this true I won't try to put everything in one packet and will look for other 'tweaks' to improve effeciency.

TIA

FOE_Pappy
09-17-2005, 10:02 AM
S! Just in case you have not seen this thread.
http://forums.ubi.com/eve/forums/a/tpc/f/49310655/m/7201027043/p/1

FCIProject
09-17-2005, 10:16 AM
Thanks for the Heads Up on this post.

I have been working on my FCIProject program for a couple of months and this the first issue with DeviceLink I have had.

I will add my pennies worth to the post http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

BBB_Hyperion
09-17-2005, 11:27 AM
You can only send 1 control set command at a time.

FCIProject
09-17-2005, 12:06 PM
Hi BBB_hyperion

I have replied to the post FOE_Pappy has mentioned. You may be interested.

vanjast
09-17-2005, 01:38 PM
Ok sorry, I didn't realise you're running on 2 seperate systems.
Thats ok then.
http://forums.ubi.com/groupee_common/emoticons/icon_cool.gif

FCIProject
09-17-2005, 02:21 PM
No Problem, Vanjast

You need to be more "positive" http://forums.ubi.com/groupee_common/emoticons/icon_wink.gif http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

I don't read or post on the forum to much because the general atmosphere seems pretty negative and seems too critical of Oleg, his team and IL2.

The DeviceLink is pretty good and is a nice feature to have.

Have a look at the forum post FOE_Pappy points to, above, and have a read.

WWMaxGunz
09-17-2005, 04:25 PM
WWSensei has written a C++ wrapper class for devicelink interface. It is available I think
in source and he provided details and a link here months ago.

There are some commands that just don't work right, I think that gear status is one.

I'll send him a heads' up on this thread since he hasn't seen it yet.

FCIProject
09-17-2005, 05:22 PM
Thanks for the info, WWMaxGunz.

I was aware there was a wrapper class for DeviceLink. I am going to look at this when I start investigating Java Native Interface, JNI,(Java->.DLL comms).

By re-wrting my program using JNI I may have a more effecient interface.

WWSensei
09-17-2005, 11:34 PM
I should be releasing Version 2 of the class later this week.