Yeah that would make since just to make sure the wires are going to the right pin. And how do you know what kind of stepper motor to get?
Trevor
Printable View
Yeah that would make since just to make sure the wires are going to the right pin. And how do you know what kind of stepper motor to get?
Trevor
Do you Stefan or David have skype?
You get a PM.
My wife does, but I can join, no problems.
I'll PM when I'm done.
David
I think i found both of your User names for sype and i already added both of you
Trevor
Hi Trevor,
Just sent you and Stefan a PM.
David
My C++ i can only use with FS2004 right now. for what ever reason im not able to use it with FSX. Would you guys be willing to post your code of your main CPP so i can compare it with mine. And also can i have one C++ exe and use it for both FS2004 and FSX? I mostly use FS2004 but also would like to use my stuff with FSX for when i do Multiplayer Pilot/Copilot. Here is the code im using right now, what do i need to change so i can use it with both?
Code:#include "stdafx.h"
#include "rvdb737ng.h"
/* ------------ global variables ------------- */
extern BOOL bSynchronised = false; // cockpit not in sync with FS
/* ========================== */
/* M A I N L I N E */
/* ========================== */
int _tmain(int argc, _TCHAR* argv[])
{
int KeyboardInput = -1; // Input from keyboard
short PauseState; // FS in Pause state (if 1)
int V = GetFsbusDLLVersion();
printf("Detected Fsbus version %d.%d.%d\n",
V/100, (V%100)/10, V%10);
if (V < 200)
{
printf ("Program requires Fsbus DLL version 2.0.0 or higher\n");
return 1;
}
// signal(SIGINT, SIG_IGN); // Ignore Ctrl-Break
// signal(SIGBREAK, SIG_IGN); // and Ctrl-C
OpenLog(); // start log function
CheckIn(); // Connect to FSbus.dll
FsbusOpen("Com1"); // start communications with Fsbus
GlareshieldBuildObjects(); // )
MainpanelBuildObjects(); // )
AftoverheadBuildObjects(); // )
FwdoverheadBuildObjects(); // ) Create objects by group
PedestalBuildObjects(); // )
SoundBuildObjects(); // )
ThrottlequadrantBuildObjects(); // )
FsConnect(); // start communications with FS
WriteLog(0,0,0);
FsbusWriteFmt2(0,128,0); // Fsbus reset
WriteLog(0,0,0);
FsbusMux(3000); // time to process Fsbus events
WriteLog(0,0,0);
GlareshieldSync(); // )
MainpanelSync(); // )
AftoverheadSync(); // )
FwdoverheadSync(); // ) Sync cockpit with FS
PedestalSync(); // )
ThrottlequadrantSync(); // )
bSynchronised = true; // we are in sync now
printf("Hit Escape key to terminate Fsbus program....\n");
FsReadDirect(0x0264, 2, &PauseState); // get FS pause-state
if (PauseState == 1) // paused
{
PauseState = 0;
FsWriteDirect(0x0262, 2, &PauseState); // un-pause
}
/* - - - - wait for Escape (termination) by user - - - - */
while (KeyboardInput != VK_ESCAPE) // not 'Esc' key
KeyboardInput = ReadKeyboard(1000); // check keyboard
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - */
CloseLog(); // stop logging
CheckOut(); // disconnect FSbus.dll
// signal(SIGBREAK, SIG_DFL); // Restore Ctrl-C default
// signal(SIGINT, SIG_DFL); // and Ctrl-Break default
return 0; // terminate program
}
// -------------------------------------------------------------- */
// Function called by fsbus.dll with every event. */
// Can also be called by other modules of this project */
// for example with synchronisation of cockpit with FS. */
// -------------------------------------------------------------- */
extern void EventHandler(int oid, int val, double dval)
{
WriteLog(oid, val, dval); // log event
switch (oid / OBJECTS_PER_GROUP) // select group
{
case GROUP_MAINPANEL:
MainpanelEventHandler(oid, val, dval);
break;
case GROUP_GLARESHIELD:
GlareshieldEventHandler(oid, val, dval);
break;
case GROUP_AFTOVERHEAD:
AftoverheadEventHandler(oid, val, dval);
break;
case GROUP_FWDOVERHEAD:
FwdoverheadEventHandler(oid, val, dval);
break;
case GROUP_PEDESTAL:
PedestalEventHandler(oid, val, dval);
break;
case GROUP_SOUND:
SoundEventHandler(oid, val, dval);
break;
case GROUP_THROTTLEQUADRANT:
ThrottlequadrantEventHandler(oid, val, dval);
break;
default:
printf("%cError: Object %d (%d:%d) in unknown group.\n",
7, oid, oid / OBJECTS_PER_GROUP, oid % OBJECTS_PER_GROUP);
}
}
Hey Trevor,
Good to have a chat the other night. I'm more than happy to post any of my code, but as requested, here is my main .cpp file.
Speak soon,
David
Code:// Davids Flight sim.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
extern BOOL bSynchronised = false;
int _tmain(int argc, _TCHAR* argv[])
{
int v = GetFsbusDLLVersion ();
if (v < 100)
{
printf ("Program requires Fsbus DLL version 1.0.0 or higher\r\n");
return 1;
}
CheckIn();
FsConnect();
FsbusOpen("COM1");
cbLLSwitchboardBuildObjects();
cbMagnetoBuildObjects();
//cbEngineBuildObjects();
cbEnginerpmBuildObjects();
cbGaugesBuildObjects();
cbSwitchesBuildObjects();
cbVoltmetersBuildObjects();
cbNavBuildObjects();
cbIndicatorlightsBuildObjects();
//cbMcpBuildObjects();
cbModecontrolpanelBuildObjects();
FsbusWriteFmt2(9,128,0); // Fsbus reset CID 9
FsbusMux(350); // time to process Fsbus events
FsbusWriteFmt2(10,128,0); // Fsbus reset CID 10
FsbusMux(350);
FsbusWriteFmt2(11,128,0); // Fsbus reset CID 11
FsbusMux(350); // time to process Fsbus events
FsbusWriteFmt2(12,128,0); // Fsbus reset CID 12
FsbusMux(350);
FsbusWriteFmt2(13,128,0); // Fsbus reset CID 13
FsbusMux(350); // time to process Fsbus events
FsbusWriteFmt2(14,128,0); // Fsbus reset CID 14
FsbusMux(350);
FsbusWriteFmt2(15,128,0); // Fsbus reset CID 15
FsbusMux(350); // time to process Fsbus events
FsbusWriteFmt2(16,128,0); // Fsbus reset CID 16
FsbusMux(350);
FsbusWriteFmt2(17,128,0); // Fsbus reset CID 17
FsbusMux(350); // time to process Fsbus events
FsbusWriteFmt2(18,128,0); // Fsbus reset CID 18
FsbusMux(350);
FsbusWriteFmt2(19,128,0); // Fsbus reset CID 19
FsbusMux(350); // time to process Fsbus events
FsbusWriteFmt2(20,128,0); // Fsbus reset CID 20
FsbusMux(350);
FsbusWriteFmt2(21,128,0); // Fsbus reset CID 21
FsbusMux(350); // time to process Fsbus events
FsbusWriteFmt2(22,128,0); // Fsbus reset CID 22
FsbusMux(350);
FsbusWriteFmt2(23,128,0); // Fsbus reset CID 23
FsbusMux(350); // time to process Fsbus events
FsbusWriteFmt2(24,128,0); // Fsbus reset CID 24
FsbusMux(350);
bSynchronised = true;
printf ("press any key to exit ...\r\n");
while (!_kbhit())
FsbusMux(500);
CheckOut();
return 0;
}
FSbus only know FSUIPC.
There is no differance between FS9 or FSX.
Hi Stefan,
This is what I thought too, so thanks for the confirmation.
David