Author Topic: ADC  (Read 11983 times)

tobor0216

  • Newbie
  • Posts: 24
  • I'm a llama!
    • View Profile
ADC
« on: June 07, 2009, 03:09:29 PM »
I have a temp sensor connected to ADC(2). The output of this sensor is linear between 0-1 volts. For example if it is 75 degrees, the sensor will read .75.
I am trying to read the sensor and store it in DM[101]. The calculation I am using is DM[101] = (168*(ADC(2)-261)/1376+32) and I am reading it every second. The problem I am having is the reading just keeps increasing until it reaches 4092. How can I prevent this from happenig. I just want to read the sensor every second and display it on a HNI.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:ADC
« Reply #1 on: June 07, 2009, 11:50:57 PM »
It seems like you may have connected to the wrong pin? Make sure that you have actually connected to pin 7 (ADC 2) if it is aMD888+.

Also use a multi-meter to measure the input to ADC(2) to make sure that the voltage presented to the PLC is correct.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

tobor0216

  • Newbie
  • Posts: 24
  • I'm a llama!
    • View Profile
Re:ADC
« Reply #2 on: June 08, 2009, 03:05:59 AM »
The sensor is connected to pin 7, and I have measured the voltage. The voltage is reading .78. I tried this on ADC's 1-8 with the smae result.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:ADC
« Reply #3 on: June 08, 2009, 07:09:17 AM »
What PLC model are you using? If it is a T100MD1616+ you will need to connect an Analog power supply voltage to the PLC. Please check the T100MD1616+ installation guide for details.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

tobor0216

  • Newbie
  • Posts: 24
  • I'm a llama!
    • View Profile
Re:ADC
« Reply #4 on: June 08, 2009, 08:39:10 AM »
I have a T100MD888+ PLC, and I have the sensor connected to the 5VDC and Gnd pins on the ADC connector.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:ADC
« Reply #5 on: June 08, 2009, 09:03:02 AM »


Do you have a 10K potentiometer? If you do try to connect one side arm to the +5V, another side arm to the 0V, and the center arm to the ADC #2 (pin 7).

Write the simplest program to read the ADC every second.

E.g.
    Clk:0.5s               Fn1
|---||----------------{dCusF}

Inside function Fn1:

   FOR I = 1 to 8
       DM = ADC(I)
   NEXT


This ensures that all 8 ADC channels are read. Go to online monitoring and check the ADC readings on the "View Variable" screen. Now turn the potentiometer so that the voltage applied to the ADC varies and see which ADC channel is working.

Another test would be connect a cable from the analog ground (0V) to each ADC input one at a time and see if the online monitoring screen shows that the corresponding ADC channels reads zero.

If the ADC still does not produce correct result with the above tests then your PLC's ADC port may be damaged and please arrange for an RMA.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS