[simpits-tech] CIM programming to FSUIPC Offsets?
David C. Allen
allendc at qwest.net
Tue Jul 22 15:55:34 PDT 2008
At 03:02 PM 7/22/2008 -0700, you wrote:
> >> Do you mean code for the AC360 gauges? Not yet - I had forgotten to order
> >> interconnect hardware when I first got them and I place the part order
> >> yesterday.
> >
> > I think Leo drives his gauges with a 0 to 5vdc signal, and his gauge
> > converts that voltage to angular position.
> >
> > So I am using just the 0 to 5vdc analog out
> >
>Right, but you send it a value from 0 to 255 to specify the needle
>position because you're talking to an 8 bit DAC on the other end. (Leo, if
>you're monitoring - help me out if I'm wrong on the 0..255 value)
Yep that's what I was thinking, in your 8 bit example 255 = 5vdc out
and 0 = 0vdc out
I think they are 10 bit
>So your scale command would be some thing like this
>
>NeedlePos = CIM:Scale(0,500,0,255,Airspeed)
How are non-linear scales going to be handled?
>0..500 is the range the ASI can show, 0..255 is the range you can feed the
>DAC. The result should give you a pretty good needle position based on
>the airspeed value you fit into it.
>
> >> It'll go something like this though:
> >>
> >> Airspeed = CIM:GetNumericValue("AIRSPEED")
> >> NeedlePos = CIM:Scale(InMin, InMax, OutMin, OutMax, Airspeed)
> >> CIM:SetGauge("AIRSPEED", NeedlePos)
> >>
> >> GetNumericValue() would look up the value that matches the name "AIRSPEED"
> >> in whatever sim you're using and return it.
> >
> > How do you define the name "AIRSPEED" to FSUIPC offsets 02BC
> >
> > "02BC 4 IAS: Indicated Air Speed, as knots * 128 "
> >
>
>I'll give you an example from the configuration file. (I can't run MSFS
>right now to show you an example via screenshot)
>
><Parameter Key="COM1_FRQ" Offset="846" Size="2" VarType="2" Direction="2" />
<Parameter Key="AIRSPEED" Offset="02BC" Size="4" VarType="?" Direction="?" />
How do we find out the VarType for the airspeed FSUIPC data?
So is a read only a Direction="1"
David
More information about the Simpits-tech
mailing list