Author Topic: ADC voltage  (Read 12129 times)

brett

  • Newbie
  • *
  • Posts: 2
  • I'm a llama!
    • View Profile
ADC voltage
« on: November 21, 2006, 06:41:46 AM »
I recently bought a T100MD-888+ PLC,

I put a pot across the Analogue supply and read the ADC(1) input to an LCD, between 1.2 and 5 Volts I get 1000 to 4092, anywhere below 1.2v The values roll over to 9960 and then drop off drastically before rolling over once more at 0v, is this normal? And if so, is there any way to set the range of the ADC's for 0 to 5 v input?

Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:ADC voltage
« Reply #1 on: November 21, 2006, 08:42:30 AM »
I think your LCD is displaying the old data when it drops to below 4 digits. LCD display only overwrite data up to the length of the string.

E.g. old diplay value "A = 1234"

if you next display value "A = 99", the "34" is not erased, so you get A= "9934" !

A quick and dirty way to get rid of this is to add a few spaces behind the last displayed character to clear out old data:

  E.g. SETLCD 1,1, "A="+ STR$(ADC(1))+"    "

The spaces will erase the old data.  But if there are other text after the displayed value then you probably can't do that. In such case, run a separate SETLCD command to clear only those spaces where the values are to be displayed.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

brett

  • Newbie
  • *
  • Posts: 2
  • I'm a llama!
    • View Profile
Re:ADC voltage
« Reply #2 on: November 21, 2006, 10:06:34 PM »
Tried it and its working fine!
Thanks for the help... Such a silly thing to overlook.  :P