[simpits-tech] Lua example for David...

Gene Buckle geneb at deltasoft.com
Thu Jul 24 15:44:06 PDT 2008


>> -- Define our error constants
>> APUMasterFault = 1;
>> APUStartAvail = 2;
>> APUFlap = 3;
>> APUMaint = 4;
>> APULowPress = 5;
>> APUPumpFault = 6;
>> APUFault = 7;
>> APUGenBus = 8;
>
> So the above bits are assigned to the "APU_ERROR" single byte @ 5600 ?
>
Yes.

> So where do you define "APU_ERROR" = Offset at 5600 hex
Within the function editor in CIM.  You'll see that when I get a chance at 
Camtasia this week.  I've got 200 video pod kits to produce and that makes 
other things take a back seat.

>
> I am assuming "--" is used to comment a line
>
Yes

>> APUError = bit.tobits(CIM:GetNumericValue("APU_ERROR"));
>> -- APU_ERROR points to offset 5600
>> if APUError[APUMasterFault] == 1 then
>>    if CIM:GetOutputState("APU_MASTER_FAULT_LAMP") != 1 then
>
> != is that "Not equal to"?
>
> == "Equal to"
>
Yes.  Note that "=" is ASSIGNMENT and not an equality test.

>>      CIM:SetOutputChannel("APU_MASTER_FAULT_LAMP", 1)
>
> Set APU_MASTER_FAULT_LAMP to logic 1
>
Yes.

>>    end
>> else
>>    if CIM:GetOutputState("APU_MASTER_FAULT_LAMP") == 1 then
>>      CIM:SetOutputChannel("APU_MASTER_FAULT_LAMP", 0)
>
> Set APU_MASTER_FAULT_LAMP to logic 0
>
Yes.

There will be a separate analog output function called SetAnalogOutput() 
or something similar.  I'm waiting for hardware to test with right now. 
(Go USPS! *laughs*

g.

-- 
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.


More information about the Simpits-tech mailing list