News:

  • December 05, 2024, 06:27:47 AM

Login with username, password and session length

Author Topic: Analog input scaling  (Read 3137 times)

Jack Noir

  • Newbie
  • *
  • Posts: 1
Analog input scaling
« on: March 11, 2015, 12:29:37 PM »
Hello Everyone

Im new to the DirectSoft program and ive been just teaching myself how to use this program.

My current setup is a Direct Logic 205 Base with a DL260 CPU using a F2-08AD-1 analog input card placed on slot 0. A signet 9900 transmitter is connected to CH1 giving a 4-20 mA signal based on the temperature reading. the transmitter itself is set so that 4mA = 0deg F and 20mA = 200 Deg F. i ensured that everything is wired correctly and the proper signal is found on CH1 using an amp meter.

the code that i wrote (see below) has  V2011 giving the temp. data. however, when i tested for signal reading from 4mA to 20mA i get a range of 0-166 F. could someone please see where i went wrong?

Thanks!

CODE:

Rung 1: ANLGIN Base # K0
               Slot # K0
               Number of input Channels: K1
               Input Dad Format: K1 (BIN)
               Input Data Address: V420

Rung 2: SP1 ---------     LD: V420 | ANDD K7fff | V2010

Rung 3: SP1 ---------     LD:V2010 | BTOR | SUBR: V1400 | MULR: R0.1 | ADDR:V1400 | OUTD: V1400 | RTOB | OUT:v2011

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Analog input scaling
« Reply #1 on: March 11, 2015, 01:31:27 PM »
Try using the ANSCLB IBox instruction.

The code you posted is not doing scaling. It is filtering the signal. The result in v2011 should vary from 0 (at 0 degrees) to 4095 (at 200 degrees). Multiply that result (V2011) by 200 then divide by 4095 to get 0 - 200.
« Last Edit: March 11, 2015, 01:45:45 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.