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 - LDmicro.GitHub news v3.5.0

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

LDmicro.GitHub news v3.5.0 (by Ihor Nehrutsa)
https://github.com/LDmicro/LDmicro/releases/tag/3.5.0

== Release 3.5.0 experimental pre-release

* Fixed: Address of configuration word(s) are checked and corrected on PIC controllers.

* Fixed: On PIC microcontrollers there is bit 7 on OPTION_REG named
_RBPU: PORTB Pull-up Enable bit or
_WPUEN: Weak Pull-up Enable bit.
Defaut value is 1 = PORTs pull-ups are disabled.
Now bit 7 is cleared and pull-ups are enabled.

Attention: Not all PIC ports have a pull-up resistors.
See datasheets of the controller.
Use an external resistor, if there is no internal pull-up.

* Modified:
Frequency of PWM in Element SET PWM was defined as
int targetFreq;
now redefined as
char targetFreq[MAX_NAME_LEN];

Max value in Element COUNTER and CIRCULAR COUNTER was defined as
int max;
now redefined as
char max[MAX_NAME_LEN];

Now you can use variable as argument of a COUNTER or SET PWM.
It allow to create more sophisticated algorithms in LD.

* You can specify literals as normal decimal numbers (10, 1234, -56).
Added:
You can specify hexadecimal numbers (0xA, 0x04D2, 0xffc8),
octal numbers (0o12, 0o2322, 0o177710),
binary numbers (0b1010, 0b10011010010, 0b1111111111001000)
in most places that you could use a decimal number.

* Added: You can replace LD elements in editor mode by pressing SPACE key.
For example OSR->OSF->OSR,
TON->TOF->RTO->TON ets.

* Added: Copy-Paste rung's. To select rung's press Shift+Up, Shift+Down,
or Ctrl+LeftMouseKey. Then press Ctrl+Insert to write selected rung's
into buffer(file ldmicro.tmp). Then in new place press Shift+Insert
to insert buffer into LD diagram.

For copying only one selected element press Insert, and then Alt+Insert
to Pasting element in new place.

Selected rungs marks symbol '*' before rungs number.
Buffered rungs marks symbol 'R'.
Buffered element marks symbol 'L' if leaf end 'E' if ends element.

If cursor under the selected element, then buffer will be Pasted
below the current rung, otherwise buffer will be Pasted before
the current rung.

* Added: Open LD file in notepad F4. Its allow you rename variables and
contacts in notepad. You must use "replace all" in notepad for renaming.
Be careful. Recommended to create reserve copy of LD file before editing.
Notepad called over notepad.bat and you can change notepad.bat for
calling you favorite editor.

* Added: Display scrolling Up/Down/PgUp/PgDown/Home/End.

* Modified: Compressed view of LD diagram on display. You can see more
in the display without scrolling.
ADD, SUB, MUL, DIV redused to one display area on the screen.
If variable name more then display area (for example LongNameOfVar),
it displayed with symbol '~' as LongNameOf~ and still work.

|| Xnew {LongNameOf~ :=} ||
||-------] [-------{MOV 10}-||

* Reorganized menu. ProcessorMenu2, CmpMenu, SignedMenu added etc.

* Added: Used hardware multiplication MUL, MULS, MULSU for AVR's.

* Added: Used AUTO_BANKING and AUTO_PAGING for PIC's. Its allows to
adding new MCUs more simple.

* International System (SI) prefixes used in many places.

* In simulation mode You can set normal closed inputs to 1 before simulating.
Use symbol '_' after X in contast name.
For example:
Xcontast1 sets to 0 before simulating. (normal open)
Xcontast2 sets to 0 before simulating. (normal open)
X_contast3 sets to 1 before simulating. (normal closed)
X_contast4 sets to 1 before simulating. (normal closed)
This feature applies only in simulation mode,
and does not affect hex file in physical device.

* Added ELEM_OSC oscillator F=1/(2*Tcycle)

* Added: In 'MCU Configuration' dialog you can select timer 0 or 1 for generating of PLC cycle.
This allow use Timer1 for PWM or other features.

* Added: In 'MCU Configurations' dialog added YPlcCycleDuty pin.
YPlcCycleDuty pin set to 1 at begin and to 0 at end of PLC cycle.
You can measure frequency(it must be 1/Tcycle) and duty cycle of PLC.
Unstable frequency or big duty cycle says about long LD programm
and too short PLC cycle.
Fri Jul 22 2016, 15:49:00, download attachment build350.zip
(no subject) (by Ihor Nehrutsa)
Release 3.5.0 is experimental pre-release.
Attention! Not compatible with LDmicro2.3, if modbus contacts or PWM used.

Please contact me about bugs.
Fri Jul 22 2016, 15:56:10
(no subject) (by MGP)
Wow this is what you call an update, I'm going to need a week to try everything once.

Good work and thank you very much.

You will hear from me.
Fri Jul 22 2016, 17:25:44
(no subject) (by Ihor Nehrutsa)
Timer1 as PLC cycle.
Two PWMs 2kHz on Timer2 with different duty cycle.
and two detached
PWMs 1kHz on Timer0 with different duty cycle.
Fri Jul 22 2016, 19:07:19, download attachment ATmega328_Timer1_2xPWM2_2xPWM0.ZIP
(no subject) (by Ihor Nehrutsa)
And
Timer0 as PLC cycle.
Two PWMs 2kHz on Timer2 with different duty cycle.
and two detached
PWMs 1kHz on Timer1 with different duty cycle.
Fri Jul 22 2016, 19:08:53, download attachment ATmega328_Timer0_2xPWM2_2xPWM1.ZIP
(no subject) (by Ihor Nehrutsa)
Timer0 as PLC cycle.
One PWM 4kHz on Timer2 with different duty cycle
and only with the SAME frequency
one PWM 4kHz on Timer1 with different duty cycle.
Fri Jul 22 2016, 19:21:06, download attachment PIC16F886_Timer0_PWM2_PWM1.ZIP
(no subject) (by MGP)
Ihor, I found something strange in your example (pwm.ld)

The Cstate circular counter acts as a normal counter.
Can you check this.

Regards
Sat Jul 23 2016, 13:14:19, download attachment ExampleV350_error.jpg
(no subject) (by Ihor Nehrutsa)
to MGP

I plan add 'min' value instead zero as starting value in CTC,CTD,CTU counters. Counting will be in diapason 'min' ... 'max'.
New CTR reversive counter will be added too. It like CTC but with decrement counting inside.
This bug from this feature will be fixed in v3.5.1.
Sat Jul 23 2016, 15:42:52
crash when selecting 'settings - MCU Parameters...' (by bfwolf)
Hello Ihor,

when I try to change settings for MCU-Parameters,
the 'ldmicro-de.exe' gets busy forever
and eats up windows memory.
You must shoot the windows-task to close it.
It seems, that 'ldmicro.exe' is OK!

Could You pls check and fix this?

Thank You in advance... :-)
Sun Jul 24 2016, 07:08:15
(no subject) (by Ihor Nehrutsa)
Yes I check it.
Sun Jul 24 2016, 16:04:20
(no subject) (by Ihor Nehrutsa)
to bfwolf

Not emerge an error in the "LDmicro-de.exe" in my computer.

Please say more information:
LD file,
screen shots of error,
you oparating system, etc.
Mon Jul 25 2016, 16:02:38
(no subject) (by bfwolf)
to Ihor Nehrutsa

LD file is 'hello.ld' from http://cq.cx/ladder.pl

My operating system at home is windows-xp (where memory is eaten up during hang). Under windows-xp i couldn't make screenshot cause executable just hung. I had to shoot it with the task-manager.

I tried same this morning under windows7...
'ldmicro-de.exe' was stopped with now delay,
when i choosed menu 'Voreinstellungen - Prozessor-Parameter...'
with an alert-popup shown (see screenshot).

I just noticed, that the bug exists even with no ld-file loaded before just after selecting mcu atmega8 28pin.

With no mcu selected, the menu 'Voreinstellungen - Prozessor-Parameter...' can be opened!

Bug does not hapen when executing the English ldmicro.exe
Tue Jul 26 2016, 04:22:08, download attachment ldmicro-de.exe-3.5.0-bug.jpg
(no subject) (by Ihor Nehrutsa)
to bfwolf
Thank you.
Yes I see error in this condition.
...
I just noticed, that the bug exists even with no ld-file loaded before just after selecting mcu atmega8 28pin.
...
I will check it.
Tue Jul 26 2016, 06:46:41
(no subject) (by Ihor Nehrutsa)
https://github.com/LDmicro/LDmicro/releases/tag/3.5.1

== Release 3.5.1

* Fixed: Timer0 as PLC cycle in AVR's corrected.

* Fixed: If try to change settings for MCU-Parameters,
the 'ldmicro-de.exe' gets busy forever
and eats up windows memory.

* Added: CTR reversive counter added.
It like CTC but with decrement counting inside.

Added 'Init' value in CTU,CTD,CTC,CTR counters.
CTU,CTC counter start from 'Init' and count up to 'Max' value.
CTC generate overflow impulse when Counter==Max.

CTD,CTR counter start from 'Init' and count down to 'Min' value.
CTR generate overflow impulse when Counter==Min.

See LDmicro\SAMPLE\ctu_ctd_ctc.ld
Tue Jul 26 2016, 09:24:29, download attachment build351.zip
at mega328 28pin no run adc (by root)
I can hepl you
Tue Jul 26 2016, 23:29:54
add mcu stm32f103c8t6 (by root)
You add arm thank
Tue Jul 26 2016, 23:41:44
(no subject) (by Ihor Nehrutsa)
to root:

1) STM32F103C8T6 added to
https://github.com/LDmicro/LDmicro/issues/25

2)What utility(compilers, programer etc) you use with STM?

3) I don't understand you. Please use Google translator:
National language->English->National language->English.

In most cases after second iteration English version is readable.
Wed Jul 27 2016, 01:17:49
(no subject) (by Ihor Nehrutsa)
Attention! You may need to correct the previous versions of the program containing CTD counter!
For example:
Counter:0 1 2 3 4 5
_ _ _ _ _
CTU >= 5 Input: _/ \_/ \_/ \_/ \_/ \
___
Output: _________________/

The output CTU counter is true if the counter variable is
GREATER than 5 or EQUAL to 5, and false otherwise.

* Modified: In CTD '>=' condition changed to '>'.

Counter:0 -1 -2 -3 -4 -5
_ _ _ _ _
CTD > -5 Input: _/ \_/ \_/ \_/ \_/ \
_________________
Output: \___

The output CTU counter is true if the counter variable is
GREATER than 5, and false otherwise.

This modification leads to a symmetric switching of outputs
when CTU=5 and CTD=-5.

See LDmicro\SAMPLE\ctu_ctd_ctc_ctd.ld
Wed Jul 27 2016, 05:05:26, download attachment ctu_ctd_ctc_ctr.ld
(no subject) (by Ihor Nehrutsa)
Please read Attention! message in CHANGES.txt
Wed Jul 27 2016, 05:12:14, download attachment CHANGES.txt
(no subject) (by MGP)
Hello Ihor

I have simulated your ctu_ctd_ctr.ld program and you cannot see the variablescreen anymore, not even with the scrollbar.
You can only see the variables if you extend the variablescreen to full.
I have also slowdown the counting but nothing helps.
Wed Jul 27 2016, 07:17:52, download attachment Snap96.jpg
(no subject) (by MGP)
Full screen picture.
Wed Jul 27 2016, 07:20:51, download attachment Snap97.jpg
(no subject) (by Ihor Nehrutsa)
to MGP

Windosw 7 Aero ?

Try this file.
Wed Jul 27 2016, 08:48:28, download attachment ldmicro352.zip
(no subject) (by Ihor Nehrutsa)

TON, TOF, RTO timers in LDmicro v2.3 are shorter than those specified in LD file.
They shorter at one PLC cycle.
Wed Jul 27 2016, 09:18:02, download attachment TON_TOF_RTO.ZIP
(no subject) (by MGP)
Yes, Win7 Ultimate and now it works, thanks.
Wed Jul 27 2016, 09:18:23
(no subject) (by MGP)
There is a topic of this, I made a printscreen then and saved this on my harddisk.
I can't find this thread.
Wed Jul 27 2016, 09:23:28, download attachment Timer_correction.jpg
(no subject) (by Ihor Nehrutsa)
TON 2 ms in fact 1 ms.
TOF 2 ms in fact 1 ms.
RTO 4 ms in fact 3 ms.

Not tested on PIC controllers.
Wed Jul 27 2016, 09:23:34, download attachment TON_23.JPG
(no subject) (by Ihor Nehrutsa)
to MGP

In the end of
http://cq.cx/ladder-forum.pl?action=viewthread&parent=3895

I answered you old question about

"Timer period too long (max 32767 times cycle time); use a slower cycle time."
Wed Jul 27 2016, 09:28:06
(no subject) (by Ihor Nehrutsa)
Wed Jul 27 2016, 09:32:55
(no subject) (by MGP)
--------------------------------
"TON 2 ms in fact 1 ms. "
"TOF 2 ms in fact 1 ms. "
"RTO 4 ms in fact 3 ms. "

"Not tested on PIC controllers."
--------------------------------

I'm going to setup a test board this evening and try this.
I don't have simulationprograms.
Wed Jul 27 2016, 10:01:08
(no subject) (by Ihor Nehrutsa)
106Mb not latest version
it posible with email
Wed Jul 27 2016, 10:27:52
(no subject) (by MGP)
No simulationprograms for me, I use a frequency counter and a oscilloscope.
It's not the first time I use these on Ldmicroprograms and I never have seen a deviation like this.
But I will inform you.
Wed Jul 27 2016, 11:29:28
(no subject) (by MGP)
Ihor,
you can improve the appointment of a new instruction, it is not easy if you must click +-5x times to set the cursor.
Wed Jul 27 2016, 11:56:25
(no subject) (by MGP)
Forgot the picture.
Wed Jul 27 2016, 11:58:25, download attachment Snap98.jpg
(no subject) (by MGP)
I'm having trouble compiling a program and can not leave the error, can you check again?
Every time I click OK, the same error displays with different numbers.

16f876a/20Mhz/compile as

I post the ld file asap.....
Wed Jul 27 2016, 13:25:49, download attachment Snap99.jpg
(no subject) (by MGP)
The LD file attached

Why does this version always save a .ld and .pl file from the same program?
Wed Jul 27 2016, 13:35:54, download attachment Test-timing.pl
(no subject) (by MGP)
Wrong file, sorry
Wed Jul 27 2016, 13:37:13, download attachment Test-timing.ld
(no subject) (by MGP)
I did the timingtest and they are correct (16F876a/20Mhz).

In the program Test-timming.ld, the cycletime must be changed in 0.5mS.
V352 does not compile en V2.3 give me a error that I must choose a faster cycle time.
Attached a scoop photo of the outputs osc1 and osc2.
Thu Jul 28 2016, 04:31:31, download attachment P1020153.JPG
(no subject) (by Ihor Nehrutsa)
to MGP

The problem not with period of signals.
TON timer in LDmicro v2.3 are shorter than those specified in LD file.
It shorter at one PLC cycle.
TON 2 ms in fact 1 ms.
You must measure delay time between signal on input and output of TON element:
raise front of Blue Y0 ___/------
and raise front of Red1 Y1 ___/-----
Thu Jul 28 2016, 10:23:33, download attachment TON_v23_PIC16F886.JPG
(no subject) (by MGP)
Yes, you are right, the time is always one cycle time less.
I've never noticed, a bug.
Thu Jul 28 2016, 12:43:46
(no subject) (by bfwolf)
Hello Ihor,

it seems, that there ist still the bug described in
http://cq.cx/ladder-forum.pl?action=viewthread&parent=571
present in the current release (3.5.4).

I loaded the 'hello.ld' and started simulation,
then the 'H' of the 1st 'Hello' is dropped...

I don't know, whether the bug exists on real hardware or not...

Could you pls check this? ;-)

Regards and thank you in advance!
Thu Aug 11 2016, 04:03:53
(no subject) (by Ihor Nehrutsa)
to bfwolf
...
I loaded the 'hello.ld' and started simulation,
then the 'H' of the 1st 'Hello' is dropped...
...
First symbol dropped only in UART simulation window.
In hardware will be full text.
This is old bug.
Will be fixed near time.
Thu Aug 11 2016, 05:31:46
(no subject) (by MGP)
I've created a variety of programs with serial output and each output was displayed correctly.
As Ihor wrote it is a simulation bug.
Thu Aug 11 2016, 07:09:12
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):