Cockpitbuilders.com

Main => Builders Discussions => Topic started by: HondaCop on September 14, 2010, 08:33:47 AM

Title: CTS288 encoder on Opencockpits IOCard?
Post by: HondaCop on September 14, 2010, 08:33:47 AM
Hello guys,

I am building my EFIS set and I have everything already programmed via SIOC and working, EXCEPT the encoders for the MINS and BARO settings.

I have an Opencockpit USB expansion card with 2 mastercards connected to it. One of the mastercards has an input connector with the encoder card attached to it.

I just have no idea on how do I wire the encoders to the inputs on the mastercard. On the Opencockpits site it says that if you have CTS288 encoders, you don't even need to use an encoder card and can simply connect the encoders directly to the inputs on the mastercard (it will use 2 inputs per encoder). I am going this route because one less thing to worry about (encoder card), but I have no idea how I would program the encoder via SIOC.

Can anyone help me out a bit? I'm a quick learner. ;-)

BTW, I didn't even bother to ask on the OC site because I will have to wait weeks for the first reply.
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: fordgt40 on September 14, 2010, 09:27:11 AM
Efrain

The common pin on the encoder goes to one of the input grounds and the other two pins to adjacent inputs within the same gnd/input set on the breakout board
I list below my sioc code for the EFIS hooked up to the SA package, which I believe you use. The latest version of SA has tinkered with the logic on the Baro, and this code predates it, so you might have to do some amendments but at least this example should help you understand the encoder programming

Regards

David

Edit ( I will repost the sioc code shortly)
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: HondaCop on September 14, 2010, 09:50:54 AM
Hi David,

I did the changes necessary and now I see the altimeter incrementing but with a couple of issues:

1. It will increment on the default FSX B737's panel, but not on the SA display.
2. It increments in .03 steps. Is this normal?

I see you said you will be updting the code shortly, so you probably will fix it before I even finish asking! LMAO!
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: fordgt40 on September 14, 2010, 10:22:05 AM
Hi Efrain

I seem to have lost the efis file I was looking for - that will cause me some grief!!

Anyway here is a snippet of code that "should" work


Var 30, name E_BARO, Link IOCARD_ENCODER, Input 30, Aceleration 1, Type 2
{
L0 = &E_BARO * -1
&SUB_BAR = &SUB_BAR + L0
}


Var 31, name SUB_BAR, Link SUBRUTINE
{
L0 = &SUB_BAR * 16
&FS_QNH = L0
}



Var 32, name FS_QNH, Link FSUIPC_OUT, Offset $(to match your sa entry in the fsuipc.io file), Length 2 // FS_QNH_MB

Re your latest post, you must tell SA that the value is changing by passing the revised value to the offset you have allocated in the FSUIPC.IO.INI file. It sounds as if you are writing the value directly to the FSUIPC offset. Sorry, but it is a while since I used the h/w efis (too busy building), but if you try the sa software efis then that should show you the value incs/decs

Hope this helps

David
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: HondaCop on September 14, 2010, 10:27:25 AM
David,

It worked perfectly, but I had to delete the *16 from the subroutine. I believe we have to delete that now, since the newest build of SA. Works like a charm now.

Don't flip out now, but do you have the SIOC code for the MINS DH encoder settings? =P
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: fordgt40 on September 14, 2010, 10:36:37 AM
Efrain

Here you are below, though there is something wrong, as the code is writing to a Project Magenta offset >:( That was why I was trying to find my corrected file, without success. Anyway, try changing the PM_DH offset to a SA one with matching change in the FSUIPC.IO.INI file

Var 0, value 0
{
&SUB_DH = 3000
}


Var 5602, name E_MIN, Link IOCARD_ENCODER, Input 22, Aceleration 1, Type 2
{
L0 = &E_MIN * 100
&SUB_DH = &SUB_DH + L0
}

Var 1000, name SUB_DH, Link SUBRUTINE
{
IF &SUB_DH > 20000
{
&SUB_DH = 20000
}
IF &SUB_DH < 0
{
&SUB_DH = 0
}
L0 = DIV &SUB_DH ,100
&PM_DH = L0
}

Var 1203, name PM_DH, Link FSUIPC_OUT, Offset $04FA, Length 2 // PM_EFIS_D
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: HondaCop on September 14, 2010, 10:49:05 AM
Worked perfectly, David!!!!!  ;D My Captain EFIS is completely programmed! Thanks a million, buddy.
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: fordgt40 on September 14, 2010, 11:20:22 AM
Efrain

That is great news and I am delighted to be of use.

Regards

David
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: HondaCop on September 14, 2010, 11:30:13 AM
David, you wouldn't happen to be able to recommend me a good FSX B737-800 to use with SimAvionics? I posted a new thread on the subject.
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: fordgt40 on September 14, 2010, 11:48:11 AM
Efrain

Sorry, but I have been too busy building to bother greatly about the flight models. However, perceived wisdom is that the PMDG is the best AND it is possible to use a cut down FS9 PMDG flight model on FSX. It was discussed briefly on either this forum or Mycockpit - might be worth doing a search

David
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: HondaCop on September 14, 2010, 11:56:03 AM
Will do, thanks!

BTW, I've read that the FS9 PMDG 737-700 can be used on FSX. Using the -700 instead of an -800 has no adverse effect on Sim-Avionics, as far as you know?
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: fordgt40 on September 14, 2010, 12:07:36 PM
Quote from: HondaCop on September 14, 2010, 11:56:03 AM
Using the -700 instead of an -800 has no adverse effect on Sim-Avionics, as far as you know?

Efrain

Would not have thought so

David
Title: Re: CTS288 encoder on Opencockpits IOCard?
Post by: HondaCop on September 14, 2010, 12:21:03 PM
Sweet, thanks again.