Poll

se puede lograr que los caracteres del lcd se desplazen

arquesina
0 (0%)

Total Members Voted: 0

Author Topic: desplazamiento de caracteres en lcd 2 x 16  (Read 10188 times)

danier

  • Newbie
  • *
  • Posts: 14
  • I'm a llama!
    • View Profile
desplazamiento de caracteres en lcd 2 x 16
« on: July 13, 2010, 08:38:49 PM »
hola a todos soy nuevo en la programacion de plcs
mi duda es la siguiente quiero hacer si es posible que los caracteres en el lcd 2 x 16 del plc f1616 se desplazen y que instrucciones debo enviar para esto
de ante mano gracias por su ayuda

[Google Translation]

hi all i am new to PLC programming
my question is this I do if it is possible that the characters in the LCD 2 x 16 f1616 plc slippage and I send instructions for this
beforehand thanks for your help
« Last Edit: July 19, 2010, 10:40:33 PM by support »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:desplazamiento de caracteres en lcd 2 x 16
« Reply #1 on: July 13, 2010, 09:18:19 PM »
You can connect the LCD216 to the F1616-BA PLC and use the SETLCD command to display anything on the LCD screen. All internal variables, I/Os, real time clock, analog and digital data can be displayed in real time on the LCD.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

danier

  • Newbie
  • *
  • Posts: 14
  • I'm a llama!
    • View Profile
desplazamiento de carateres lcd
« Reply #2 on: July 14, 2010, 11:18:41 AM »
gracias soporte por la respuesta pero mi pregunta es:
si es posible que un texto largo de varios caracteres se pueda desplazar en una linea del lcd 2 x 16 lo que se conoce com (marquesina) el texto es el siguiente;
"Buenos dias bienvenidos a la empresa xxxxxxxxxxx "
por lo que se el lcd es de 16 caracteres y el texto es mayor a 16
quiero saber que instruccion se utiliza para hacer que el texto se desplaze
soy de colombia y estoy muy interesado en sus productos, actualmente trabajo con el f 1616 ba

[Google Translation]
Support thanks for the reply but my question is:
whether it is possible over a number of text characters can move in a line of LCD 2 x 16 so-called com (marquee) text is as follows;
"Good morning, welcome to the company xxxxxxxxxxx"
so that the LCD is 16 characters and the text is greater than 16
I know that instruction is used to make the text moves
I'm from Colombia and I am very interested in their products, currently working with the f1616 ba
« Last Edit: July 19, 2010, 10:42:01 PM by support »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:desplazamiento de carateres lcd
« Reply #3 on: July 14, 2010, 11:32:21 AM »
The LCD does not inherently support the Marqee type running display. You probably will have to emulate that in software. E.g. Put your string inside a string variable:

A$ ="Buenos dias bienvenidos a la empresa xxxxxxxxxxx"

Then you can periodically display a substring from a different starting location:

N = N+1
IF N > LEN(A$) RETURN: ENDIF

B$ = MID$(A$,N,16)
SETLCD 1,1, B$+"                   "

If you run the above function every 0.2s it should show a running display.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

danier

  • Newbie
  • *
  • Posts: 14
  • I'm a llama!
    • View Profile
desplazamiento de caracteres en lcd
« Reply #4 on: July 16, 2010, 08:52:12 PM »
soporte gracias por su respusta profe y funciono perfectamente solo me queda un interrogante y es como hana vez y nescescer para que el desplazamineto de los caracteres se haga en forma repetitiva en el display 2 x 16 es decir la funcion los hace desplazar pero solo una  vez durnate la ejecucion del programa y necesito que sea repetitivo este mensaje
ademas tengo una funcion para lectura de temeperatura y debo hacer que tomr la lectura a cada minuto y muestre por lcd el la temperatura leyda a cada minuto
soporte gracias por sus valiosas respuestas ha sido de mucha ayuda para mi proyecto

[Google Translation]
thanks for your support and it worked perfectly professional respusta i only have one question and it's like time and nescescer hana to the displacement of the characters are repeatedly made in the display 2 x 16 ie function makes move but only once durnate the execution of the program and need to be repeated this message
also I have a function for reading and I make temeperatura tomr reading every minute and lcd display for the temperature every minute Leyda
thanks for your valuable support response has been very helpful for my project



« Last Edit: July 19, 2010, 10:43:13 PM by support »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:desplazamiento de caracteres en lcd 2 x 16
« Reply #5 on: July 16, 2010, 10:48:44 PM »
To periodically display something, all you need to do is to construct a ladder program and use a clock pulse to trigger the custom function periodically.

There are 8 built-in clock pulse with periods from 0.01s to 1 minute. E.g. use a 0.5s clock pulse you can make your display change every 0.5s.

Other time period can also be used but you need to construct a timer which reset itself after time out and you use the timer contact to trigger the custom function.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:desplazamiento de caracteres en lcd 2 x 16
« Reply #6 on: July 17, 2010, 10:06:59 PM »
This is an improvement on the marquee display code.  I've included both the ladder logic to update the display as well as the two custom functions.  

I know that this is not exactly the question that Danier posed. But it does give an example of how to invoke a custom function on a periodic basis.


  1st.Scan                                        InitMarquee
----||-----------------------------------------------{dCusF}

  Clk.0.2s                                     DisplayMarguee
----||-----------------------------------------------{dCusfF}


This is the code for the InitMarquee custom function:

' InitMarquee
'
' String in A$ is used as to generate a scrolling marquee
'
' On exit: z holds the current index into the A$ to be displayed
'          y holds lenght of marquee field
'
a$ = "Buenos dias. Bienvenidos a la empresa."
z = 1       ' Starting index into A$      
y = 16      ' display field width

This is the code for the DisplayMarquee custom function:

' DisplayMarquee
'
' On entry: A$ is the string to display
'          z holds the current index into the A$ to be displayed
'          y holds length of marquee field
'
'
'
' On exit: B$ holds string that is displayed
'          z is updated to the next position to display.
'          y is unchanged
'          A$ is unchanged
'
'
B$ = MID$(A$,z,y)

' Pad B$ to field with with " " (ASCII space)
'   Spaces are added to ensure that length of B$ is always
'   equal to the display field width.  This ensures that
'   each SETLCD command updates every character on the display.
'
' Note: the is sort of a lazy way to pad the string...
'
WHILE (LEN(B$) < Y)
   B$ = B$ + " "
ENDWHILE

' Next index
'
Z = Z + 1
IF (Z > LEN(A$))
   Z = 1         ' reset index to beginning of the string
ENDIF

SETLCD 1, 1, B$      ' display the string