Results 11 to 18 of 18
Thread: FSBUS comm radio
-
01-31-2016, 03:05 PM #11
- Join Date
- Jan 2012
- Location
- Bexleyheath,Kent UK
- Posts
- 102
Re: FSBUS comm radio
Ah ok
Now my memory is bad so I am not sure the best way to explain without getting really into the swing of things again but if memory serves this is "bitwise operations"
The state of the 8 bits held in the offset determine which lights are on/off...my description might be bad but this code works. clips from my CPP file
So taking you example of 9402 .
The remarked out (//) ones are entries ready for the correct CID/RID's where I have change my boards around
at the top where you declare stuff
// fwdoverhead.by John with masses of help from Ciccio
#define ZERO 0x01
#define ONE 0x02
#define TWO 0x04
#define THREE 0x08
#define FOUR 0x10
#define FIVE 0x20
#define SIX 0x40
#define SEVEN 0x80
#include "stdafx.h"
//Annunciators
//Offset9402
//MkFsbusObject (BTP_D_OUT, ANNUN_DUCT_OVEHEAT_1, "", EventHandlerFwdOverhead,X,XX,0); //CHANGE CID X AND XX CONNECTOR TO SUIT PANEL
// MkFsbusObject (BTP_D_OUT, ANNUN_DUCT_OVEHEAT_2, "", EventHandlerFwdOverhead,X,XX,0); //CHANGE CID X AND XX CONNECTOR TO SUIT PANEL
// MkFsbusObject (BTP_D_OUT, ANNUN_DUCT_OVEHEAT_2, "", EventHandlerFwdOverhead,X,XX,0); //CHANGE CID X AND XX CONNECTOR TO SUIT PANEL
MkFsbusObject (BTP_D_OUT, ANNUN_RAM_DOOR_FUEL_DOOR_1, "", EventHandlerFwdOverhead,8,32,0);
MkFsbusObject (BTP_D_OUT, ANNUN_RAM_DOOR_FUEL_DOOR_2, "", EventHandlerFwdOverhead,8,33,0);
MkFsbusObject (BTP_D_OUT, ANNUN_PACK_TRIP_OFF_1, "", EventHandlerFwdOverhead,8,55,0);
// MkFsbusObject (BTP_D_OUT, ANNUN_PACK_TRIP_OFF_2, "", EventHandlerFwdOverhead,X,XX,0); //CHANGE CID X AND XX CONNECTOR TO SUIT PANEL
MkFsbusObject (BTP_D_OUT, ANNUN_WING_BODY_OHEAT_1, "", EventHandlerFwdOverhead,8,52,0);
then further down the script the case statement to handle it
case FS_9402_ANNUNS:
// printf(" OFFSET 9402 READS ( %d )", Value);
// if (Value & ZERO ){ FsbusWrite(ANNUN_DUCT_OVEHEAT_1, 1);} //next board
// else if (Value | ZERO){FsbusWrite(ANNUN_DUCT_OVEHEAT_1, 0);} //next board
// if (Value & ONE ){ FsbusWrite(ANNUN_DUCT_OVEHEAT_2, 1);} //next board
// else if (Value | ONE){ FsbusWrite(ANNUN_DUCT_OVEHEAT_2, 0);} //next board
// if (Value & TWO ){ FsbusWrite(ANNUN_DUAL_BLEED,, 1);} //next board
// else if (Value | TWO){ FsbusWrite(ANNUN_DUAL_BLEED,, 0);} //next board
if (Value & THREE){FsbusWrite(ANNUN_RAM_DOOR_FUEL_DOOR_1, 1);} //CID 8
else if (Value | THREE){ FsbusWrite(ANNUN_RAM_DOOR_FUEL_DOOR_1, 0);} //CID 8
if (Value & FOUR ){ FsbusWrite(ANNUN_RAM_DOOR_FUEL_DOOR_2, 1);} //CID 8
else if (Value | FOUR){FsbusWrite(ANNUN_RAM_DOOR_FUEL_DOOR_2, 0);} //CID 8
if (Value & FIVE ){ FsbusWrite(ANNUN_PACK_TRIP_OFF_1, 1);}
else if (Value | FIVE){ FsbusWrite(ANNUN_PACK_TRIP_OFF_1, 0);}
// if (Value & SIX ){ FsbusWrite(ANNUN_PACK_TRIP_OFF_2, 1);} //NEXT PCB
// else if (Value | SIX){ FsbusWrite(ANNUN_PACK_TRIP_OFF_2, 0);} // NEXT PCB
if (Value & SEVEN ){FsbusWrite(ANNUN_WING_BODY_OHEAT_1, 1);} //CID 8
else if (Value | SEVEN){ FsbusWrite(ANNUN_WING_BODY_OHEAT_1, 0);} //CID 8
As I say I am a year out of practice (long story) so I may not be describing this very well hope to be in the swing of things over the next few months or so. (sorry If I am worsening things...)
Private me or contact me via the Ifly forum if you want any of my scripts.
JohnOld, tired & broke (shouldn't be allowed out really)
-
01-31-2016, 03:53 PM #12
- Join Date
- Jan 2012
- Location
- Bexleyheath,Kent UK
- Posts
- 102
Re: FSBUS comm radio
Further to your post..
The IAS (indicated air speed ) is the 'SPD' offset in ifly2fsuipc (offset 9436) the value held in that offset is the absolute value needed to show on the display and therefore there's no real relation to how we handle that like the bitwise stuff.
PM me !
JohnOld, tired & broke (shouldn't be allowed out really)
-
01-31-2016, 11:32 PM #13
- Join Date
- Jan 2015
- Location
- Brasil
- Posts
- 8
Re: FSBUS comm radio
John, you are being very helpful!
His explanation cleared my mind to understand a more enfeebled bitwise treatment of theseoffsets, but ideally be able to see a full part of your program, so you can better understandthe entire string, and put into practice here.
Unfortunately I do not have registration in Ifly Forum, but my email is sasazevedo@hotmail.com.
Strong hug.
Sergio.
-
02-01-2016, 12:07 PM #14
- Join Date
- Jan 2012
- Location
- Bexleyheath,Kent UK
- Posts
- 102
Re: FSBUS comm radio
Hi Sergio
I will zip them up and send them to you.
The only problem you might find is where I comment and remark things out ...This might not make much sense to you (my remarks don't even make sense to me now I revisit).
Also a lot of stuff that works just fine will be remarked out I do this when testing/writing new sections.
JohnOld, tired & broke (shouldn't be allowed out really)
-
02-01-2016, 01:53 PM #15
- Join Date
- Jan 2015
- Location
- Brasil
- Posts
- 8
Re: FSBUS comm radio
Hello again John.
Once again I say that your help is being very helpful, and I appreciate your goodwill.
The program that I made using the offsets default, was possible due to the examplesposted by Forum staff, and the good that, in addition to the fun, is the enrichment of learning being very good, because as I said, I'm not a professional programmer, I'm just anaviation lover with some knowledge in programming logic, which is trying to buildgradually his home cockpit.
Hug.
Sergio.
-
02-01-2016, 06:17 PM #16
- Join Date
- Jan 2012
- Location
- Bexleyheath,Kent UK
- Posts
- 102
Re: FSBUS comm radio
HI Sergio
Your email is bouncing??? Private message me.
JohnOld, tired & broke (shouldn't be allowed out really)
-
02-01-2016, 07:34 PM #17
- Join Date
- Jan 2015
- Location
- Brasil
- Posts
- 8
Re: FSBUS comm radio
John, eu não sei como enviar privado ...
Give meyouremail I will answer!
-
02-04-2016, 02:39 PM #18
Search Prettys Womans from your city for night
5.Sharing an Essay about PIC16F877