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 - copy rung (c++)

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

copy rung (c++) (by Calin (Roumania))
I'v tried to change some things in ladder, but this one is cracking the program. I add in Edit a new option (copy rung down) whitch work until i whant to select an element of the rung that i have duplicated (it select boath elements in boath rungs). If i Save file, and i'm looking in file xxx.ld whit NotePad. the work is OK. If I restart aplication and load the same file with the copied rung, is working OK!
Copy/Paste in xxx.ld editing in NotePad seams to be ok.
Mon Jan 7 2013, 10:55:31, download attachment C++modiff.rar
(no subject) (by Chris)
You mean something like this ?
Thu Jan 10 2013, 05:09:52, download attachment exe.zip
(no subject) (by Calin (Roumania))
it seames to be ok (selection) but i can't re open the xxx.ld that i Saved As
Can You put the modification (C++)on forum? so we can work thogether
I have some ideas for ANCIC with a virtual uC
I'll try to test your version a little bit more!
I do'nt understood very well the structure of leaf!
Thu Jan 10 2013, 08:45:45
(no subject) (by Chris)
Yes, leaf itīs a pascal like type of code.
Now it should work incl saving and restore.
PS: some code of youīr exe file is missing, i refer to the
case statement.
Inside the loadsave.cpp, on the two used functions you should remove the static predicate.
The code:

//-----------------------------------------------------------------------------
// copy the selected rung temporar, InsertRung and
//save in the new rung temp
//-----------------------------------------------------------------------------
void SaveElemToFile(FILE *f, int which, void *any, int depth);
ElemSubcktSeries *LoadSeriesFromFile(FILE *f);

void CopyRungDown(void)
{
int i = RungContainingSelected();
char buff[100];

ElemSubcktSeries *temp = Prog.rungs[i];

FILE *f = fopen("%temp%\ldmicro.txt", "w+TD");
if(!f) return ;

SaveElemToFile(f, ELEM_SERIES_SUBCKT, temp, 1);
rewind(f); fgets(buff,sizeof(buff),f);
if(temp=LoadSeriesFromFile(f)) {
InsertRung(true);
Prog.rungs[i+1] = temp;
}
fclose(f);

WhatCanWeDoFromCursorAndTopology();
ScrollSelectedIntoViewAfterNextPaint = TRUE;

}
Thu Jan 10 2013, 09:09:53, download attachment exe.zip
(no subject) (by Calin (Roumania))
thanks a lot Chris, i hope that this idea to help a lot in editing ladder.
I'll be back!!
Thu Jan 10 2013, 09:59:30
(no subject) (by Chris)
What Hotkey do you associate with it.
Inside ldmicro.cpp the hotkey list should be updated.
What is the suggestion ?
Thu Jan 10 2013, 10:25:00
(no subject) (by Chris)
As info, if you donīt aware of it, Copy and Paste always worked into ldmicro program for identifiers or numbers.

Copy: Control+Insert
Paste: Shift+Insert
Thu Jan 10 2013, 10:52:10
"BIT to INT" and "INT to BIT" instructions (by J R)
Hi Chris is it possible to integrate "BIT to INT" and "INT to BIT " instructions in to LDMicro, like in this attachment?
Fri Jan 11 2013, 08:12:10, download attachment BITtoINT.jpg
" List of Global Variables " (by J R)
Hi Chris is it possible to integrate " List of Global Variables " in to LDMicro, like is in industrial plc softwares?
Fri Jan 11 2013, 08:21:20
(no subject) (by Chris)
Please explain it a bit better.
List of Global Variables used in the program or a list of
the Global Variables from uC that you could use ?
Or List of Global Variables from that you select one,
or somewath different, like utilisation of ram ?

Bit addressing of variables makes sense. Can you suggest a
syntax for that, no '.' or ',' .
Bit Addressing of Variables is needed for having this
feature.
Fri Jan 11 2013, 09:19:07
List of Global Variables (by J R)
With List of Global variables I mean that I will be able to create a list of "bit variables" for inputs ,outputs and internal relays , " INT variables" for counters , timers , analog inputs and I can choose and use these variables in the program.

for Bit addressing of variables I prefer this syntax '.'
Fri Jan 11 2013, 11:07:01
"BIT to INT" instruction (by J R)
With "BIT to INT" instruction I mean a instruction (bitstuffer) integrated in this modified LDmicro.
Fri Jan 11 2013, 11:30:23, download attachment picoplc.zip
(no subject) (by Chris)
The latest code.
mod/and/or/xor donīt are implemented on assembler level.
Mouse popup menu now available.
@foo:bar @@foo:bar @@foo @foo are hw bit variables.
@@=16bit variable, @=8bit foo:bar = 1bit
All untested for now.
Sat Jan 12 2013, 07:54:15, download attachment exe.zip
(no subject) (by Calin (Roumania))
could also be useful copying a parallel branches of a selected rung
LD MICRO looks increasingly better. Thanks to Mr Jonathan Westhues and Chris
Mon Jan 14 2013, 02:23:50
(no subject) (by J R)
Hi Chris, isn't possible to integrate "bitstuffer" instruction into LDmicro or are you still working on this integration?
Sat Jan 26 2013, 04:48:23
(no subject) (by Chris)
I donīt want integrate it into ldmicro, sorry.
The reason is that i have one branch that have support for macro
library and the used macros are written into the resource file.
For different reasons, the ladder file is not compatible with
the orginal ldmicro. Mostly because internal changes.
As example, the TOF in this branch is a macro for "NOT TON NOT"
Using that branch, you could have the bitstuffer command as
macro, but itīs incompatible with the orginal ldmicro.

Tell me if you are interested and i will post here the
website for downloading it.
Sat Jan 26 2013, 09:36:43
(no subject) (by J R)
Hi Chris

can you post here the website address where I can download it?

Thanks a lot.
Sat Jan 26 2013, 12:12:22
(no subject) (by Samukelo Shezi)
Please post
Sun Jan 27 2013, 11:43:05
(no subject) (by J R)
Hello Chris

I'm interested and I'm expecting for the website link for downloading.
Can you attach the link? Please....

Thanks
Tue Jan 29 2013, 12:47:18
How many IO of plc (by Syed Ali)
Hello

some help required.
I want to Test LD micro on ATMEGA8 Micro- controller.

1- I want to PORT D complete Digital input.
2- Complete B Port and two C port as PC0 and PC1 for out put
Iso this plc will work as 8 dital input 4 analog input and
8 digital out put.
Pl. advice.
Thu Jan 31 2013, 11:42:13
How many IO of plc (by Ziggy)
Hello Ali,

Please start a new topic.

Do not append this this Your good question to an otherwise unrelated thread.

Other people may have similar question as You do and may not be able to find the information we discuss with regards
to Your question.

When You start Your own thread please include reference to ATmega 8 in subject line.

By the way I am presently working on a similar issue using ATmega 8.

Look forward to exchanging ideas in a new thread.
Thu Jan 31 2013, 15:47:34
(no subject) (by Fubu83)
Hi Chis,

are you there?

where is the download link?
Wed Feb 6 2013, 12:09:30
(no subject) (by Magno Medeiros (Brasil))
The principle we can say that no one has any obligation to use their time and knowledge to help others, but I want to speak directly to ldmicro, which as we can see through this forum, arouses interest of people worldwide. certainly professional, amateur, or just lovers of electronics. what regret is knowing that on the other hand there are many knowledgeable enough to work with "ldmicro" who refuse or do not do it by simple selfishness that often is part of our society. as every rule has an exception, we can cite the great example of Jonathan Westhues who created this free software and with the source for those who want and those who helped with the translation into other languages ​​and even some through this forum. is not the first time I do this admiration and certainly will not be the last, because I have reason to do so, and many believe that too. if anyone thinks that is an exaggeration find another application that can offer the same opportunity as the "ldmicro" provides the disadvantaged, do not dominate other programming languages ​​that are usually very complex. finalize leaving without hesitating my compliments to this great author ldmicro, which certainly has given his great collaboration without any sense of selfishness ...
Magno Medeiros.
Thu Feb 7 2013, 14:56:35
(no subject) (by Fubu83)
First of all thanks to Jonathan and you for great work .
Are you still working on expanding Ldmicro and adding new microprocessors and new functions and instructions or not? If yes, which microprocessors will you plan to add ?
Will be a new release of this great program?

best regards
Fri Feb 15 2013, 13:03:56
copy rung (by J R)
Hi Chris,

can you put here your source code of modified LDmicro ?
I'm interested of copy rung function . Attach a file with source code please or attach a link where can I download it.

thanks in advance

best regards
Mon Jun 2 2014, 16:22:58
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):