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 recieve bug

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

Uart recieve bug (by Alex)
Hello, I have made a ladder using uart recieve instruction, I can't set more thsn 120 y simulación value, I set it to 500 but when simulating it change to 120, it is like it doesn't store value, sorry I am using my cellphone I can't load the ladder, i'll attach image

PD: my ladder is a blinking led but using TCY timer, I set blinking time period by changing value but can't make it blink slower with 120 "default" simulation value.
Tue Mar 3 2020, 20:43:10, download attachment bug_uart_recieve_simulation_value.jpg
(no subject) (by Alex)
Is not there but I am using size 4
Tue Mar 3 2020, 20:57:41
(no subject) (by MGP)
Here everything works as it should ( in the simulator).

You will receive a character (which is irrelevant).
at each received char (x) is a = a + 1
TCY is delayed as the 'var a' increases.
Wed Mar 4 2020, 02:19:39
(no subject) (by Alex)
Yes, it will work as it should, but the point of this ladder is that led blinking time depends on "a" var, but when "a" var is bigger than "x" var(120 default beacuse I can't change value, it is set 120 again when simulating if changed) output led keeps in high value, it stops blinking
Wed Mar 4 2020, 03:28:09
(no subject) (by MGP)
The value of "x" is irrelevant, so "a" can never be bigger than "x".

"a" is seen as how many char you have send, not the value of "x"
Wed Mar 4 2020, 04:04:59
(no subject) (by MGP)
I think you don't understand how the simulator works.

Start the simulator and you will also see a Simulator screen appear.
Make it active by clicking on it.
Then you can send a karackter to the program with the keyboard.
Press a key.

On the bottom screen you see "x" change in the value of the key and "a" increases by 1.
The value of "x" does not matter because with every keystroke "a" increases by 1 and also the time of the TCY.
Wed Mar 4 2020, 05:58:06
(no subject) (by Alex)
Yes you are right, it should be like that, but when simulating if "a value" is 120, output led blinks but when is 121 it stops blinking it keep high level, according to ladder logic x value doesn't matter but somehow if a value is higher that x value(120) blinking ladder logic is not working, I will récord video with my cellphone
Wed Mar 4 2020, 10:28:15
(no subject) (by Alex)
If simulating please try to blink led 10secods delay with TCY timer
Wed Mar 4 2020, 10:29:13
(no subject) (by MGP)
It works a it should, it works with all the buttons on the keyboard

For TCY(10S) you must "push" 1000 times on the keyboard (a=1000) or push until a=1000.

What does the TCY in de screen below the ladderscreen?
Wed Mar 4 2020, 10:45:37
(no subject) (by MGP)
Cycletime = 10ms for 10S and a=1000
Wed Mar 4 2020, 10:47:17
(no subject) (by Alex)
I have sinumated it, when x value reaches 128 the output doesn't blink anymore in simulation, I really want to upload the video I recorded but I am in a poor signal cellphones place :( I will be a le to upload it in some days when comwback to Town, sorry, for me doesn't work when I simulator it for more thstn 127 x value
Wed Mar 4 2020, 20:55:53
(no subject) (by Alex)
I made it with the video, my output blinks as it should in simulation, in video I am with 127 "a" value but when I press x button it is 128 "a" value now and output stops blinking

https://youtu.be/m_fX1xjqCho
Wed Mar 4 2020, 21:17:24
(no subject) (by Alex)
Btw, I am really sorry for the noise I am in my breaktime with some friends at work
Wed Mar 4 2020, 21:18:46
(no subject) (by Alex)
In this video x value is 0 but when I pressed x button once it changes to 120 value, why is it?

https://youtu.be/f_rkQJv_YPU
Wed Mar 4 2020, 21:23:35
(no subject) (by Alex)
In this video I want to change the 120 value, I changed to 500 but when I press x button it returns to 120 value
Why 120?

https://youtu.be/C2oiJwzDCAw
Wed Mar 4 2020, 21:30:43
(no subject) (by MGP)
This video's are too short and I need the hole screen to see what you trying to say.

Btw. In the last video you give "x" the value of 500 and "a" stays on 1, that means that the value of x=500 is not important only the number of keystrokes are valid.

Your program count the numbers of keystrokes!


As I suspected, you still don't understand how the simulation and your program works.

Read my thread of 05:58:06 again.

You have to activate the UART simulation screen by clicking on it and then press a key!
Thu Mar 5 2020, 02:32:37
(no subject) (by MGP)
I wil make a video.
Thu Mar 5 2020, 02:53:03
(no subject) (by MGP)
Thu Mar 5 2020, 02:55:55
(no subject) (by Alex)
Thanks for your reply Mgp, sorry for the late reply I had a lot of work, I kept watching your video thanks for the explanation, yes my videos are too short beacuse of the poor cellphone signal here, when I get home i'll make a complete one, yes I have read your thread I had uart simulation window activated in last video and that number 1 is beacuse I pressed x button once to show that the non important 500 number that changed to 120 when prexx x button for swxond time
I was going to explain but better do video, thanks for your reply again
Fri Mar 6 2020, 16:20:15
(no subject) (by MGP)
I don't understand why you make x = 500, "x" is the uart variable and those are only 8 bits and what is the point of this move?


"x" must take the value of the uart code received from the keyboard, everything else you do is wrong.
Fri Mar 6 2020, 17:06:10
(no subject) (by Alex)
Porblem solved, my tyc was in size 1, I changed to size 4 thanks Mgp
Sat Mar 7 2020, 21:31:23
(no subject) (by Alex)
i could finally watch your video at my pc, you were right i wasn´t understanding correctly this uart function, i thought by adding to the function value "x" only x would encrease "a" value, but with your video any value encreases "a" value i have tested it and it encreases "a" value with any button
Fri Mar 13 2020, 16:09:11
(no subject) (by MGP)
A video says more than 1000 words ;)
Sat Mar 14 2020, 04:04:03
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):