(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.
(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.
(no subject) (by Alex)
simulate in 2.3, this one in 4.0.7
(no subject) (by Alex)
i attach file and video to explain this:
(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? ).
(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
(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.
(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)
(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.
(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
(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
(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
(no subject) (by Alex)
i mean using the same ladder compiled with its own ldmicro version, each video is 35 sec interval test.
(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
(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
(no subject) (by Alex)
i saw files attach, good explanation, i guess osciloscope is better than counter timer.
(no subject) (by Alex)
i can make sure about time using YPlcCycleDuty pin right?
(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]----------------( )--
(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.
(no subject) (by MGP)
Here is the LDfile.
(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?
(no subject) (by MGP)
Yes, I had already found it.
I use another variable now, and it works.
(no subject) (by MGP)
Sending the time to a pc looks like this. ;-)
(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.
(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.
(no subject) (by Alex)
Could you please attach the hardware schematic?
(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...
(no subject) (by Alex)
thanks a lot, wow i googled tachistoscope
(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.
(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.
(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
(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/
(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 ;)
(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
Post a reply to this comment:
|