Results 51 to 55 of 55
-
06-26-2011, 04:45 AM #51
Re: Scaling Localiser and Glideslope Needles for HSI
Hi Jack,
I have good and bad news...
The bad news first:
It looks like Config_SIOC 'gets confused' while combining the two Var 0 codes. Normaly one only writes simple assignments in var 0 , not the IF statements you wrote. So maybe the Config_SIOC compiler is not capable of doing that (a bug I gues).
The good news:
When I had a look at your Var 0 code, I was wondering why you first give the motor a value and then test whether the motor has that value... Is not that always the case? I have simplified the glideslope part into:
Code:Var 0, Value 0 { &Motor_1 = 250 }
Code:Var 0, Value 0 { &Motor_5 = 250 }
regards,
Nico
-
06-26-2011, 05:43 AM #52
Re: Scaling Localiser and Glideslope Needles for HSI
Hi Nico,
I appreciate the Var 0 logic is confusing, allow me to explain.
At startup, SIOC does not know the value of the potentiometers (because they have not changed).
So, the Var 0 logic moves the motors one way, and then moves them the other way.
This changes the Potentiometer vars, allowing SIOC to get their values. Otherwise, SIOC does not know the Potentiometer values and the motors just stay still, as no further logic is executed.
Unfortunately, I cannot use your style of logic (ie JUST "motor = 250" or "motor = 120"). This is because, for example, if the Localiser motor was all the way to the left, and we tell it to move 120 (ie to the left some more), it will obvious not be able to move any more.
If you can think of a better way to read the Potentiometer values at startup that would be great.
Cheers,
Jack
-
06-26-2011, 05:51 AM #53
Re: Scaling Localiser and Glideslope Needles for HSI
Jak,
I do not understand, sorry (I have no experience with reading pot meters).
I recommend to combine these two files manually into one localiser_glideslope file, in order to program around the Config_SIOC bug.
And please report this bug to Opencockpits.
Regards,
Nico
-
06-26-2011, 06:06 AM #54
Re: Scaling Localiser and Glideslope Needles for HSI
Hi Jack,
Here a better idea. I have put the init code in a separate routine called from Var 0. Now the compiler does not get confused...
Code:Var 0, Value 0 { CALL &Init1 } Var 52 name Init1 Link SUBRUTINE { &Motor_1 = 120 IF &Motor_1 = 120 { &Motor_1 = 250 } }
Code:Var 0, Value 0 { CALL &Init2 } Var 7500 name Init2 Link SUBRUTINE { &Motor_5 = 120 IF &Motor_5 = 120 { &Motor_5 = 250 } }
-
07-12-2011, 02:38 PM #55
Re: Scaling Localiser and Glideslope Needles for HSI
Hi Nico,
So sorry that I did not see your new post until now.
The Subroutine is a great idea; I shall implement it ASAP.
Regards,
Jack
Candid connections: Platform for casual relationships Live Women Prime Сasual Dating
Super Сasual Dating - Genuine...