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.0.7

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

LDmicro.GitHub news v4.0.7 (by Ihor Nehrutsa)
https://github.com/LDmicro/LDmicro/releases/tag/4.0.7

== Release 4.0.7

* HotFix: Bug in releases 4.0.5 - 4.0.6 with AVR ports ottputs.

* Added: Atmega2560 can genarate 12 hardware PWM's.

HOW TO: Two three phase sine wave based on the hardware PWM
https://github.com/LDmicro/LDm...wave-based-on-the-hardware-PWM

* New: Added elements
UART SEND: Is busy ? Output is 1 when send data currently present in the transmit buffer.
UART RECV: Is avail ? Output is 1 when there are unread data in the receive buffer.
Mon Nov 7 2016, 08:43:31, download attachment build407.zip
(no subject) (by Alex)
To Ihor:

1)

When i simulate ladder in 4.0.7v it shows a message that in 2.3v isnīt shown with same ladder (it is a message about TON timer, i attacha ladder.
Mon Nov 7 2016, 15:38:13, download attachment time test 2.3v.ld
(no subject) (by Alex)
simulate in 2.3, this one in 4.0.7
Mon Nov 7 2016, 15:38:49, download attachment test time 4.0.7.ld
(no subject) (by Alex)
i attach file and video to explain this:
Mon Nov 7 2016, 15:41:01, download attachment LDMICRO COMPARISON.doc
(no subject) (by Alex)
2.3v:

https://www.youtube.com/watch?v=sUTMYV0xE58


4.0.7v:

https://www.youtube.com/watch?v=aX9OEiEk66c




I forgot to say that when i want to compile and i didnīt select the MCU and pins in 2.3v it shows a message to select them (and HEX file is not created), in 4.0.7v it shows a message too, but it creates the HEX file anyway, that hex file doesnīt work because it doenst have MCU and pins (i guess it shouldnīt create HEX file or am i wrong? or is it correct that if you press compile then it creates hex file , but it doesnt work because you didnīt select MCU and paramters in that case we would be wrong and not the Ldmicro, i donīt nknow if i am clear? ).
Mon Nov 7 2016, 15:49:46
(no subject) (by Ihor Nehrutsa)
to Alex

I understood you.
You are right about HEX. I will delete it if length is 0 or
error occurred.

Wait v4.0.8
Tue Nov 8 2016, 18:28:14
(no subject) (by Ihor Nehrutsa)
to Alex

More difficult question with message about TON timer.
1)
In manual.txt we can read about
...
> TURN-ON DELAY Tdon
...
It is possible to manipulate the counter variable elsewhere, for example with a MOV instruction.
...

and about
...
> RESET Trto Citems
...
TON and TOF timers are automatically reset when their input goes false or true, so RES is not required for these timers.
...

I think that these two sentences contradict each other.
I think, that changing the timer value using RES or MOV
is a bad style of LD programming. RES or MOV breaks time interval of TON and you can get uncertain time delay.
I would prefer to make a TON inaccessible to external influences.

2)In simulate.cpp v2.3 there is a code with text to messages
but it is shown when TON 'nameX' used twice as TON 'nameX'.
...
switch(flag) {
case VAR_FLAG_TOF:
if(Variables[i].usedFlags != 0)
return _("TOF: variable cannot be used elsewhere");
break;

case VAR_FLAG_TON:
if(Variables[i].usedFlags != 0)
return _("TON: variable cannot be used elsewhere");
break;

case VAR_FLAG_RTO:
if(Variables[i].usedFlags & ~VAR_FLAG_RES)
return _("RTO: variable can only be used for RES elsewhere");
break;
...

3)v2.3 and v4.x.x generates similar internal code.
v4.x.x not blocks this instructions and saves backward compatibility in this.
But message says you about possible problems.
You get HEX equivalent to v2.3

4)Please send me your Proteus project. I want to test.
I am not inclined to remove this message.
Tue Nov 8 2016, 19:36:51
(no subject) (by Alex)
I see, so it is recommended not to use RESET in Ton or Tof due to possible problems, i guess it was implemented like a PLC compatibility, in that case we could use RESET with no problems in counters.


Sure (attach file)
Tue Nov 8 2016, 20:32:01, download attachment Proteus Project.rar
(no subject) (by Alex)
I made a test of 3 intervals of a total 100 seconds, let me explain:

every 90 seconds i took a picture for 3 times(due to that the timer in proteus resets every 100 seconds so i took 3 times a picture in the 90 second)


2.3v :

WITHOUT RESET for timers

interval 1(90 second):
89.9995820

interval 2(90 second):
89.995620

interval 3(90 second):
89.9955420

USING RESET for timers

interval 1(90 second):
89.9995820

interval 2(90 second):
89.995620

interval 3(90 second):
89.9955420



4.0.7v :

WITHOUT RESET for timers

interval 1(90 second):
90.294483

interval 2(90 second):
90.621683

interval 3(90 second):
90.9462

USING RESET for timers

interval 1(90 second):
90.256283

interval 2(90 second):
90.621683

interval 3(90 second):
90.9462

It seems that in 4.0.7v time increases duration in the interval 3 it should be 90 seconds but it is almost 91 seconds (90.9462) in 2.3v it keeps with 0.99 diference (89.99 in all intervals with or without RESET). But this is only simulation, i attacha file for images and ladder.
Wed Nov 9 2016, 00:36:12, download attachment tiempo.rar
(no subject) (by bfwolf)
To Ihor:

Current version has big stability-issues, if you change microcontroller in settings from e.g. atmega328 to ANSI-c-code or back from ANSI-c-code to atmega328.

Program throws error-messages (no RAM space etc.) or hangs so that you have to shoot it with the task-manager.
It seems to eat up pc-memory, too.

I tested some earlier 4.x versions, too, which also seem to be affected by this bug!

Could you pls check this? ;)

Regards
Wed Nov 9 2016, 03:56:11, download attachment hello-m328.ld
(no subject) (by Alex)
i got the same error, while generating ansi c for arduino, in my case ldmicro freezes and inputs and outputs for simulation dessapear after getting the error bwolf describes.

i attach image
Wed Nov 9 2016, 10:51:52, download attachment 4.0.7 freezes.jpg
(no subject) (by Alex)
i have made a comparison between 2.3v and 4.0.7v for time intervals using ansi c for arduino, in 2.3v time is closer to 1 sec than 4.0.7v for example in 2.3v we get 2.99 = 3 sec in 4.0.7 we get 3.22 = 3 sec, those time intervals differences are due to ansi c code? because im using the same code for calling PlcCycle() in both ansi c.

2.3v :

https://www.youtube.com/watch?v=23c2t3Imi9k

4.0.7v :

https://www.youtube.com/watch?v=svJ4a0odRIM
Wed Nov 9 2016, 12:48:43
(no subject) (by Alex)
i mean using the same ladder compiled with its own ldmicro version, each video is 35 sec interval test.
Wed Nov 9 2016, 12:51:59
(no subject) (by Ihor Nehrutsa)
to Alex

TON, TOF, RTO timers in LDmicro v2.3 are shorter than those specified in LD file. They shorter at one PLC cycle.

see
http://cq.cx/ladder-forum.pl?action=viewthread&parent=5139
Wed Nov 9 2016, 16:38:59, download attachment TON_TOF_RTO.ZIP
(no subject) (by Ihor Nehrutsa)
You must measure delay time between raise signal on input and raise signal on output of TON element.

raise front of input ___/-----------\_____
and raise front of output ____/-----\_____

TON and TOF, RTO usually must use for create time delays between the signals.

When you use it to generate a cycle XXX, then you must add one PLC cycle time to calculate a period of cycle XXX.

For example: Tcycle XXX = TON + TON + 1PLC = 50+50+10= 110ms
Wed Nov 9 2016, 17:06:32, download attachment test_times.zip
(no subject) (by Alex)
i see, then i was only watching from a perpective i can see time interval with "counter timer", in that way can we make sure that if i want 1 sec ton it will be 1 sec delay, i was wondering about that because when i was using 4.x.x v i got for example 25.4 sec or 30.7 sec and not like 25.000453 or 29.9999
Wed Nov 9 2016, 22:23:34
(no subject) (by Alex)
i saw files attach, good explanation, i guess osciloscope is better than counter timer.
Wed Nov 9 2016, 22:25:14
(no subject) (by Alex)
i can make sure about time using YPlcCycleDuty pin right?
Thu Nov 10 2016, 21:13:12
(no subject) (by Alex)
instead of using 1 sec TON in ladder i used 500ms+500ms=1 sec, actually in 4.0.7v time was more stable than 2.3v



----[TON 500.0 ms]---[TON 500.0 ms]----------------( )--
Thu Nov 10 2016, 22:21:04
(no subject) (by MGP)
Another bug I think in V407

I want to measuring the time that Xon is closed but it is always 0 in simulation mode.
Sat Nov 12 2016, 07:58:53, download attachment Snap166.jpg
(no subject) (by MGP)
Here is the LDfile.
Sat Nov 12 2016, 07:59:38, download attachment TimeMeasuring.ld
(no subject) (by Ihor Nehrutsa)
This version LD works.

But I think, that 'time' variable value must latched inside the formatting element and then convert to string.

v4.0.7 simulate as V2.3

Can you test in hardware?
Sat Nov 12 2016, 13:04:44, download attachment TimeMeasuring2.ld
(no subject) (by MGP)
Yes, I had already found it.
I use another variable now, and it works.
Sat Nov 12 2016, 16:15:32, download attachment TimeMeasuring.ld
(no subject) (by MGP)
Sending the time to a pc looks like this. ;-)
Sat Nov 12 2016, 16:17:12, download attachment Screensnap.jpg
(no subject) (by MGP)
I thought it was a bug this morning but I forgot the OSF after the uart instruction.
Sorry for the late reply.

The attached file is another possibility end this was the program I had in mind.
Sat Nov 12 2016, 16:39:53, download attachment TimeMeasuringV3.ld
(no subject) (by MGP)
Duh it is the same program as yours... sorry again.

I am testing hardware now, and my head is full of datasheets of photocells....
I also trying to reprogram a DL2616 display from HP, years ago I had it right and now it does not work anymore.
It has something to do with the strobe signal but that is for tomorrow.
Sat Nov 12 2016, 16:50:53
(no subject) (by Alex)
Could you please attach the hardware schematic?
Sat Nov 12 2016, 17:30:24
(no subject) (by MGP)
It measures the time of a regulated time flash from 1 to 100mS, a so called tachistoscope.
It very simple and it's not for me.
In Dutch...
Sat Nov 12 2016, 18:02:31, download attachment Schema.jpg
(no subject) (by Alex)
thanks a lot, wow i googled tachistoscope
Sat Nov 12 2016, 21:55:06
(no subject) (by MGP)
How do we use the new instructions UART BUSY/Available.
I get an error when I use this instruction in simulation mode.
Mon Nov 14 2016, 03:36:43, download attachment Snap167.jpg
(no subject) (by MGP)
My serial HP display is working again and I made a small video of the program above, only I replaced the photocell with a button.


https://www.youtube.com/watch?v=wG_n6ZqwhqM
Mon Nov 14 2016, 13:07:00
(no subject) (by Alex)
very nice program, how does your 7 seg display work? i see there is only one cable from pic to your 7 seg display board.
Mon Nov 14 2016, 14:05:16
(no subject) (by MGP)
Yes, only 1 wire + GND is needed, the onboard pic, in this case is programmed as serial display driver and so it's a standalone display and easy to use.

I can program the onboard 16F628a as serial driver or counter or whatever ;) in LDmicro.
This video, I made 2years ago, gives you a better view and the counting is software for video purposes.

The display is obsolete.

https://youtu.be/5w9AKaGBv3c
Mon Nov 14 2016, 15:34:36
(no subject) (by Alex)
that looks interesting, do you know where can i find some firmaware or information to build my own one :) ? or is it possible to do it with http://www.freewebs.com/x7jay7x/
Mon Nov 14 2016, 16:56:35
(no subject) (by MGP)
Building you own? you need to buy such a display (DL2614 or DL2616) if you can find one, they are very obsolete.

The software is written in LDmicro and if you have such a display I will make a schematic and cleanup de software and add some comment in the program for you, but not before you have a display ;)
Mon Nov 14 2016, 17:57:38
(no subject) (by Alex)
Sorry; i mean building one with 7 segment display; using some pic to recieve serial comunication and display the numbers; just for numbers; i am sure that here there is no that kind of display
Mon Nov 14 2016, 20:44:43
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):