Dataref subscribe and timers
Re: Dataref subscribe and timers
That only makes it more complex in my opinion.
I had a look at your script, but it doesn't make much sense to me
If you just explain what needs to happen then I'll make a small example.
I had a look at your script, but it doesn't make much sense to me
If you just explain what needs to happen then I'll make a small example.
Re: Dataref subscribe and timers
Yeah, I thought it may be confusing. Add to that my inexperience writing code and you probably have very inefficient code... but here’s what I’m trying to do:
I have an APU indicator on the EICAS.
When the APU switch is in OFF position (Dataref=0), It reads OFF
When the switch is turned to ON (Dataref=1), the indicator changes to yellow and blinks 5 times at a 0.5s rate, then remains steady.
When APU switch is turned to START (Dataref = 2 (temporary), it remains on until APU N1 = 95%, then I turns back green.
That’s what I’m trying to accomplish. Thanks for sticking with me!
I have an APU indicator on the EICAS.
When the APU switch is in OFF position (Dataref=0), It reads OFF
When the switch is turned to ON (Dataref=1), the indicator changes to yellow and blinks 5 times at a 0.5s rate, then remains steady.
When APU switch is turned to START (Dataref = 2 (temporary), it remains on until APU N1 = 95%, then I turns back green.
That’s what I’m trying to accomplish. Thanks for sticking with me!
Re: Dataref subscribe and timers
Okay that's a good description. I'll create a script tonight or tomorrow.
Re: Dataref subscribe and timers
Thanks Ralph. I forgot to list the last state, which may impact the script (although it is past the timer piece). Here’s a revised description:
I have an APU indicator on the EICAS.
When the APU switch is in OFF position (Dataref=0), It reads OFF in green.
When the switch is turned to ON (Dataref=1), the indicator changes to yellow and blinks 5 times at a 0.5s rate, then remains steady.
When APU switch is turned to START (Dataref = 2 (temporarily)) the indicator remains on and yellow until APU N1 = 95%, then it turns back green.
Since the START position is momentary, the Dataref will revert back to 1 while the APU spools-up and remains=1 while the APU is running (I.e. Dataref=1 and indicator is steady yellow until APU N1 >= 95% changes the annunciator back to green.
So the conditions I had identified are
If APU N1 = 0 and APU Starter = 0, the APU is OFF
If APU N1 = 0 and APU Starter = 1, the APU is in pre-start (blinking piece)
If APU N1 > 0 and APU Starter = 2, the APU is starting
If APU N1 > 0 and APU Starter = 1, the APU is running
I hope this helps.
Marco
I have an APU indicator on the EICAS.
When the APU switch is in OFF position (Dataref=0), It reads OFF in green.
When the switch is turned to ON (Dataref=1), the indicator changes to yellow and blinks 5 times at a 0.5s rate, then remains steady.
When APU switch is turned to START (Dataref = 2 (temporarily)) the indicator remains on and yellow until APU N1 = 95%, then it turns back green.
Since the START position is momentary, the Dataref will revert back to 1 while the APU spools-up and remains=1 while the APU is running (I.e. Dataref=1 and indicator is steady yellow until APU N1 >= 95% changes the annunciator back to green.
So the conditions I had identified are
If APU N1 = 0 and APU Starter = 0, the APU is OFF
If APU N1 = 0 and APU Starter = 1, the APU is in pre-start (blinking piece)
If APU N1 > 0 and APU Starter = 2, the APU is starting
If APU N1 > 0 and APU Starter = 1, the APU is running
I hope this helps.
Marco
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Dataref subscribe and timers
Hi Marco,
Did you check if there is a blink dataref for your bird?
I know that the zibo 737 800 has a "laminar/B738/autopilot/blink" dataref. Might be that your bird has something similar. That would be first prize before doing some coding to achieve what you want.
Keith
Did you check if there is a blink dataref for your bird?
I know that the zibo 737 800 has a "laminar/B738/autopilot/blink" dataref. Might be that your bird has something similar. That would be first prize before doing some coding to achieve what you want.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Dataref subscribe and timers
Hey Keith!
Thanks for the reply. I went back and checked and it actually does have such a dataref! I will see if I can use that - and see if I can spare from spending his evening trying to figure this out!
I'l report back as soon as I have news.
Thanks again, guys!
Marco
Thanks for the reply. I went back and checked and it actually does have such a dataref! I will see if I can use that - and see if I can spare from spending his evening trying to figure this out!
I'l report back as soon as I have news.
Thanks again, guys!
Marco
Re: Dataref subscribe and timers
I meant I hope to spare RALPH from spending the night working on a solution! (Although I’ll keep trying to figure out how to do it in code using standard datarefs anyway...)
M.
M.
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Dataref subscribe and timers
Hi Marco,
That is easy if you are blinking and image.
Here play around with this.
Keith
That is easy if you are blinking and image.
Here play around with this.
Code: Select all
my_image=img_add("my_image",x,y,w,h,)
function blink_callback(blk)
visible(my_image, blk==1)
end
xpl_dataref_subscribe(your_dataref,blink_callback)
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Dataref subscribe and timers
Keith - it works like a charm!
I feel so inadequate sometimes - my lack of acumen is revolting!
But - hey - I'm learning!
I'll post a video somewhere and share a link here soon. Here are some pics of my work in progress.
Thanks again!
Marco
I feel so inadequate sometimes - my lack of acumen is revolting!
But - hey - I'm learning!
I'll post a video somewhere and share a link here soon. Here are some pics of my work in progress.
Thanks again!
Marco
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Dataref subscribe and timers
Awesome Marco,
Glad you are winning.
Keith
Glad you are winning.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card