7 -9 A NALOG O UTPUT D ATA H ANDLING

7 -9 A NALOG O UTPUT D ATA H ANDLING

In the previous section, we explained how a module transfers a signal to the transducer, which sends it to the controlling output device. Now, we will discuss how the processor handles this data, along with some common methods of linearizing output data to reflect engineering units.

The storage or I/O table section of a PLC’s data table area holds the data to

be sent to an analog output module (see Figure 7-23). This data comes from program computations that, when sent to the module, will control an analog output device. During the execution of the output update, the processor sends the register/word contents to the analog module specified by the address in the instruction. The module transforms the register/word’s binary or BCD value into an analog output voltage or current. Since the program calculates the register/word value, the user should take precautions during programming to avoid computing or sending nonvalid ranges to the module. For example, if

a word location containing a binary value of +5173 is sent to a 12-bit resolution module without checking for range validity, the module will be unable to interpret the data, thus emitting an incorrect analog output signal (5173 in binary uses more than 12 bits).

Like their input counterparts, analog output modules can handle more than one channel at a time, so one module can control several devices. The instructions that are used with these output interfaces provide the capability of transferring several words or register locations to the module. These instructions are called block transfer out, analog out, block out, or location out instructions (see Chapter 9). It is possible, however, to find PLCs that use arithmetic or other instructions to send data to the analog module address, using the destination register of the instruction.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S E 2 C T IO

not used Analog Output

Instruction Used

Word Location 16-Bit Data Table or

In

Register Storage

-8 Voltage Signal

Return Line

Transducer

Analog Variable

In

5 12-Bit Register

t/O

u -8 T Holding Analog Value

2 7 0 A P R E 8 T Figure 7-23. Transformation of binary storage table data into an analog signal.

S ECTION Components The Analog C HAPTER 2 and Systems

Input/Output System 7

Some PLC manufacturers offer software instructions that scale data within the module or during the execution of the analog output instruction. Scaling takes a value and sends it to the module as a linearized count value. For example, let’s say an output module receives a BCD value of 5000, relating to an engineering unit (e.g., gallons per minute) halfway between 0000 and 9999 BCD. The software scaling instruction will change this value into the linearized, 12-bit, binary value 0111 1111 1111, or 2047 counts, which represents the halfway mark of the 0 to 4095 range.

Data transfers to analog modules with multiple output channels are updated one channel per scan. As with analog inputs, this update method does not create a noticeable delay, since the devices that respond to analog signals are slow in nature. The physical location of the module within the enclosure defines its address location (see Chapter 6 for I/O enclosures).

Figure 7-24 illustrates an example of an analog output module in an enclosure, along with its corresponding address location. A typical output instruction references a module by its slot and rack locations and the number of channels available or in use. A register called the source register stores the data to be transferred. The instruction specifies the starting source register address, and the starting source register transmits the specified number of channels. For

example, if the starting register is 300 8 and the number of channels is four, the processor will send the data contained in registers 300 8 through 303 8 (see

Figure 7-25).

00 01 02 03 04 05 06 07 Slot

Processor and Power Supply

Rack 0

Output Instruction Enable

Rack 0 Slot 03

Number of Channels 4

Source Register 300

Figure 7-24. An addressed analog output module.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION Components The Analog C HAPTER 2 and Systems

Input/Output System 7

Analog

Reg 300

To Analog Device #1

Output

Reg 301

To Analog Device #2

Module

Via block

Reg 302

transfer out

(12 Bit,

To Analog Device #3

instruction

4 Channel) Reg 303 To Analog Device #4 Word/

Register

Figure 7-25. Transfer of data from a source register.

Remember that the analog output signal from the module depends on the register or word value it receives from the processor. In some situations, the value computed for a control action is based on a 0000 to 9999 range (engineering units). This value must be converted (if the output instruction does not provide scaling) to the output module count range (i.e., 0 to 4095 counts or –2048 to +2048 counts) before it can be transferred to the module. Example 7-6 addresses this type of conversion.

E X AM PLE 7 -6

A programmable controller uses a bipolar –10 to +10 VDC signal to control the flow of material being pumped into a reactor vessel. The flow control valve has a range of opening from 0 to 100% to allow the chemical ingredient to flow into the reactor tank. The processor computes the required flow (the percentage of valve opening) through

a predefined algorithm. Analog flow meters send feedback informa- tion to the processor about other chemicals being mixed. A register stores the computed value for percentage opening, ranging from 0000 to 9999 BCD (0 to 99.99%).

(a) Find the equation of the line defining the relationship between the analog output signal (in counts) and the analog output transformation from –4095 to +4095 counts. The module has a 12-bit resolution and includes a sign bit as a function of voltage output and percentage opening.

(b) Illustrate the relationship of outputs in counts to the computed percentage opening as stored in the PLC register (0000 to 9999). Also, find the equation that describes the relationship between the required counts and the available calculated value stored in the register.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION Components The Analog C HAPTER 2 and Systems

Input/Output System 7

S OLU T I ON

(a) Figure 7-26 shows line Y , which represents the number of counts as a function of voltage and percentage opening. The line has the

form Y = mX + b , where m is the slope of the line and b is the value of

Y when X is 0.

Counts

Control Voltage –10 VDC to +10 VDC

0 to 100% opening

Reactor Vessel

Figure 7-26. Representation of percentage opening and analog output counts. The X-axis represents either the output voltage or the percentage

opening, depending upon which equation is derived. The Y-axis represents the number of counts output by the module for each X value (% or VDC). The following equation expresses the number of counts as a function of voltage:

To calculate b, replace Y with its value when X is 0 counts. When X is

0, Y is also 0; thus:

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION Components The Analog C HAPTER 2 and Systems

Input/Output System 7

This equation gives the value of Y in counts for any voltage X . The equation of line Y as a function of percentage can be computed in a similar manner:

Y = mX + b

m =∆ =

Y 8190 counts

To compute b, replace the count value Y when X is equal to 0%; this

value is –4095 (refer to Figure 7-26). Therefore:

This equation for Y gives the number of output counts for any

percentage value X .

(b) Figure 7-27 shows the relationship between the output in counts and the value stored in the register, expressed as 0000 to 9999. This graph is very similar to the previous one; however, the output equation is expressed as a function of the register value used.

Output Counts +4095

Register Value

Figure 7-27. Output counts versus register values (0000–9999).

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION Components The Analog C HAPTER 2 and Systems

Input/Output System 7

The equation for line Y showing the relationship between output counts and register value is:

∆ register value

9999 The value of Y when X equals 0 is –4095, so:

The value of Y will be the output count for any value X (percentage) ranging from 0000 to 9999. If this type of equation is implemented in

the PLC using standard decimal arithmetic instructions and a 0000 to 9999 register value encoded in BCD, the PLC’s software must convert the values from BCD to decimal.