Sign in to follow this  
Guest RickTaylor

New EPICenter EPL Syntax - LED Output problem

Recommended Posts

Hi all,Anyone programming EPL with EPICenter ? I've got a slight problem.I can't seem to set an LED on thru my Output Module. I'm using an EMDA 2.0 card and it's Red power LED is on showing that 12v is getting to the board. My 2xLED annunciator works when I short the ribbon cable row 3 with row 1 (+12V), so that's not the problem.It's either the Output module itself or the new EPL programming syntax. Good Doco is a little scare wrt the new EPICenter syntax.Has anyone got a code snippet to show how to turn on an LED through the Output Module using an EPICenter EPL procedure ? I've attached my .epl and .hlp code. Can anyone tell me what I'm doing wrong ?Does anyone know where to get a good EPL programming manual (new version for EPICentre) ?Are "setpoint" and "clearpoint" still valid ? What should I define the Output Module as ?, definemodule(0,Output,0,4) ?It's hard work but I reckon the flexibility of EPL still keeps EPIC in the top slot.Cheers guys,Rick Taylor(I'm building a Pit; and now I'm Broke!)

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I had similar problem too... I'd love to know the answer. My best advice is to wait for Ray to post his answer on this thread. Hope not too long.

Share this post


Link to post
Share on other sites

Thanks Arthur,What was the outcome of your experience ?oh and....Are you related to Rob by any chance ?Ralph, if you're out there ? Help !!regardsRick Taylor

Share this post


Link to post
Share on other sites

What was the outcome of your experience ?Truthfully, since I got EPICUSB last year, I have not gone much further. Bascially, I am still in square one as of now. So, I don't have any much of outcome experience(s), except for one thing is when I had switches and analog pot working which I could see some events displaying in EPICenter. However, I am still struggling at the point where I am trying to get this working via FS or FSUIPC.That too with the Output and seven segment modules. I am trying to figure out how this thing can exchange the data. How far are you? Have you sucessfully getting switches or analog working via FS/FSUIPC? is it complexing? Where do I get a such good information, explaing how getting switches working via FS/FSUIPC if you know any? Are you using some kind of EPIC thrid party software such as EPICMapper or FSComm?oh and....Are you related to Rob by any chance ?Well, Truthfully... I don't know. But who knows! As matter of fact, the ironic thing is we have same last name, we have same type of hobbies and what even more we live in same state of Texas (Mine's in Austin and his in Houston) But we never get to meet eachother, hopefully one day.Ralph, if you're out there ? Help !!He's out there, I get replies from him through e-mail mostly on Mondays.

Share this post


Link to post
Share on other sites

Arthur,I've only been trying with EPIC for a week now but I've got a toggle switch to work fine. It turns on the Landing Lights directly thru to FS9. That bit took 2 days to figure but it's so easy once you know how.I don't use any third part software, or even FSUIPC to do this. Itworks via EPICIO.dll (which you should have in your windowssystem32 folder already if you have installed EPICenter).The EPICIO.dll passes the requests to FS9 via the FS9.cfg file in your documents folder (under Documents and settingsapplication datamicrosoftfs9fs9.cfg) or in the main FS2002 directory for the previous FS version.I assume you have the EPICINFO.dll module from Peter Dowson, and know how to check a buttons location within EPIC via EPICenter.If you want I will put together my example for you and post it here. I'm just a little tied up now, so if you could wait a day or two ?Main things you need to include are a couple of virtual variables (one for ON and one for OFF) in your first device(Events0) with connector(econ). eg. device(Events0){ options(SEND_BUTTON_DLL); connector(Econ); button(0,0,GEAR_UP); button(0,1,GEAR_DOWN); )};In this device you also need to include the line :Options(SEND_BUTTON_DLL). This is the trick that sends your requests to the EPICIO.dll for processing.In one of your physical devices (say device(mip)on connector (Mod1), which must come after the virtual device(Events0) in your .hlp file, you define your actual toggle switch and it's location on the input module, (say module 1, row 0, bit 0).eg. device(mip){ connector(Mod1); button(0,0,Gear);};All of the above is done in your devices.hlp file.In your code file (.epl) you define a procedure for each of the two virtual buttons you have previously defined (one ON and one OFF).eg.:mip1.Gear.On { Events0.GEAR_UP=pulse; } :mip1.Gear.Off { Events0.GEAR_DOWN=pulse; } Here you send a pulse to the EPICIO.dll and hence through to the FS9.cfg file.)eg Events0.GEAR_UP=pulse and Events0.GEAR_DOWN=pulse.The GEAR_UP and GEAR_DOWN are reserved FS9 keywords, a full list of which can be found on Peter Dowson's web page at www.project magenta.com. These key words, and there are loads of them, are how you talk to FS9 via the EPICIO.dll.The tricky part is that you have to edit the FS9.cfg file and add a line for each FS Key word, (eg GEAR_UP and GEAR_DOWN), that you want to activate. This needs to go in the Joystick_Main section of FS9.cfg.This ties together your virtual buttons and FS and is hard to explain. It's better that I show you by example as there are numerous Joystick_Main sections in the FS9.cfg, and you need to add the lines/keywords into the correct one which represents your EPIC virtual device.eg.JOYSTICK_MAIN {0E231340-0753-11D9-8001-444553540000}BUTTON_DOWN_EVENT_00=GEAR_UPBUTTON_DOWN_EVENT_01=GEAR_DOWNThese two lines effectively enter your toggle button for your EPIC device (virtual device that is / first one, as you will see two of them,) into FS's joystick button assignments. If you just go to assignments within FS, you will only be able to assign buttons to a few of the FS key words available, (Only GEAR_TOGGLE is shown and not GEAR_UP or GEAR_DOWN). This is how you can use ALL of the FS assignment key words, and not just those shown in the FS assignments dialog. Remember the #pragma hid_rpt_snd n command to set number of EPIC devices that windows (and FS) will see. (Oh by the way - I'm using XP and FS9 if you hadn't already guessed. I'm, sure this works the same for FS2002 although there are changes that were made by MS in the available key words within FS9. (refer to Peter Dowson here !).And that's it. When you fire up FS and flick your toggle connected to Mod 1,row 0, bit 0, your gear will try to go up and down (unless you're up there in which case it WILL go up and down).Get this working and 95% your button inputs are catered for just by cutting and pasting code and then editing button locations and the FS keywords to activate. Now I need to get on and work out how to set on/off these damn LEDs.Hope this helpsRalph, correct me please if I'm wrong.CheersRick Taylor737NG - Australia(I'm building a Pit; and now I'm Broke!)

Share this post


Link to post
Share on other sites

Hi Ray,You wouldn't be able to help me out with my original problem would you ?I can't send any output via either my Display or Output Modules.I wonder if it's my EPIC Bus cable or if I'm just missing something simple in the code.CheersRick

Share this post


Link to post
Share on other sites

Speaking of RAY.... :)Check out his new web site.....http://www.777sim.com/simengineersSim Engineers..... If you need an EPIC Expert.... here he is.Besides the EPIC stuff, Ray is building this wonderful site (SimEngineers), to be an excellent resource for us builders. If you haven't seen his project..... WOW!!! Ray's project is motivating and his knowledge of Interfacing is absolutely fantastic.Just my two cents worth...... :)

Share this post


Link to post
Share on other sites

THANK YOU! Rick... Stand by allow me plug up all of the EPIC, do some configuration in .cfg, and test it.Ray, I rec'd your e-mail today and sent you already... I'll let you know the version of EPICenter and EEPROM of the card. I'll e-mail you tonite.Matt O. Wondering you you re using EPICUSB?

Share this post


Link to post
Share on other sites

Arthur, I've been trying for two years without success, but Ray has given me hope. Otherwise I've been using a little bit of everything. But EPIC USB will BE the ONE.

Share this post


Link to post
Share on other sites

Same here, struggling for a year without a sucess. Ray is able to help me out. I guess that makes three of us (you, me and Rick)Hope we can all get suceed together.

Share this post


Link to post
Share on other sites

YESSSS !!!Well guys, been at it for 3 days now and I've got buttons, output LED's and 7-Seg Displays cracked.(Thanks to Ralph, Cheers !).The buttons you know about. The LED's and Displays I had programmed correctly and Wired Correctly. I'd just forgotten about the Jumpers on the Output and Display Modules. Simple !Now for the Good news. I'm going to show you how to do it, before I carry onwards into the land of the Rotaries.1. Output Module - LED's / Annunciators etc....There are 2 jumpers on your Output Module board (J0 and J1) with aself explanetary table printed next to them. If this is your firstOutput Module it will be running rows 0-3, so remove both jumpers.I am using EMDA 2.0 cards so it to the Output Module with a 34 pin ribbon cable. I don't know the configuration of the individual leads within this ribbon cable but I'm sure this is available on the web. I recommend the EMDA 2.0 boards from CSI (Ted Deller) in any case, just for tidyness and ease of use.Connect the +12V wire to your DC+ on the EMDA board (Just below the "Lights" text. Connect the other end to the lead on the rounded side of the LED (+ve).Connect a 1K resistor over bit 0 in the row 0 section of the EMDA board. Now connect a wire from the LEFT side of the resistor to the -ve lead of the LED (the flat side). This puts a 1K resistance in series with the LED on the -ve side and drops the current to about 12-15mA. This is good. Not putting the resistor in series is BAD..If you are not using an EMDA 2.0 board, connect the +12V ribbon lead, presumably No.1, directly to the LED +ve, i.e. the rounded side wire. Connect the other side of the LED (flat side) to a 1K resistor and then to the correct ribbon lead corresponding to row 0, Bit 0, (Presumably again - lead 3). I think Lead 2 is a ground ! Correction here please (Ray/Ralph).If using 2 LEDs in a FDS annunciator, connect them in series and halve the resistor - say 680 ohm.Switch on the EPIC and Output cards and fire up EPICenter,In your .epl file add :definemodule(0,OUTPUT,0,4) // Define Output Module 0 with 4 rows starting at row 0.This defines the output board as "Output" module 0 and as type OUTPUT (Type=2, defined in the #include )It also says start at Row 0 and include the first 4 rows of LEDs, 8 per row).Now use the OUTPUT tab within the EPICINFO tool to test your LED.Now in your .hlp file in the physical devices section of the code (where you defined your physical buttons previously) add the lines :output(mip_anun1,0,0) // MIP Annunciator outputs on module 0 row 0{pull_up=0b00000001;}Within the definition of "mip_anun" you can add up to 8 LEDs. Here I've just attached 1 called "pull_up" which is attached to module 0, row 0, bit 0(=0b00000010 would be bit 1 etc...)You should have something like this :device(mip1){ connector(Mod1); button(0,0,Gear); output(mip_anun1,0,0) // MIP Annunciator outputs on module 0 row 0 { pull_up = 0b00000001; // Pull Up annunciator assigned to bit 0 }; };Going back to our previous GEAR_UP, GEAR_DOWN button example, we can add a line into each in the .elp file as follows ::mip1.Gear.On { Events0.GEAR_UP=pulse; mip1.mip_anun1.pull_up=on; } :mip1.Gear.Off { Events0.GEAR_DOWN=pulse; mip1.mip_anun1.pull_up=off; }And guess what, when you toggle the GEAR switch, the LED will go on and off.I know ! The logic is non-sensical. From this and the previous example you should have enough to activate the LED directly from FS via EPICIO.dll and or FSUIPC. I haven't done this yet but I think it will be straight forward.2.Display ModuleEasy. Just the same as the Output Module.First remove both Jumpers on the card to tell the hardware that it is to control Digits 0-7. The Jumpers are near the 12v power supply input and the key table is near the EPIC Bus connectors.Plug in a 20 pin ribbon lead to the row 0-7 connector.I use a CSI 5 digit card for easy mounting/wiring of the 7-seg digits. Don't ask me to explain how to wire up 5 digits without one of these cards. BUY THEM....Wire leads to the CSI cards as follows :Ribbon Lead 1 to A (down the side)Ribbon Lead 2 to BRibbon Lead 3 to CRibbon Lead 4 to DRibbon Lead 5 to ERibbon Lead 6 to FRibbon Lead 7 to GRibbon Lead 8 to HRibbon Lead 9 to Digit 1 (Right Most on Card)Ribbon Lead 10 to Digit 2Ribbon Lead 11 to Digit 3Ribbon Lead 12 to Digit 4Ribbon Lead 13 to Digit 5This leaves Ribbon leads 14,15,16 for 3 other digits on another card (eg. for Speed).The last 4 leads are not used (To the best of my knowledge.)Plug in the EPIC BUS cable to the Display module and power it up.In the .hlp file, again under your physical devices section, define a new device called Display1 as below :device(Display1){ display(Freq,2,0,"999.99",true);};Syntax:display(name,module,start_digit,format,DP control flag)Note that this is a Display output and needs no connector. It is NOT assigned to the Connector(Mod1) so you don't just add it into your "mip1" device.Displays should have their own device definition, and remember to increment the pragma command to #pragma hid_rpt_snd 3 so that FS will see all 3 EPIC devices including your displays.Note also that when assigning names to displays, or any device component, the name is CASE SENSITIVE. A procedure in the .epl code file will NOT recognise the name "freq" if it has been defined in the "Display1" device definition in the .hlp file as "Freq".The "display" command is multi-configurable and can define different formats for your group of 7-SEG displays (Refer to R&R electronics SYNTAXUSB.DOC, available for download at Ralph's web site.) The section you are looking for is about half way through the document entitled "DISPLAY MODULE COMMANDS".(By the way, look in this document, about 5 pages from the end, to get syntax for all the previous stuff I described wrt buttons and LED outputs.)Now go to your .elp cde file and add this to the definitions at the top :definemodule(2,7SEGDISP,0,8) // Define Display Module 2 with 8 digits7SEGDISPLAY is again defined in the #include file as type=3. I'm guessing that the 0 refers to start at digit 0, and the 8 is the number of digits for the module to control. (Correct me if I'm wrong Ray/Ralph !)Now for fun, add the line :Display1.Freq=123.45; andDisplay1.Freq=109.10;to your mip1.Gear.On and mip1.GEAR.Off procedures, again in the .epl code file.:mip1.Gear.On { Events0.GEAR_UP=pulse; Display1.Freq=123.45; mip1.mip_anun1.pull_up=on; } :mip1.Gear.Off { Events0.GEAR_DOWN=pulse; Display1.Freq=109.35; mip1.mip_anun1.pull_up=off; }When you toggle the switch, your annunciator will go on and off, and the LED display panel will flip between 123.45 and 109.35Well this should be enough to get you going. I'm off to work out exactly how to send and retrieve frequencies to and from FS9 and how to link to annunciators directly (without the aid of a switch). And then I'm onto the Rotaries.Watch this space guys.Hope this helps a bit.CheersRickRick Taylor(I'm building a Pit; and now I'm Broke!)

Share this post


Link to post
Share on other sites

Well Rick... Congrats, I envy you on your success. Now I read the details you have done and I am bit of confusing. What I am going to do is try to copy and paste it on word pad, print it, read it over again and again during the week and perform all of the methods you did this weekend. I might as well have some questions to ask would that be okay if I could e-mail you if I come up with questions about output and 7 segment digit display modules? Please do let me knowThanks

Share this post


Link to post
Share on other sites

No problem Arthur. You can get me at rick.taylor@bigpond.comRick Taylor(I'm building a Pit; and now I'm Broke!)

Share this post


Link to post
Share on other sites

To turn a properly setup LED or Lamp on or off, all you need are the following type of statements.EPU.Leds3.EPU_Control_Led=off;EPU.Leds3.EPU_Control_Led=on;To use these statements you have to set up the proper devices, connectors, and LED or Lamps.On this website is a cockpit building manual that tries to explain some of the EPIC concepts. It's a little dated but it does discuss what you need to know about lights/LEDs.http://members.cox.net/martin1jam/

Share this post


Link to post
Share on other sites

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
Sign in to follow this