w6kd
Forum Member
Offline
Posts: 4
Santiago de Chile
Gender:
|
Marco;
I've already replaced the code...but during the debugging I wrote a short segment that displays (via FSUIPC offsets) the values returned from InsAutopilotControlState in real time (in the ADVDISPLAY window) each time the gauge is executed. essentially:
int INS1State, INS2State, INS3State;
INS1State = InsAutopilotControlState(INS_Unit_1); INS2State = InsAutopilotControlState(INS_Unit_2); INS3State = InsAutopilotControlState(INS_Unit_3);
IPC_Test = FSUIPC_Write(0x6D10, 4, &INS1State, &dwResult); IPC_Test = FSUIPC_Write(0x6D14, 4, &INS2State, &dwResult); IPC_Test = FSUIPC_Write(0x6D18, 4, &INS3State, &dwResult); FSUIPC_Process(&dwResult);
With the CIVA NavModeTriple gauge, I turned on the #1 INS. I saw this on the display:
6D10 = 0x1 6D14 = 0x0 6D18 = 0x0
Then I selected the #2 INS (without turning off the #1 INS first). The #1 INS switch returned to off, but this is what I saw on the display:
6D10 = 0x1 6D14 = 0x1 6D18 = 0x0
Then I selected the #3 INS. The #2 switch went to off, and the display said:
6D10 = 0x1 6D14 = 0x1 6D18 = 0x1
In this case all three INSs are reporting that they are connected via the InsAutopilotControlState call.
If I turn the switch off manually, the state returns to zero as it should.
What I did to solve my problem was to write a new NavModeTriple gauge that explicitly turns off the other INS units before turning on the selected one...this keeps the state values returned by the InsAutopilotControlState call in synch with the actual state.
Regards
Bob Scott ATP IMEL Gulfstream II-III-IV-V Santiago de Chile
|