(you are viewing a thread; or go back to
list of threads)
GOTO instruction (by Ihor Nehrutsa)
(no subject) (by MGP)
Usefull with the instructions #TRISB and #PORTB for high speed byte transfer if I'm think correctly..
(no subject) (by bfwolf)
To Ihor: Brilliant idea! ;-)
Even better: Perhaps you sometimes implement GOSUB, RETURN and LABEL instruction. This would give some kind of 'function-blocks' - especially if there would be the possibility of exporting a selection (of rungs) and later importing (them) at before/after a rung at the cursor-position. ;-)
LABEL instruction could be useful for the GOTO instruction, too!
(GOTO label_name / GOSUB label_name)
Parameter-passing to 'sub-programs' could be done with variables (MOVE ...)
Thank you, again, Ihor! ;)
(no subject) (by Ihor Nehrutsa)
I foresee big problems with simulation.
we have:
Simulate
Simulate single cycle
but this we need too:
Simulate one rung
Step over ( execute subroutine as single step )
Step into ( cursor must go inside the subroutine )
Without simulation will be too hard /:(
(no subject) (by bfwolf)
To Ihor:
Maybe, you are right ;-)
I don't have the deep-insight-view, as you have...
But i suppose, that GOSUB and RETURN would'nt make a big difference to GOTO (beside the use of a call-stack).
All instructions (GOTO/GOSUB/RETURN) change the linear program flow...
Having a step-over option in simulation would be great, but not really a MUST... ;-)
(no subject) (by MGP)
@bfwolf, I'm using the Master Control Relay for this.
It is not a complete GOSUB routine but a very useful one because LDmicro's cycletime is a big GOSUB or GOTO.
I think that GOTO is already over the edge, but it is easy to handle because he uses rung numbers.
That's my opinion. ;)
(no subject) (by bfwolf)
To Ihor:
Thank you for your idea with Master-Control-Relays around 'sub-programs' - yes, they could be called from different places, if you enable them there in different cycles... :-)
...as they are executed only once/cycle...
Anyway - having 'real-sub-programs' would be great at somday! ;)
(no subject) (by Ihor Nehrutsa)
(no subject) (by MGP)
Great, the start of a SPI instruction, sending 1 byte to a 4094 or 74165 at high speed. ;-)
SUBPROG, ENDSUB and GOSUB instruction (by Ihor Nehrutsa)
(no subject) (by bfwolf)
To Ihor:
...Seems, that it wasn't that difficult as expected xD
Looks very promising! ;-)
Thank you very much!!!
If there would be the possibility to save selections to a export-file and reimport the exports at a selected rung, we could build a library of sub-programs for certain jobs ;-)
Happy weekend and May,1st ;-)
(no subject) (by Ihor Nehrutsa)
You can use Copy/Paste to copy rungs from one LD to another.
You can select several rungs in source LD
(press Shift key on keyboard and move the kursor by Up/Down keys, the '*' simbol will marks the selected rungs).
Then Copy Rungs (Ctrl+Insert), the selected rungs will be saved in temp.ld.
Then open/select the destination LD file
and Pate Rungs (Shift+Insert), the rungs from the temp.ld file will be inserted into the current(destination) LD file.
(!!! There are some bugs with the insertion when kursor at COMMENT or the inserted rungs include the COMMENTs. This is not a critical bug).
to bfwolf: thanks, I zharil shashlik today ;-)
(no subject) (by bfwolf)
Hello Ihor,
thank you for your hint with the usage of Copy+Paste and the undocumented 'temp.ld' ;-)
So we could copy the temp.ld file away and if we use different filenames (rename the temp.ld eg to temp_counter.ld) and later copy them back to temp.ld and re-import them by Paste. :-)
This would be a workaround for a real export/import.
Or perhaps we have 2 instances of ldmicro.exe running at the same time and use 1 of them for saving/loading the 'paste-buffer' (temp.ld) to real files. :-)
Enjoy your shashlik today ;-)
...it's rainy here in the black-forest... :(
Some question: why are the instructions
UART_Transmit(I_i_charToUart);
and
I_b_scratch = UART_Transmit_Ready();
still commented out with // in the generatet c-source?
If there would be local macros with #ifndef around for them, we could have them activated and a full function - am i wrong? ;-)
Post a reply to this comment:
|