Jump to content
The simFlight Network Forums

Any enthusiastic EPL programmers out there?


Recommended Posts

If there is anybody out there who is up to date with EPL programming would it be possible for you to have a brief look at the code I have included with this message as I am having some problems with it. The code is very basic and the problem will more than likely be immediatly apparent to experienced EPL programmers (possibly some parts of it are out of date). I am having trouble interfacing some buttons (hardware) to my EPL code and I have just included the relevant sections of code. It should be noted that I have already got my displays and leds working but the buttons are proving a problem. I know that the buttons are working because when I go to 'EpicInfo' in the EpiCenter environment I can see the ticks in the correct positions when I press the buttons however I cannot get the corresponding EPL code to do anything. Also could you tell me the best way of generating events in flight simulator using hardwired buttons -> 'nqw commands'?

Thanks in Advance

////////////////////////////////////////////////////////

///////////THIS IS THE HPL FILE (relevant parts)/////////////////////////

////////////////////////////////////////////////////////

////////////////////////////////////////////////////////

connector(FirstExpansionModule)

{

analog(0);

analog(1);

analog(2);

analog(3);

analog(4);

analog(5);

analog(6);

analog(7);

analog(8);

analog(9);

analog(10);

analog(11);

modrow(0,0);

modrow(0,1);

modrow(0,2);

modrow(0,3);

modrow(0,4);

modrow(0,5);

modrow(0,6);

modrow(0,7);

modrow(0,9);

modrow(0,9);

modrow(0,10);

modrow(1,0);

modrow(1,1);

modrow(1,2);

};

device(FirstDevice)

{

connector(FirstExpansionModule);

analog(0,roll,X);

analog(1,pitch,Y);

analog(2,rudder,Z);

analog(3,throttle1,Rx);

analog(4,throttle2,Ry);

analog(5,flaps,Rz);

button(0,0,MACH);

button(0,1,SPD);

button(0,2,ALT);

button(0,3,NAV);

button(0,4,BC);

button(0,5,APR);

button(0,6,YAWD);

button(0,7,WL);

button(1,0,HDG);

button(1,1,MASTER);

button(1,2,ATARM);

button(1,4,FD);

button(2,0,ALT_INC);

button(2,1,ALT_DEC);

button(2,3,HDG_INC);

button(2,2,HDG_DEC);

button(2,4,VS_INC);

button(2,5,VS_DEC);

button(2,6,SPD_INC);

button(2,7,SPD_DEC);

};

/////////////////////////////////////////////////////////

//////////////THIS IS THE EPL FILE (relevant parts)//////////////////////

////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

//MODULE TYPES

#define FASTSCAN 0

#define SLOWSCAN 1

#define OUTPUT 2

#define DISPLAY 3

//MODULE DEFINITIONS

definemodule(0,OUTPUT,0,7)

definemodule(1,FASTSCAN,0,4)

definemodule(2,DISPLAY,0,16)

:INIT{pushc(3);

exec(140);//set base level timing, wait states, etc.

}

///////////This part of the code doesnt do anything sensible (the setpoints are just to test if the buttons are working)

:NAV_HOLD {ctrlhit(N);}

:YAWD_HOLD {ctrlhit(D); setpoint(NAV_LED);}

:HDG_HOLD {ctrlhit(H);}

:AS_HOLD {ctrlhit®;}

:MACH_HOLD {ctrlhit(M);}

:APR_HOLD {ctrlhit(A);}

:ALT_HOLD {ctrlhit(Z); setpoint(NAV_LED);}

:MASTER_HOLD{keyhit(Z);}

:WL_HOLD {ctrlhit(V); setpoint(NAV_LED);}

:BC_HOLD {ctrlhit(B);}

:FD_HOLD {ctrlhit(F);}

:ATARM_HOLD {shifthit®; setpoint(HDG_LED); setpoint(NAV_LED); setpoint(APR_LED); setpoint(WL_LED);}

definebutton(FirstDevice.MASTER,on,MASTER_HOLD)

definebutton(FirstDevice.NAV,on,NAV_HOLD)

definebutton(FirstDevice.YAWD,on,YAWD_HOLD)

definebutton(FirstDevice.ALT,on,ALT_HOLD)

definebutton(FirstDevice.WL,on,WL_HOLD)

definebutton(FirstDevice.HDG,on,HDG_HOLD)

definebutton(FirstDevice.SPD,on,AS_HOLD)

definebutton(FirstDevice.MACH,on,MACH_HOLD)

definebutton(FirstDevice.BC,on,BC_HOLD)

definebutton(FirstDevice.APR,on,APR_HOLD)

definebutton(FirstDevice.FD,on,FD_HOLD)

definebutton(FirstDevice.FD,off,FD_HOLD)

definebutton(FirstDevice.ATARM,on,ATARM_HOLD)

definebutton(FirstDevice.ATARM,off,ATARM_HOLD)

Link to comment
Share on other sites

With recent EPICenter releases, you should be using the new form of button procedure assignment.

your epl-file should look like this:

void FirstDevice.YAWD.On (void) {

ctrlhit(D);

MCP.Row0.NAV_LED = on;

}

This way you can avoid the definemodule statement. Also note the new way of defining outputs.

Good luck!

Michael

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.