Results 11 to 20 of 737
Thread: Progamming help with FSBus dll
-
06-02-2009, 09:19 AM #11
Great, so simple. It compiles with a full stop or without, but certainly not with a comma.
I will now have to test if it will now run my servo driven Tacho.
I'll let you know. Thanks again for all the help.
Any other suggestions about the code would be greatly appreciated.
DavidLast edited by RobiD; 06-02-2009 at 09:21 AM. Reason: Spelling mistakes 'Doh'
-
06-02-2009, 10:16 AM #12
So here is an update.
Ran FSX
Then compiled project and it gave me a message in the command prompt window saying: Object-ID 0(0,0) out of range.
It appears to be the
FS_ENGINE1RPM that has an ID of 0 but I can't work out where to change it, or where it is even getting the ID from.
Any thoughts?
Stefan, could you give me an idea of what the calculation should be - In the sdk, it says the following about the offset I've used.
08C8
2
Engine 1 RPM Scaler: For Props, use this to calculate RPM – see offset 0898
(On turboprops this will give the shaft RPM, since there is currently no Gear Reduction Ratio available to fix values on such aircraft. I will fix this when I can)
This is the other option
0898
2
Engine 1 Jet N1 as 0 – 16384 (100%), or Prop RPM (derive RPM by multiplying this value by the RPM Scaler (see 08C8 and dividing by 65536). Note that Prop RPM is signed and negative for counter-rotating propellers.
In FS2004 this also now gives the Robinson model‘s RPM, when scaled by the RPM scaler.
I know the calculation is probably easy to work out, but I've only just delved into C++ and this is my first attemp at doing anything in C++ so I would greatly appreciate help.
Thanks again,
David
-
06-02-2009, 10:25 AM #13
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Try it "old" styl on H file:
#define C_RPMSERVO OID_EXAMPLERPM_GROUP + 0
#define FS_ENGINE1RPM OID_EXAMPLERPM_GROUP + 1
Regards,
Stefan
-
06-02-2009, 10:51 AM #14
Thanks. It's compiling again.
Now just need to get calculation right and then test the gauge.
-
06-02-2009, 11:32 AM #15
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
make an Objekt for the Eng1 Scaler (08C
on h file.
enginerpm.cpp
#include"stdafx.h"
static int eng1scaler;
void cbEnginerpmBuildObjects()
{
MkFsbusObject (BTP_A_OUT,C_RPMSERVO,"RpmGauge",cbEnginerpm, 25, 87); //Servo ports are 80-87
MkFsObject(FS_ENGINE1RPM,"RpmGauge", cbEnginerpm, 0x0898, 2, TP_I16, FS_NORMAL); //the TP_UI32 is maybe wrong it must be a FLT32
MkFsObject(FS_ENGINE1RPMScaler,"RpmGauge", cbEnginerpm, 0x08C8, 2, TP_UI16, FS_NORMAL);
}
void cbEnginerpm (int oid, int val, double dval)
{
switch (oid)
{
case FS_ENGINE1RPMScaler:
eng1scaler = val;
break;
case FS_ENGINE1RPM:
int x = val * eng1scaler / 65536;
maybe you need a additional or other calculation. The Servo need a value range between 0-255.
FsbusWrite (C_RPMSERVO, x);
break;
}
}
The Version 2 will have funktion for such cases. But she isnt released jet.
Regards,
Stefan
-
06-02-2009, 11:24 PM #16
'The Version 2 will have funktion for such cases. But she isnt released jet.'
Stefan, is that the Calibrate function?
If so, how would I use it in this situation?
From my understanding, it converts values 10-250 into 0-16000 and I thing the reverse way as well.
I will integrate what you have given me and see how it goes.
Thanks again
David
-
06-03-2009, 02:04 AM #17
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Hi,
yes it is the calibrat funktion.
Do you have the V2 from the dll, or you read on a board about it?
Regads,
Stefan
-
06-03-2009, 02:17 AM #18
Hi Stefan,
I was discussing the v2 with Rob (I'm sure you know who he is) who is helpful to Dirk with testing and writing the code.
So back to the rpm gauge. Good news, it's working. FSX is sending data to the FSBus which is moving the rpm gauge. It's not correct though but at least it is working.
It is not moving very smoothly (quite jerky) and for a small increase in throttle in FSX, it produces a large increase in rpm on the gauge so what do I need to change?
Thanks again, can't wait to get this in the sim once it's sorted.
-
06-03-2009, 03:17 AM #19
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
You have to find the right calculation. You need one that synchronize the Gauge on the Software Panel to the Hardware gauge.
Which aircraft do you use and what is the Value of the scaler?
What is the Servo value of the lowest and higest needle position?
Regards,
Stefan
-
06-03-2009, 04:30 AM #20
Generic Cessna GA aircraft.
I don't know what the minimum and maximum values are for the servo but my understanding is that it's 0-255.
Where do I find the value of the scaler?
Thanks
David
Similar Threads
-
Fsbus CDK
By flyandre in forum General Builder Questions All Aircraft TypesReplies: 4Last Post: 12-27-2014, 12:58 PM -
Need Help Getting My FSBUS NG I/O Going Again..
By JBRoberts in forum I/O Interfacing Hardware and SoftwareReplies: 14Last Post: 03-21-2010, 01:38 PM -
Fsbus ng io
By Davral in forum I/O Interfacing Hardware and SoftwareReplies: 0Last Post: 01-10-2009, 10:38 PM -
Fsbus 2.4.3
By Anderson/SBSP in forum I/O Interfacing Hardware and SoftwareReplies: 9Last Post: 11-30-2008, 04:25 PM -
Help FSBUS
By cesarfsim in forum I/O Interfacing Hardware and SoftwareReplies: 2Last Post: 10-26-2008, 02:23 PM
Prettys Womans from your city for night
A320 Sound Files Missing