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 v4.3.0

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

LDmicro.GitHub news v4.3.0 (by Ihor Nehrutsa)
Thu Oct 12 2017, 12:33:34, download attachment build430.zip
(no subject) (by Ihor Nehrutsa)
== Release 4.3.0

* Add: Microchip PIC10F200 6-SOT target.

* New: Variables can allocate 1,2,3 or 4 bytes.
Variables are stored and processed in the two's complement form.
See https://en.wikipedia.org/wiki/Two%27s_complement

Bytes Types Range from to
1 signed int8 -2^7 = -128=0x80 2^7 -1= 127=0x7f
2 signed int16 -2^15= -32768=0x8000 2^15-1= 32767=0x7fff
3 signed int24 -2^23= -8388608=0x800000 2^23-1= 8388607=0x7fFFFF
4 signed int32 -2^31=-2147483647=0x80000000 2^31-1=2147483647=0x7fffFFFF

The decimal zero value (0) is represented as all zeros bits 00...000
The decimal value (-1) represented as all 11...111

Signed int8 variables are used for make the hex file smaller and faster.
Signed int24 and int32 types are used to upsize range of variables.
Sign extension for variables of different sizes are provided automatically.
Note: MUL, DIV, MOD instructions can't processed int32 variables.

The arithmetic Overflow(underflow) flag is provided as internal relay ROverflowFlagV.
https://en.wikipedia.org/wiki/Overflow_flag
https://www.allaboutcircuits.c...igital/chpt-2/binary-overflow/
The Overflow flag indicates that the signed two's-complement result would
not fit in the number of bits used for the operation, and signals an error.
For example, if variable int8 dest = 127(0x7f) add 1, we get -128(0x80),
and Overflow flag ROverflowFlagV will be set to 1.
Instead if variable int16 dest = 127(0x007f) add 1, we get 128(0x0080),
and Overflow flag ROverflowFlagV is not affected.
LDmicro resets the ROverflowFlagV to zero during initialization.
Note: CTC generate overfill(carry) impulse when Counter==Max.
CTR generate overfill(borrow) impulse when Counter==Min.
Overfill do not set the Overflow flag.

The Overlap flag is provided as the output state of ADD, SUB operations.
The Overlap flag indicates that sign of result has been changed.
For example, Overlap occured when -1(0xf..f) add 1(or sub -1), we get 0(0x0..0),
all ones 1 are changed to all zeros 0.
Also, Overlap occured when 0(0x0..0) sub 1(or add -1), we get -1(0xf..f),
all zeros 0 are changed to all ones 1.
For example, Overlap occured when -10 add 15(or sub -15), we get 5,
negative source are changed to positive result.
Also, Overlap occured when 10 sub 15(or add -15), we get -5,
positive source are changed to negative result.

* New: RETENTIVE TIMER LOW oparation.
RTL works like RTO, but catch low level input.

* New: BITWISE SWAP oparation.
This operation swaps the nibbles and the bytes inside the variable.

* New: BITWISE OPPOSITE oparation.
This operation reverses the bits sequence to the opposite inside the variable.
The MSB moves to the LSB, and the LSB moves to the MSB and etc.

See manual.txt for all new oparation.

! Attention:
! You can add, edit, save, load, simulate this elements marked 'SIMUL:' in menu.
! No compile code at output.

* DowngradeFix: Restored COMMENT element accoding to Release 2.3
Thu Oct 12 2017, 12:34:10
(no subject) (by Ihor Nehrutsa)
This is experimental release for PIC MCU.
Please test whith old big worked projekts.
I wait bug reports.

AVR version will updated in next releases.
Thu Oct 12 2017, 12:38:07
(no subject) (by Alex)
oh yeah
Thu Oct 12 2017, 13:22:16
(no subject) (by Alex)
1)there is a bug with UART simulation terminal, it happens to me when:

*First: i simulate a ladder program that has uart functions,

*Second: stop simulation (everything ok...)

*Third: Open another ladder program ...

*Fourth: simulate that another program, UART simulation terminal shows up again and i canīt close it unless i close the program, see video.

https://www.youtube.com/watch?v=0hleqF3dCHE with 4.2.3v
https://www.youtube.com/watch?v=wqwAVSJlPiw with 4.3.0v


2) I have tested TON timer in both 4.2.3v and 4.3.0v timer doesnīt reset in 4.3.0v see video, ladder attach

https://www.youtube.com/watch?v=jabGkl4zL2s
Thu Oct 12 2017, 17:24:33, download attachment TONtest.rar
(no subject) (by Ihor Nehrutsa)
to Alex

2) RESET the TON timer.
Yes, you are right, I see a bug.
I tried to do it faster, but failed.
The original algorithm will be restored in the next release.
Thu Oct 12 2017, 18:12:28
(no subject) (by MGP)
Great, a version with a better comment instruction ;) and it works fine. Thx

I dont understand what we can do with the new types of integers, can you give a short example.

I wonder why the random.ld program still does not work in V430's simulator http://cq.cx/ladder-forum.pl?a...;parent=6457&tt=1501224398

But thanks anyway for your work.
Sat Oct 14 2017, 03:44:37
(no subject) (by Ihor Nehrutsa)
to Alex

1)After simulate, when simulate another program, UART simulation terminal shows up again and can't close it unless close the program.

Will fixed in the next release.
Mon Oct 16 2017, 14:02:14
(no subject) (by Alex)
thanks Ihor
Mon Oct 16 2017, 15:17:22
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):