Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Compile error

Featured Replies

I am trying to figure out how to program buttons in EPIC USB. I tired to program a button (ModuleOne Row 2 Button 5) to use for my landing gear. When I try to compile it I get a Bad Module Number message. I am enclosing the code for my .hpl and .epl files below. I know I must be doing something wrong but I just can't find out what. Can anyone out there help me out?------------------------------------------------- //mydevices.hplconnector(moduleone){ analog(0); analog(1); analog(2); analog(3); analog(4); analog(5); analog(6); analog(7); modrow(1,0); modrow(1,1); modrow(1,2); modrow(1,3); modrow(1,4); modrow(1,5); modrow(1,6);}; --------------------------------------------------------#include "mydevices.hpl"#define FASTSCAN 0#define SLOWSCAN 1#define GEAR M1R2B5definemodule(1,FASTSCAN,0,7):INIT{ pushc(1); //for 6mhz. For 18mhz us pushc(3); exec(140); //set base level timing, wait states, etc.} definebutton(GEAR,on,gear_up)definebutton(GEAR,off,gear_down):gear_up {keyhit(G)}:gear_down {keyhit(G)}-------------------------------------------------------- Thank you,Steve Kupchack

Are you using version .49?If so, then you may also be using 'Virtual' modules, in which case you will also need to #DEFINE them wherever you are declaring your physical module definitions.This is a new issue that came up in .49. (It's actually not an issue, but is now by design going forward)Raywww.avsim.com/bluesideup

Ray S.

 

Check out my aviation portfolio:

http://scottshangar.net

Ray: Thank you for your reply.I am using version 0.1.1.44.No matter how I try to word it I still get the bad module number error. I am new at epic usb and had very limited knowledge of programming with rev-d.I don't know if I am using the proper syntax for defining and using buttons.Am I using the proper approach for using buttons in usb or is there a better method to use? I am just trying, for the present time, to get the hang of the "simple stuff".#define GEAR M1R2B5definebutton(GEAR,on,gear_up)definebutton(GEAR,off,gear_down):gear_up {keyhit(G)}:gear_down {keyhit(G)}Thanks again for your help.Steve

STEVE COPY THIS BACK INTO YOUR EPL CODE ANDCOMPILE IT.YOUR MISTAKE WAS NOT DEFINING MODULE 0 FIRST. AND SOME MORE ERROS.AS NOTED. ALSO YOU NEED TO STUDY MORE ABOUT THE EPIC CODE. IT'S NOT EASY. RON.______________________________________________#include "mydevices.hpl"#define FASTSCAN 0#define SLOWSCAN 1 //#define GEAR M1R2B5 DON'T DO THISdefinemodule(0,FASTSCAN,0,7) definemodule(1,FASTSCAN,0,7) :INIT{ pushc(1); //for 6mhz. For 18mhz us pushc(3);exec(140); //set base level timing, wait states, etc.} defbtn(M1R2B5,on,gear_up) // USE THIS "defbtn"definebutton(M1R2B5,off,gear_down) :gear_up {keyhit(G);} // NOTE THE ; AFTER G) :gear_down {keyhit(G);}

Hi TVRON:Thanks for the information. I didn't define module0 originally because I wasn't using anything from module0 so I didn't think it was necessary. Apparently you have to define module0 in all cases? If I were also using module2 would I have to define module0 module1 and module2 for it to work?I added the code as you suggested but it still does not work. I tried substituting different letters for the "G" but none of them work. I also tried defining other buttons but none of them worked either. They all will work, however, if I use the define buttons without the _up and _down lines. That is no good because then I have to use the gear switch twice (gearup=gear up and then I have to go to gear down which does nothing and back to gearup to get the gear down). It appears as if the program is not generating keyboard commands and the buttons are working as FS2002 buttons (the 32 that appear in the Gaming Options calibratiion window).I know that it is not easy and I would like to study more but I don't know what to study. I have not been able to understand much of what the syntax.doc file that came with the USB card shows.I had been using Rev-D but switched to USB because my new computer does not support ISA slots.I wasn't doing anything much beyond the simple stuff with Rev-D. The following are two sample pieces of the most involved code that I used with Rev-D. One was for the trims and the other was for differential braking. I don't know if this format will work in USB or not. Can't get far enough to try it out.;*****************RUDDER, AILERON, ELEVATOR TRIMvar(r_trim)var(a_trim)var(e_trim) :init{ jump(loop) } :loop{ readoutpot(10,r_trim) setpot(6,r_trim) delay(2) readoutpot(8,a_trim) setpot(4,a_trim)delay(2) readoutpot(9,e_trim) setpot(5,e_trim) delay(2) jump(loop) }------------------------------------------------------------------;differential braking************************:BRAKES {keyhit(period)}:BRAKESL {keyhit(F11)}:BRAKESR {keyhit(F12)}:brakeleft{ delay(2) ifactive(48) call brakes else call brakesl delay(1) ifactive(49) jumpbrakeleft else return}:brakeright{ delay(2) ifactive(49) call brakes else call brakesr delay(1) ifactive(48) jumpbrakeright else return}db (48,on,brakeright)db (49,on,brakeleft)-----------------------------------------------------------------Thanks again for helping. I appreciate it. I'm sure I will be "going to the well" many more times before I get the hang of it.Steve K.

  • 2 weeks later...

Hey Steve,I'm having the same problem now that I uypgraded from EPICenter .44 to .50. Matt from FlightLink told me to place the include to mydevices.hlp after defining the modules. The code should look something like this:#define FASTSCAN 0definemodule(1,FASTSCAN,0,7)#include "mydevices.hpl"I haven't tried yet, will do it tonight at home. Perhaps this will help. Let me know if you're succesful.Cheers!maxfrm

Hi Maxfrm:I got my stuff to compile by adding definemodule(0,FASTSCAN,0,7)I had only defined moduleone. Wasn't using mod0 so didn't think I needed it but apparently I did.However, when I use a button (i.e. gear switch) the first time I use it it works but then it will not work again unless I hit PAUSE and then the switch works. Does the same thing all all the switches. Have no idea why . . . does anyone out there?? Thanks for the reply.Steve K.

Hi Steve,Actually I got no trouble doing what Matt said, and defining the modules before including mydevices.hlp, and I don't need to define previous modules if I'm not really using them. What I see wrong in your original posted code, is that you defined the buttons before the function labels:definebutton(GEAR,on,gear_up)definebutton(GEAR,off,gear_down):gear_up {keyhit(G)}:gear_down {keyhit(G)}This should be in the opposite way, first the function lables and at the bottom the buttons::gear_up {keyhit(G);}:gear_down {keyhit(G);}definebutton(GEAR,on,gear_up)definebutton(GEAR,off,gear_down)This might help.Cheers!

Thanks for the tip. I'll file it away for fuure reference.Steve K.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.