Host Engineering Forum

General Category => DirectSOFT => Topic started by: Jack Noir on March 11, 2015, 12:29:37 PM

Title: Analog input scaling
Post by: Jack Noir 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
Title: Re: Analog input scaling
Post by: b_carlton 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.