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 - uart loop stuck, help

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

uart loop stuck, help (by Alex)
hello, i made a ladder for printing on a lcd word "pausado" when counting stops and delete "pausado" when counter continues but in some point of the simulation loop stops, how can fix this.


https://youtu.be/ZbsfPUj9_rY
Wed Jul 18 2018, 17:10:37, download attachment counter_stop.ld
(no subject) (by MGP)
You need to look at the LCD variable when you press Xcontinue.

When lcd==3 then the master relay stops the program.
Thu Jul 19 2018, 03:39:25
(no subject) (by Alex)
thanks for your reply MGP, you´ve helped me with this before, here:


http://cq.cx/ladder-forum.pl?action=viewthread&parent=963

your example worked in that thread, i think it was less complicated because one single button made the "print/delete" message, but now i´m trying with 1 button for "print" and another button for "delete" message

here is the video in the past(in the thread you´ve helped me):

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

made new video now with 4411v, works ok too:

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

i made changes in the ladder i uploaded in this thread, loop doesn´t stop anymore, just need to delete message in lcd with \xFE\x58, here is what i got:

https://www.youtube.com/watch?v=nvD_y5xn4OA&feature=youtu.be

but sometime when i press "continue" button at the exact moment.. in ladder uart message keeps like sending (see video), would it make troubles? same happens in ladder of the other thread you´ve helped me but in real life it works ok:

https://www.youtube.com/watch?v=a7ZJ6z6qOh8&feature=youtu.be
Thu Jul 19 2018, 15:32:41
(no subject) (by Alex)
modificated ladder attach
Thu Jul 19 2018, 15:36:05
(no subject) (by Alex)
ladder here
Thu Jul 19 2018, 15:37:19, download attachment counter_stop_v2.ld
(no subject) (by MGP)
You have to wait until the rung has done.
I added a relay (Rok) and now it's working.

But you can do better than this I think ;-)
Thu Jul 19 2018, 18:54:53, download attachment counter_stop_v3.ld
(no subject) (by Ziggy)
Is there a possibility a separate topic is started on RS232 protocols and ways of implementing comms link(s)?

Perhaps a general tutorial on UART use?
Fri Jul 20 2018, 02:27:19
(no subject) (by Alex)
thanks MGP, you idea gave me another idea, i added another internal coil, but i had to move the delete message command (\xFE\x58) almost at the beginning (rung 2):

https://www.youtube.com/watch?v=xEpWZ3vBT2Q&feature=youtu.be


if delete command was at the end (rung 15) it keeps like sending, see video please:

https://www.youtube.com/watch?v=L3RMIApu6VE&feature=youtu.be

As you can see, moving delete command almost at the beginning it doesn´s stuck apparently, in second 0:25 (last video at rung 9 uart stucks) because loading hex to my pic sometimes work but sometimes it doesnt delete message i think it is due to the stucking, see video please:

https://www.youtube.com/watch?v=XFbEnIx-F8c&feature=youtu.be

maybe there are some features we want for our lcd projects, are there more good ways to do it?, is this the best way to print or delete a message? and as Ziggy said "Perhaps a general tutorial on UART use?"
Fri Jul 20 2018, 09:47:58
(no subject) (by Alex)
ladder attach
Fri Jul 20 2018, 09:52:47, download attachment counter_stop_v4.ld
(no subject) (by MGP)
You made the same error, I don't see relay Rok anymore.

Get rid of the master relay, you only have 1 rung in it, so a simple contact will do.
Fri Jul 20 2018, 12:37:57
(no subject) (by Alex)
you were right i added Rok and another coil Rdelete now it seems that works:

https://www.youtube.com/watch?v=xhlUpX4RsPU&feature=youtu.be

i will configured for not using master relay
Fri Jul 20 2018, 15:52:23, download attachment counter_stop_v4.ld
(no subject) (by Alex)
i also used Rdelete with SET and RESET it also seems that works
Fri Jul 20 2018, 15:54:25, download attachment counter_stop_v5_SET_RESET.ld
(no subject) (by Alex)
without master relay
Fri Jul 20 2018, 18:14:58, download attachment counter_stop_v6.ld
(no subject) (by MGP)
Again not ok, because when lcd==1 and you push Xcontinu then the screen will refresh ( what takes some time) and then you immediately send then next rung (005)

Use the variable 'lcd' instead of Rdelete, and refresh on lcd=='0' then make lcd==1 and so on.
Sat Jul 21 2018, 03:00:53
(no subject) (by MGP)
NB. you can also use the instruction (IS READY?) to send, but I have no experience with because its a new instruction.
Sat Jul 21 2018, 03:16:48
(no subject) (by Alex)
I think i finally made it, i tried to focus on lcd variable as you said and this is what i got, now i can press button "continue" faster without waiting that little time to "delete", thanks for your help MGP:


https://www.youtube.com/watch?v=XufBc4Uwxhs&feature=youtu.be
Sat Jul 21 2018, 22:07:33, download attachment counter_stop_v7.ld
(no subject) (by MGP)
It looks much better, I can only simulate it but your video says it all.

Now you've been thinking about this problem, better than someone else's program. ;-)
Sun Jul 22 2018, 02:30:48
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):