Start a new topic

serial send delay between char.

 only display, without Arduino
a button send serial commands,


    How to insert a delay between a characters text?


this not work...


printh "ABC"

tm0.tim=1500

tm0.en=1

printh "DEF"

tm0.tim=500

tm0.en=1

printh "GHIJKLMNOP"


printh 38 65 66 67 38

delay=1500

printh 38 68 69 70 38

delay=500

printh 38 71 72 73 74 75 76 77 78 79 7A 38


Your ASCII characters need to be converted to their Hex values.

Your MCU will receive the byte, you need to cast the byte as a character.



1 person likes this

Using the printh command means printh values in the HMI are fixed and static.  They do not change.

There is no known method to send contents of string variables.



1 person likes this

it works with delay, thank you !
sorry Patrick, I have another step:

how we can insert special char.  <CR><LF> after a string?
print  (example)  123456<CR><LF>


printh 0X0D 0X0D    (hex for  <CR><LF>)        but result is 0x20 0x0d 0x21 0x92 not what I need.


thank you!

meaning of printh 0X0D 0X0D is turn pair 0X from hex to byte, turn pair 0D to byte and X is not a hexchar.

So you don't need the prefix 0x in the front of you hex byte just the two hexchar for the byte.
printh followed by space followed by one hexchar pair, space, pair, space, pair, space, pair, end-of-line
so <CR> is 0D and <LF> is 0A becomes ... printh 0D 0A
ABC<CR><LF> is printh 65 66 67 0D 0A

Be very careful with one space between and no space at the end.


1 person likes this

so simple and clear now  :)
I owe you a big coffee or beer Patrick !


1 person likes this
Brews were good, but fear it will have to be a coffee. :) One day

2 people like this
Login or Signup to post a comment