Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Changing LDMicrov2.2 source code (Pre-select a microcontroller)

(you are viewing a thread; or go back to list of threads)

Changing LDMicrov2.2 source code (Pre-select a microcontroller) (by Jose Hernandez)
Hi, I'm a student from University of Carabobo (Venezuela) and for my final grade project I need to use LDMicro for programming a PLC that we built with Microchip microcontrollers, one version of this PLC was made with 16f887 and the other with 16f877. What I need to do is automatically pre-select any of the microcontrollers mentioned above when LDMicro is open.

I did this:

ldmicro.cpp
//#define NUM_SUPPORTED_MCUS 15
#define NUM_SUPPORTED_MCUS 2

mcutable.h
I removed all microcontrollers and just left 16F877 and 16f887.

maincontrols.cpp
I commented line 355 and now it doesn't appear "No microcontroller" and just appear the two microcontroller that I want (that is the behavior that I'm looking for).

//AppendMenu(ProcessorMenu, MF_STRING, MNU_PROCESSOR_0+i,
// _("(no microcontroller)"));

I forced this part of code (line 592) to appear "the check" on one of the microcontrollers, but...

// `(no microcontroller)' setting
if(!Prog.mcu) {
CheckMenuItem(ProcessorMenu, MNU_PROCESSOR_0+1, MF_CHECKED);
} else {
CheckMenuItem(ProcessorMenu, MNU_PROCESSOR_0+i, MF_UNCHECKED);

And here is the question... What do I need change or modify to automatically pre-select one of the microcontrollers?

In the link below I show you what I got, in the status bar is not selected a microcontroller.

"Microcontrolador no seleccionado" it means No MCU selected.

http://i53.tinypic.com/23le7v5.png

Can anyone help me?

Thanks in advance.
Sat Mar 26 2011, 13:51:09
(no subject) (by Jonathan Westhues)
The changes that you made changed (and made incorrect) how LDmicro displays which micro is selected. That's not useful.

Look at NewProgram(), in circuit.cpp. There, instead of leaving the initial MCU selection blank, select whichever micro you want, in the same way that one is selected around line 327 of ldmicro.cpp.
Sat Mar 26 2011, 14:03:33
(no subject) (by Jose Hernandez)
Thank you very much for your quick and useful response, I changed everything you said and now works as I wanted.

Thank you very much.
Sat Mar 26 2011, 14:47:10
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):