Jump to content
The simFlight Network Forums
jmig

Opencockpits FMC and FSUIPC

Recommended Posts

I am trying to get an Opencockpits FMC V3 to work with FSUIPC as a general purpose input device.  My goal is to use the device as a FMC and Up Front Control Panel (UFCP) in various aircraft using FSUIPC to assign functions to the various button/keys of the FMC V3.  However, I am have trouble getting it to work with the existing SIOC scripts.

 

They work with Project Magenta's offsets or iFly offsets. but I don't know which offset to use in FSUIPC to get the device's keys to be recognized as buttons by FSUIPC.  I have it working within the internal IPConsol that SIOC uses to test code. However, the key strokes are not seen in Notepad or recognized by FSUIPC.

 

I am using the most recent version of SIOC and FSUIPC. I am running Prepar3D through Windows 10 Pro.

 

Can anyone help me?

 

John

Share this post


Link to post
Share on other sites

They work with Project Magenta's offsets or iFly offsets. but I don't know which offset to use in FSUIPC to get the device's keys to be recognized as buttons by FSUIPC.

 

Have you tried looking at the Offset list installed in your FSUIPC documents folder? Check offset 3340 in that document.

 

Or, probably better, find the standard offsets for the functions you require!

 

Pete

Share this post


Link to post
Share on other sites

First of all, thanks for the quick reply Peter. To answer your question, yes, I did look at the offset list. In fact, I have read the entire basic and advanced manuals several times. The problem is that I didn't know what to look for. Thanks for pointing me in the right direction.

 

John

Share this post


Link to post
Share on other sites

Peter or someone else who is knowledgeable with offsets,

 

Please bear with me. I am a 68 year old pilot who flew both GA and fighters in the USAF. I also studied Chemical engineering in college. However, I went to college before computers took over. I used a slide rule in college. All that is to let you know that I am NOT a programmer, except when forced to in cockpit building. I can copy and modify scripts...most of the time. I am much better at getting hardware to work and woodworking than programming software.

 

I looked up Offset 3340. However, I am afraid I do not understand all of the attributes I need to add after the FSUIPC_INOUT Offset $3340 part.

 

Could someone have sympathy on and old fool (for even attempting to do this stuff) and give me an example of programming one of the buttons. I believe that I can take it from there.

 

Also, I recall that in the early days there was a programming guide in the FSUIPC Documents folder. I couldn't find it with version 4.9?

 

Thanks,

 

John

Share this post


Link to post
Share on other sites

I looked up Offset 3340. However, I am afraid I do not understand all of the attributes I need to add after the FSUIPC_INOUT Offset $3340 part.

 

Could someone have sympathy on and old fool (for even attempting to do this stuff) and give me an example of programming one of the buttons. I believe that I can take it from there.

 

Also, I recall that in the early days there was a programming guide in the FSUIPC Documents folder. I couldn't find it with version 4.9?

 

 

Last point first -- programming is part of the SDK. There's never been any guide to using offsets apart from the offsets list.

 

I've no idea what can and can't be done in SIOC, nor how to program it. You really do need their support, not FSUIPC support.

 

The virtual button offsets are 36 bytes -- actually 9 x 32-bit words -- giving up to 288 "virtual buttons". Button presses are indicated by setting one of those 288 bits and releasing it by clearing that one bit.  Your SIOC thingy needs to be able to set and clear specific bits, i.e. offset xxxx (3340 onwards) with bit number n (0-7 for a 1-byte declaration, up to 0-31 for a 32 bit word.

 

If your SIOC documentation doesn't tell you that you can do this then maybe it can't be done. But, I'm sorry, SIOC is not my area. I know nothing about it, and it is THAT program you will need to understand.

 

Pete

Share this post


Link to post
Share on other sites

Thanks again Peter,

 

I am sure it can be done. It is done with Project Magenta and iFly. Here is part of the PM version of the script. It looks pretty straight forward. The problem is the FSUIPC offset are reserved for PM or iFly. running those scrips doesn't work unless I am using one of those applications. I have neither nor am I interested in flying that sort of simulator. I will read your SDK again and try and figure out the bit setting.

 

Thanks for responding.

 

John

 

Var 0001, name iocp_teclas

Var 0002, name teclado, Link IOCARD_KEYS, Device 22
{
if &teclado = 71 // menu
{
&k = 629
}
if &teclado = 79 // perf init
{
&k = 624
}
if &teclado = 78 // rte
{
&k = 625
}
if &teclado = 75 // des
{
&k = 628
}

............

 

var 5, name k, link subrutine
{
if &k <> 0
{
if &k = &tempk
{
&offsetk = &k + &shift
if &shift = 0
{
&shift = 2048
}
else
{
&shift = 0
}
}
else
{
&offsetk = &k
&tempk = &k
}
&k = 0
}
}

var 6, name tempk

var 8, name shift

Var 3000, Link FSUIPC_INOUT, name offsetk, Offset $5428, Length 2 // CDU Functions

Var 3010, name fmcLeds, Link FSUIPC_INOUT, Offset $052C, Length 2 // FMC LEDs
{
V3020 = TESTBIT V3010 ,0  // EXEC LED
V3030 = TESTBIT V3010 ,1  // MSG LED
V3040 = TESTBIT V3010 ,2  // FAIL
V3050 = TESTBIT V3010 ,3  // OFST
V3060 = TESTBIT V3010 ,4  // DSPY
}

Var 3020, Link IOCARD_OUT, name OUTPUT2, Device 22, Output 2  // FMC EXEC green led
Var 3030, Link IOCARD_OUT, name OUTPUT1, Device 22, Output 1  // FMC MSG amber led
Var 3040, Link IOCARD_OUT, name OUTPUT4, Device 22, Output 4  // FMC FAIL red led
Var 3050, Link IOCARD_OUT, name OUTPUT0, Device 22, Output 0  // FMC OFST amber led
Var 3060, Link IOCARD_OUT, name OUTPUT3, Device 22, Output 3  // FMC DSPY red led

Share this post


Link to post
Share on other sites

I am sure it can be done. It is done with Project Magenta and iFly. Here is part of the PM version of the script. It looks pretty straight forward. The problem is the FSUIPC offset are reserved for PM or iFly. running those scrips doesn't work unless I am using one of those applications. I have neither nor am I interested in flying that sort of simulator. I will read your SDK again and try and figure out the bit setting.

 

The SDK won't help you. All you need to know is what I told you before, that each bit on those offsets from 3340 on represents one button -- pressed when 1, released when 0. All you need to do is find out how to express that in SIOC terms. If their documentation doesn't tell you these things, I just hope someone who knows about SIOC will read this and help you, but I think you'll be far better off seeking help in places where there are more SIOC users. Have you not tried the MyCockpit forums at all? http://www.mycockpit.org/forums

 

Honestly, I don't know why you think FSUIPC documentation of any sort will help you program a completely different application. I cannot support you with SIOC, I know nothing about it.

 

Sorry,

Pete

Share this post


Link to post
Share on other sites

Because your program is magic . :)

 

I was reading your documentation when this came in.

 

Thank you for the advice.

 

John

Share this post


Link to post
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

×

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.