-
Re: Progamming help with FSBus dll
Sorry Stefan, excuse my ignorance, but where do I put this, and what do I do with it.
I understand it is to test the analog out.
Do I need to declare C_Tastanalogout
Do I need to declare C_Testpoti
Do I need to MkFsbusObject
Do I need to MkFSObject
When you say Poti, are you talking about a potentiometer, if so is it possible to have Analog in on port 80 and Analog out on port 87 because I understood that you couldn't have analog out if you have any analog in.
Appreciate if you could take me through step by step.
As you've probably gathered, I know about as much about C++ or C as you could learn in 2 weeks without reading any books.
David
-
Re: Progamming help with FSBus dll
That was only an sample.
You can use your own objekts.
I dont see any Problems in the Docu with a mix of Analog In and Analog Out.
Step by Step:
Find a definied data source. (Potentiometer, encoder, value entry in the Application)
Make all necessary hardware changes.
Declare and build all Objekts.
Write the code like my sample, in case of an encoder you need additional a variable and the add calculation. (x +=val; )
Stefan
-
Re: Progamming help with FSBus dll
Ok, I'm up for the challange.
I might try a value entry in the application.
How do I MkFSObject without an offset, or do I not need to MkFsObject.
MkFsbusObject (BTP_A_OUT,C_TESTANALOGOUT,"This is a test",cbVoltmeters,27,85);
case C_Testpoti:
int val;
val = enter set value here?;
FsbusWrite(C_TESTANALOGOUT, val);
break;
Then define C_Testpoti and define C_TESTANALOGOUT IN stdaft.h
Will this do it if I enter different values in the val = ? part?
-
Re: Progamming help with FSBus dll
NO.
first: you put them into a case that means only on an event of the right OID that would do. but without nothing work.
second: val is the vaiable lable of the OID value. you donīt need to gerate them.
last time you ask about encoders. use them.
Stefan
-
Re: Progamming help with FSBus dll
Ok,
maybe you can guide me a bit further.
I have a rotary encoder setup and configured on Digital IN CID27,RID32
I have a voltmeter setup and configured on Analog OUT 27,87
Can you write for me what I need to get the encoder to move the needle.
How will I then see what the numbers are for the encoder - print function?
Hope you can do this for me, my head is starting to hurt.
-
Re: Progamming help with FSBus dll
Just an update for anyone using this thread as an information source.
The rotary encoders are now working great, and the voltmeters are also working great.
Here were my problems (mistakes):
When you configure the DIO board for rotary encoders or analog out, the jumper J16 must be set in the same way as for giving the board the CID number.
The problem with getting the voltmeters to work using the calibrate function is totally my fault. In the array table, I used ( ) brackets instead of { } brackets. Now they all work fine.
So I now have working: Voltmeter (amps), Left and Right Fuel Gauges, Fuel Pressure, Oil Pressure and Oil Temp. It's great to see them working perfectly.
For my next adventure, I will start programming the radios: Nav1, Nav2, Com1, Com2
David
-
Re: Progamming help with FSBus dll
Stefan,
Another question for you.
I am programming my ADF, simple 5 digit display, and a rotary encoder.
In the example that came with FSBus dll V1, there is an example under nav.cpp
I have copied this over to my files, made the change for MkFsObject from MakeFsObject, put in my DIO board for the rotary encoder ie: 27,32
put in the display card, 14,0
I am getting no change in the ADF using the rotary encoder, and I am getting nothing on the display.
I tested the display, it is working fine, and we tested the rotary encoder with your program and it's working fine.
Is there something else that needs to be changed in order for it to work in FSbus V2?
Appreciate your thoughts.
David
-
Re: Progamming help with FSBus dll
Hi,
as far as I can remember me the ADF never work in the sample files.
Stefan
-
Re: Progamming help with FSBus dll
That's a shame, I thought I could just copy it over and it would work straight out of the box. But then again, I have found out that nothing works straight out of the box with programming.
Any thoughts on what needs to be changed to get it to work?
Did Rob have any luck?
Dirk is building a Cessna, perhaps he has had some luck.
Thanks
David
-
Re: Progamming help with FSBus dll
to think you copy a part from the sample and you have a finished solution is the compleatly wrong way.
That are only early samples, they have big bugs.
At Robs code you have a finished working ADF.
Btw. a ADF with only 1 Encode will drive you crazy.
Stefan
-
Re: Progamming help with FSBus dll
Ok, that explains why it doesn't work.
I will have another look at Rob's code. He seems to use a different format for his coding and I've found it a little difficult to work out.
Also, my rotary encoders have a momentary switch when you push the knob. I have read somewhere that it is possible to convert it to a dual encoder by using this switch ie: tune the main three digits, push the knob and then tune the decimal places.
Is this possible?
Thanks
David
-
Re: Progamming help with FSBus dll
Hi,
what you mean with "He seems to use a different format for his coding "?
with the pushbutton is a possible way.
Stefan
-
Re: Progamming help with FSBus dll
Rob uses "Eventhandler" a lot and I don't understand it. It's just my lack of knowledge.
His method of defining is different to how I've been laying out my code. His seems quite advanced compared to my 'learning' code.
How can it be done with the rotary encoder with the push switch?
I will go though Rob's code later today to see if I can pull out the right info.
David
-
Re: Progamming help with FSBus dll
The "EventHandler" is the highest Funktion in Robs code.
The Type of defining is more effektive, btw. we dont use Groups with 32 Objects. Our groups have 256 objekts.
Your Encoder is only an normal Encoder and a normal push button, nothing special. You have too make Code for the Mode Switching and rotation.
Stefan
-
Re: Progamming help with FSBus dll
I've done lots of trial and error using the EventHandler with no success so I've rebuilt Rob's code in the format I've got used to.
I have had reasonable success as such. Rob uses 3 encoders ie: 1, 10,100.
If I assign my rotary encoder (1 at a time to test) to each, it moves my display as it should, but doesn't move the display on the screen. If I change the numbers on the screen with my cursor, the numbers in my display also change.
It appears the encoder is writing correctly to Fsbus, but not to FS and FS is writing to Fsbus correctly.
I'll attache the code and if you get a chance, could you take a look and see what I've missed.
Also, I have no idea how to put together the code for the mode switching and rotation so I'd love some help there too if possible.
I'll just post the case part:
Code:
void cbNav (int oid, int val, double dval)
{
int x;
switch (oid)
{
/*----------------------- ADF Events ----------------------*/
case FS_ADF1FREQUENCY:
ADF1 = (ADF1 / 10000) * 10000 + BCD2Int(val) * 10 + ADF1 % 10;
FsbusWrite(C_DADF1, ADF1);
if (bSynchronised == false)
{
FsbusWrite(C_DADF1, ADF1);
}
break;
case FS_EXTENDEDADF1:
ADF1 = BCD2Int(val >> 8) * 10000 + ((ADF1/10)%1000)*10 + BCD2Int(val & 0x00FF);
FsbusWrite(C_DADF1, ADF1);
if (bSynchronised == false)
{
FsbusWrite(C_DADF1, ADF1);
}
break;
case C_RADF_100:
x = ADF1 / 1000; // hundreds
x = x + val; // update 100s
if (x > 17)
x = 1; // wrap
elseif (x < 1)
x = 17; // wrap
ADF1 = x * 1000 + ADF1 % 1000; // new 100s
FsbusWrite(C_DADF1, ADF1);
FsWrite(C_DADF1, ADF1);//***ADDED THIS MYSELF TO SEE IF I COULD GET IT TO WRITE TO FSX
break;
case C_RADF_10:
x = (ADF1 % 1000) / 10; // tens + units
x = x + val; // update 10s
if (x > 99)
x = 0; // wrap
elseif (x < 0)
x = 99; // wrap
ADF1 = (ADF1 / 1000) * 1000 + x * 10 + ADF1 % 10; // new 10s
FsbusWrite(C_DADF1, ADF1);
break;
case C_RADF_1:
x = ADF1 % 10; // .1 units
x = x + val; // update 10s
if (x > 9)
x = 0; // wrap
elseif (x < 0)
x = 9; // wrap
ADF1 = (ADF1 / 10) * 10 + x;
FsbusWrite(C_DADF1, ADF1);
break;
}
}
Thanks again,
David
Update: I have changed FsWrite(C_DADF1, ADF1); to FsWrite(FS_ADF1FREQUENCY, ADF1) as of course C_DADF1 is not an FS Object and now it is writing to FSX but random numbers. In FSInterrogate, it is making random hexidecimal numbers. If I leave the FSWrite out, my display moves perfectly when I move the encoder, but when I add the FSWrite in, it become random. Any ideas?
-
Re: Progamming help with FSBus dll
Hi,
that is my ADF Code.
Btw. ADF need 2 FSUIPC Offset.
Code:
/*
adf1_dec and adf1_fra are
static int variables (read/write from the corresponding fsuipc offsets)
*/
static int adf1_dec;
static int adf1_fra;
MkFsObject(FS_EXTENDEDADF1,"",EventHandler,0x0356, 2,TP_UI16,FS_NORMAL);
MkFsObject(FS_ADF1FREQUENCY,"",EventHandler,0x034C, 2,TP_UI16,FS_NORMAL);
case FS_ADF1FREQUENCY:
ADF1 = (ADF1 / 10000) * 10000 + BCD2Int(val) * 10 + ADF1 % 10;
FsbusWrite(CD_ADF_1, ADF1);
if (bSynchronised == false)
{
ADF1Stb = ADF1;
FsbusWrite(CD_ADF_1, ADF1Stb);
}
break;
case FS_EXTENDEDADF1:
ADF1 = BCD2Int(val >> 8) * 10000 + ((ADF1/10)%1000)*10 + BCD2Int(val & 0x00FF);
FsbusWrite(CD_ADF_1, ADF1);
if (bSynchronised == false)
{
ADF1Stb = ADF1;
FsbusWrite(CD_ADF_1, ADF1Stb);
}
break;
case CR_ADF_100:
x = ADF1Stb / 1000; // hundreds
x = x + val; // update 100s
if (x > 17)
x = 1; // wrap
else if (x < 1)
x = 17; // wrap
ADF1Stb = x * 1000 + ADF1Stb % 1000; // new 100s
FsbusWrite(CD_ADF_1, ADF1Stb);
x = Int2BCD(ADF1Stb);
FsWrite(FS_EXTENDEDADF1, ((x & 0x0F0000) >> 8) | (x & 0x00000F));
FsWrite(FS_ADF1FREQUENCY, (x & 0x00FFF0) >> 4);
break;
case CR_ADF_10:
x = (ADF1Stb % 1000) / 10; // tens + units
x = x + val; // update 10s
if (x > 99)
x = 0; // wrap
else if (x < 0)
x = 99; // wrap
ADF1Stb = (ADF1Stb / 1000) * 1000 + x * 10 + ADF1Stb % 10; // new 10s
FsbusWrite(CD_ADF_1, ADF1Stb);
x = Int2BCD(ADF1Stb);
FsWrite(FS_EXTENDEDADF1, ((x & 0x0F0000) >> 8) | (x & 0x00000F));
FsWrite(FS_ADF1FREQUENCY, (x & 0x00FFF0) >> 4);
break;
case CR_ADF_1:
x = ADF1Stb % 10; // .1 units
x = x + val; // update 10s
if (x > 9)
x = 0; // wrap
else if (x < 0)
x = 9; // wrap
ADF1Stb = (ADF1Stb / 10) * 10 + x;
FsbusWrite(CD_ADF_1, ADF1Stb);
x = Int2BCD(ADF1Stb);
FsWrite(FS_EXTENDEDADF1, ((x & 0x0F0000) >> 8) | (x & 0x00000F));
FsWrite(FS_ADF1FREQUENCY, (x & 0x00FFF0) >> 4);
break;
so now with Push Buttons.
Fast freestyle not tested.
Code:
/*
adf1_dec and adf1_fra are
static int variables (read/write from the corresponding fsuipc offsets)
*/
static int adf1_dec;
static int adf1_fra;
static int adfmode=0;
MkFsbusObject (BTP_ROTARY, CR_ADF,"",EventHandler, 27,32);
MkFsbusObject (BTP_D_IN, C_ADFPush,"",EventHandler, 4, 55);
MkFsObject(FS_EXTENDEDADF1,"",EventHandler,0x0356, 2,TP_UI16,FS_NORMAL);
MkFsObject(FS_ADF1FREQUENCY,"",EventHandler,0x034C, 2,TP_UI16,FS_NORMAL);
case FS_ADF1FREQUENCY:
ADF1 = (ADF1 / 10000) * 10000 + BCD2Int(val) * 10 + ADF1 % 10;
FsbusWrite(CD_ADF_1, ADF1);
if (bSynchronised == false)
{
ADF1Stb = ADF1;
FsbusWrite(CD_ADF_1, ADF1Stb);
}
break;
case FS_EXTENDEDADF1:
ADF1 = BCD2Int(val >> 8) * 10000 + ((ADF1/10)%1000)*10 + BCD2Int(val & 0x00FF);
FsbusWrite(CD_ADF_1, ADF1);
if (bSynchronised == false)
{
ADF1Stb = ADF1;
FsbusWrite(CD_ADF_1, ADF1Stb);
}
break;
case C_ADFPush:
if(val==0)
{
adfmode+=1;
if (adfmode>2)
adfmode=0;
}
break;
case CR_ADF:
if (adfmode==0)
{
x = ADF1Stb / 1000; // hundreds
x = x + val; // update 100s
if (x > 17)
x = 1; // wrap
else if (x < 1)
x = 17; // wrap
ADF1Stb = x * 1000 + ADF1Stb % 1000; // new 100s
FsbusWrite(CD_ADF_1, ADF1Stb);
x = Int2BCD(ADF1Stb);
FsWrite(FS_EXTENDEDADF1, ((x & 0x0F0000) >> 8) | (x & 0x00000F));
FsWrite(FS_ADF1FREQUENCY, (x & 0x00FFF0) >> 4);
}
if (adfmode==1)
{
x = (ADF1Stb % 1000) / 10; // tens + units
x = x + val; // update 10s
if (x > 99)
x = 0; // wrap
else if (x < 0)
x = 99; // wrap
ADF1Stb = (ADF1Stb / 1000) * 1000 + x * 10 + ADF1Stb % 10; // new 10s
FsbusWrite(CD_ADF_1, ADF1Stb);
x = Int2BCD(ADF1Stb);
FsWrite(FS_EXTENDEDADF1, ((x & 0x0F0000) >> 8) | (x & 0x00000F));
FsWrite(FS_ADF1FREQUENCY, (x & 0x00FFF0) >> 4);
}
if (adfmode==1)
{
x = ADF1Stb % 10; // .1 units
x = x + val; // update 10s
if (x > 9)
x = 0; // wrap
else if (x < 0)
x = 9; // wrap
ADF1Stb = (ADF1Stb / 10) * 10 + x;
FsbusWrite(CD_ADF_1, ADF1Stb);
x = Int2BCD(ADF1Stb);
FsWrite(FS_EXTENDEDADF1, ((x & 0x0F0000) >> 8) | (x & 0x00000F));
FsWrite(FS_ADF1FREQUENCY, (x & 0x00FFF0) >> 4);
}
break;
EDIT: you have to make some variabels that i have used.
static int ADF1 = 0; // binary, units 0.1 KHz
static int ADF1Stb = 0; // binary, units 0.1
good luck
Stefan
-
Re: Progamming help with FSBus dll
Stefan,
Great. This works almost perfect.
I think it is mode 1. the 10s, 1s and .1s ie: 1448.8 (48.8) Hope this explains what I mean.
The 48 increments correctly but the .8 increments with the 8 ie: 48.8, 49.9, 50.0, 51.1.
I'm sure it's probably a little change, but other than that it works. Writes to Fsbus and FSX and FSX writes correctly to Fsbus.
Just a thought, it is possible to have mode 0, mode 1 and mode 2 (so there are three clicks ie: mode 0 for thousands and hundreds, mode 1 for tens and ones, and mode 2 for the .1 to .9)
So this is what I have now with the minor mods to keep in line with my methodology:
Code:
staticint ADF1 = 0; // binary, units 0.1 KHz
staticint ADF1Stb = 0; // binary, units 0.1
/*
adf1_dec and adf1_fra are
static int variables (read/write from the corresponding fsuipc offsets)
*/
staticint adf1_dec;
staticint adf1_fra;
staticint adfmode=0;
void cbNavBuildObjects()
{
MkFsbusObject (BTP_ROTARY, C_RADF,"",cbNav, 27,32);
MkFsbusObject (BTP_D_IN, C_ADFPush,"",cbNav, 27, 16);
MkFsbusObject(BTP_DISPLAY, C_DADF_1, "",cbNav, 14, 0);
DisplayOptions(C_DADF_1,5,0,TRUE,2);
MkFsObject(FS_EXTENDEDADF1,"",cbNav,0x0356, 2,TP_UI16,FS_NORMAL);
MkFsObject(FS_ADF1FREQUENCY,"",cbNav,0x034C, 2,TP_UI16,FS_NORMAL);
}
void cbNav (int oid, int val, double dval)
{
int x;
switch (oid)
{
case FS_ADF1FREQUENCY:
ADF1 = (ADF1 / 10000) * 10000 + BCD2Int(val) * 10 + ADF1 % 10;
FsbusWrite(C_DADF_1, ADF1);
if (bSynchronised == false)
{
ADF1Stb = ADF1;
FsbusWrite(C_DADF_1, ADF1Stb);
}
break;
case FS_EXTENDEDADF1:
ADF1 = BCD2Int(val >> 8) * 10000 + ((ADF1/10)%1000)*10 + BCD2Int(val & 0x00FF);
FsbusWrite(C_DADF_1, ADF1);
if (bSynchronised == false)
{
ADF1Stb = ADF1;
FsbusWrite(C_DADF_1, ADF1Stb);
}
break;
case C_ADFPush:
if(val==0)
{
adfmode+=1;
if (adfmode>2)
adfmode=0;
}
break;
case C_RADF:
if (adfmode==0)
{
x = ADF1Stb / 1000; // hundreds
x = x + val; // update 100s
if (x > 17)
x = 1; // wrap
elseif (x < 1)
x = 17; // wrap
ADF1Stb = x * 1000 + ADF1Stb % 1000; // new 100s
FsbusWrite(C_DADF_1, ADF1Stb);
x = Int2BCD(ADF1Stb);
FsWrite(FS_EXTENDEDADF1, ((x & 0x0F0000) >> 8) | (x & 0x00000F));
FsWrite(FS_ADF1FREQUENCY, (x & 0x00FFF0) >> 4);
}
if (adfmode==1)
{
x = (ADF1Stb % 1000) / 10; // tens + units
x = x + val; // update 10s
if (x > 99)
x = 0; // wrap
elseif (x < 0)
x = 99; // wrap
ADF1Stb = (ADF1Stb / 1000) * 1000 + x * 10 + ADF1Stb % 10; // new 10s
FsbusWrite(C_DADF_1, ADF1Stb);
x = Int2BCD(ADF1Stb);
FsWrite(FS_EXTENDEDADF1, ((x & 0x0F0000) >> 8) | (x & 0x00000F));
FsWrite(FS_ADF1FREQUENCY, (x & 0x00FFF0) >> 4);
}
if (adfmode==1)
{
x = ADF1Stb % 10; // .1 units
x = x + val; // update 10s
if (x > 9)
x = 0; // wrap
elseif (x < 0)
x = 9; // wrap
ADF1Stb = (ADF1Stb / 10) * 10 + x;
FsbusWrite(C_DADF_1, ADF1Stb);
x = Int2BCD(ADF1Stb);
FsWrite(FS_EXTENDEDADF1, ((x & 0x0F0000) >> 8) | (x & 0x00000F));
FsWrite(FS_ADF1FREQUENCY, (x & 0x00FFF0) >> 4);
}
break;
}
}
-
Re: Progamming help with FSBus dll
Ok, worked out what was wrong, there were two instances of mode 1, I changed the second to mode 2 and now it works like it should.
Yee haa.
Thanks as always Stefan.
I'm now going to try to do this with the Nav1
David
-
Re: Progamming help with FSBus dll
Just completed the NAV1 radio. Use the mode method you gave me and it works great, swap works so all is good.
Just can't find an offset for the test button (not that is important).
-
Re: Progamming help with FSBus dll
That is right, this funktion dosenīt work on FS.
-
Re: Progamming help with FSBus dll
Hi Stefan,
Back again. Everything is going great.
I have started on the xponder.
My set us uses 4 on-off-on self centering switches for the four digits, one for each digit (push up for up one number and press down for down one number), (hope that makes sense).
I have a 12 position rotary switch which I use for: Off, SBY, ON, ALT, TEST.
What do I need to change in Rob's (it's probably your code) code to achieve this.
Oh, another thing, I have a single LED as an on indicator.
Appreciate your help once again.
David
Here's Rob's code
Code:
case FS_TRANSPONDERSETTING:
Expdr = BCD2Int(val);
FsbusWrite (C_DXPNDR, Expdr);
break;
case C_RXPNDRL:
if (val > 0)
{
Expdr += 1000;
if ((Expdr % 10000) > 7777)
Expdr -= 8000;
}
else
{
Expdr += 100;
if ((Expdr % 1000) > 777)
Expdr -= 800;
}
FsbusWrite(C_DXPNDR, Expdr);
x = Int2BCD(Expdr);
FsWrite(FS_TRANSPONDERSETTING, x);
break;
case C_RXPNDRR:
if (val > 0)
{
Expdr += 10;
if ((Expdr % 100) > 77)
Expdr -= 80;
}
else
{
Expdr += 1;
if ((Expdr % 10) > 7)
Expdr -= 8;
}
FsbusWrite(C_DXPNDR, Expdr);
x = Int2BCD(Expdr);
FsWrite(FS_TRANSPONDERSETTING, x);
break;
case C_SXPNDRIDENT://this would be off?
break;
case C_SXPNDRCTRL1://this would be sby?
break;
case C_SXPNDRCTRL2://this would be on?
break;
case C_SXPNDRCTRL3://this would be alt?
break;
case C_SXPNDRCTRL4://this would be test?
break;
case C_SXPNDRCTRL5:
break;
-
Re: Progamming help with FSBus dll
hi,
to change Robs code make no sence, you idea is completly different to Robs solution. Robs code have only the up way, not the down direction.
You have to make your own solution.
Stefan
-
Re: Progamming help with FSBus dll
Hi Stefan,
Thanks for your comments.
I think I will have to redesign my transponder. I built this a long time ago from someone elses idea.
I will have to get the old cnc machine out again.
Am I correct:
Rob's code is based on 1 rotary encoder
A 5 position rotary switch (for OFF, STBY, ON, ALT, TEST)
It is a 5 7-segment display (not 4 like mine is)
Regards
David
-
Re: Progamming help with FSBus dll
no:
4 Digits
a 5 position switch (you can use what you want)
and 2 Encoder each for two digits, turn left the left digit goes up, turn right the right goes up.
Stefan
-
Re: Progamming help with FSBus dll
Thanks Stefan.
I should be able to use the same encoders that I've used for the Nav1 and use the mode technique you have shown me so that I only have to use one rotary encoder.
Does that sound right?
Regards
David
-
Re: Progamming help with FSBus dll
Yes that is possible, but dont think that is a useable solution.
Stefan
-
Re: Progamming help with FSBus dll
Just come to the realisation that there are no offsets for the OFF, STBY, ON, ALT or test, so it was a pointless exercise.
I've gone back to basics, I've pulled two of the switches out and converted the holes to fit the rotary encoders, so now I have the same layout as Rob uses ie: 2 rotary encoders, 4 digits and a dummy 5 position switch.
The code compiles so that's a good sign. I just need to wire it all up to test.
When I'm done with the coding, I will be giving the uncompiled project to anyone who wants to build a cessna cockpit using FSBus dll. Hope no one minds (I'm sure no one does).
David
-
Re: Progamming help with FSBus dll
Stefan,
Can you check my parts list for the Stepper Board. It is very hard to read off of the documentation:
1 SMD AtMega168
1 L293D DIN
R1 47k
R2 3k3
R3 100
R4 220
C1 100n
C2 100p
C3 can't see this one. Looks like 100n
C4 22p
C5 22p
D1 1N418
Q1 8MHz
SMD LED
Thanks
David
-
Re: Progamming help with FSBus dll
C2 = 100uF
C3 = 100nF
2 thinks for information.
If you need the "motor breaks when idel" the l293D become realy hot, you need a big passiv cooler.
My Stepper work only in the AdminTool in my C code i nevver had a movement.
Stefan
-
Re: Progamming help with FSBus dll
How are you going to get around this.
Does that mean you can't get it to work with the C++ coding?
I need to make 4 of these boards to drive my altitude indicator, 2 for the ADF/RMI and Gyro compass. I don't really have an alternative to drive these.
Has Rob has success in programming the boards in C++.
-
Re: Progamming help with FSBus dll
Quote:
Originally Posted by
RobiD
Does that mean you can't get it to work with the C++ coding?
Right!
Quote:
Originally Posted by
RobiD
Has Rob has success in programming the boards in C++.
I dont know, nobody give me an arnswer.
Stefan
-
Re: Progamming help with FSBus dll
Hi Stefan,
This will probably sound like a silly question, but here goes.
I have programmed in the Inner, middle and outer marker lights (IMO lights).
I want to test them, but I can't get the IMO lights to work in fsx (not the programmed ones, but the actual ones on the screen). I have tried many different airports, approached from at least 4nm out to get the outer marker, but they just don't work.
I have also tried with the VOR frequency dialled in for that specific airport but no go.
I am missing something that makes these lights work.
I have flown so many times and these lights have worked so many times before but when I want them to light up so I can test my coding, nothing.
Appreciate your input on this.
David
-
Re: Progamming help with FSBus dll
Quote:
Originally Posted by
RobiD
I want to test them, but I can't get the IMO lights to work in fsx (not the programmed ones, but the actual ones on the screen). I
Do i understand that right, FSX IMO Lights do not work?
Stefan
-
Re: Progamming help with FSBus dll
I can't say that they don't work, but I am probably doing something wrong on approach or I have a setting wrong or have not set something.
I thought they worked all the time on approach whether it's an ILS, vor, vfr etc.
-
Re: Progamming help with FSBus dll
I can get the lights to light up in the USA. Dallas International.
The IMO lights illuminate but now that I can test the lights, I'm not getting my led's lighting up.
I've tried a variety of coding to see if it works but I'm not having any luck.
Here's what I have. I thought it should be as simple as the Inner and Middle are coded so then I tried adding the variable to the Outer but that didn't work either.
Tested the leds in FSAdmin and they work.
I know I'm missing something simple, hope you can point it out to me.
(with the outer marker, I have the static int outermarker = 0; at the top of the page)
Code:
void cbIndicatorlights (int oid, int val, double dval)
{
switch (oid)
{
case FS_INNERMARKER:
FsbusWrite (C_LEDINNERMARKER, val);
break;
case FS_MIDDLEMARKER:
FsbusWrite (C_LEDMIDDLEMARKER, val);
break;
case FS_OUTERMARKER:
if (outermarker == 0)
{
FsbusWrite (FS_OUTERMARKER, 0);
}
else (outermarker == 1);
{
FsbusWrite (FS_OUTERMARKER, 1);
}
break;
-
Re: Progamming help with FSBus dll
Hi,
this type is the right solution.
case FS_INNERMARKER:
FsbusWrite (C_LEDINNERMARKER, val);
break;
Your outermarker code canīt work.
The variable "outermarker" has only the value 0 from greation.
you can write val into outermarker than is everything ok, but that is all code for nothing.
What a polling time you use for this objekts?
I would use FS_QUICK.
Stefan
-
Re: Progamming help with FSBus dll
I'm using normal polling time. I will change it to quick, get rid of the pointless code and try again.
I only tried the extra code as the led's were not working.
Do I need to define val?
Thanks
-
Re: Progamming help with FSBus dll
no, val is define wit "void cbIndicatorlights (int oid, int val, double dval)".
-
Re: Progamming help with FSBus dll
Found my error, I didn't declare cbIndicatorlightsBuildObject in cockpit.cpp
Did that, now I have an error on compiling in the dos window:
FSBUS DLL:
102 is not an fsbus object
any ideas what that means?
-
Re: Progamming help with FSBus dll
an error with your OID define on object 102.