12
DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an 8-bit word before becoming an input to a PLC. The operations that may be carries out with a PLC on data words normally include: 1. Moving data. 2. Comparison of magnitudes of data, (i.e.)greater then, equal to or less than. 3. Arithmetic operations such as addition and subtraction. 4. Conversions between binary coded decimal (BCD), binary and octal.

DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

Embed Size (px)

Citation preview

Page 1: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

DATA HANDLING• Some situations arise where a group of bits have to be handled.

• (ex) a sensor supplies an analogue signal which is converted to, say, an 8-bit word before becoming an input to a PLC.

• The operations that may be carries out with a PLC on data words normally include:

1. Moving data.

2. Comparison of magnitudes of data, (i.e.)greater then, equal to or less than.

3. Arithmetic operations such as addition and subtraction.

4. Conversions between binary coded decimal (BCD), binary and octal.

Page 2: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

DATA REGISTERS• Data instructions also require memory addresses.

• The locations in the PLC memory allocated for data are termed as data registers.

• Each data register can store a binary word of usually, 8 or 16 bits.

• Addresses are given as D0,D1,D2 and so on.

• A 8-bit word means that a quantity is specified to a precision of 1 in 256, a 16-bit a precision of 1 in 65536.

• Each instruction has to specify

1. the form of the operation

2. the source of the data used in terms of its data register

3. the destination data register of the data.

Page 3: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

DATA MOVEMENT

• For data movement, the instruction will contain

1. Move data instruction

2. The source address of the data

3. The destination address of the data

• The following is the ladder rung to transfer data from D1 to D2.

Step Instruction Notation

0 LD X300

1 MOV

2 D1

3 D2

Page 4: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

DATA COMPARISONCOMPARISON SYMBOL CODELess than < LESEqual to = EQULess than or equal to <= LEQGreater than > GRTGreater than or equal to >= GEQNot equal to <> NEQ

The comparison instruction consists of:1. Comparison instruction 2. The source address of the data3. Destination address

Step Instruction Notation

0 LD X300

1 >

2 D1

3 D2

(ex) to see if D1 is greater than D2

Page 5: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

SAMPLE APPLICATION OF DATA COMPARISON

• Comparison might be used when signals from two sensors are to be compared by the PLC before action is taken.

• (ex) an alarm might be required to be sounded if a sensor indicates a temperature above 80oc and remain sounding until temperature falls below 70oc

Page 6: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

ARITHMETIC OPERATIONS

• The instruction to add or subtract consists of:

1. The instruction.

2. The register containing the address of the value to be added or subtracted.

3. The address of the value to which the addition or from which the subtraction is to be made.

4. The register where the result is to be stored.• It may be used to alter the value of some sensor input value, perhaps a

correction or offset term or alter the preset values of timers or counters.• The following shows the form used for the ladder symbol for addition

with OMRON.

Page 7: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

CODE CONVERSIONS

• All internal operations in the CPU of a PLC are carried out using binary numbers.

• So when input is a decimal, conversion to binary required.

• Also when a decimal output is required, conversion from Binary to decimal is needed.

• (ex) following is the rung employed in conversion from BCD to binary.

Page 8: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

ANALOG INPUT/OUTPUT

• Many sensors generate analog signals and many actuators require analog signals.

• Thus, some PLCs have A-D converter fitted to input channels and D-A converter fitted to output channels.

• (ex) speed control of a motor so that its speed moves up to its steady value at a steady rate. The program is as shown below:

Page 9: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

Contd…

• A PLC equipped with analog input channels can be used to carry out a continuous control function, (i.e) PID control.

• To carry out proportional control on an analog input the following set of operations can be used:

1. Convert the sensor output to a digital signal.

2. Compare the converted actual sensor output with the required sensor value (i.e) the set point and obtain the difference(error).

3. Multiply the error by the proportional constant Kp.

4. Move this result to the D-A converter output and use the result as the correction signal to the converter.

Page 10: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

SAMPLE APPLCATION OF ANALOG I/O

• Temperature controller.

• The input could be from a thermocouple, which after amplification is fed through an A-D converter into the PLC.

• The PLC is programmed to give an output proportional to the error between the input from the sensor and the required temperature.

• The output word is then fed through a D-A converter to the actuator, a heater, in order to reduce the error. (program in next slide).

Page 11: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

TEMPERATURE CONTROL

Page 12: DATA HANDLING Some situations arise where a group of bits have to be handled. (ex) a sensor supplies an analogue signal which is converted to, say, an

SELECTION OF A PLC

• Criteria to be considered are as follows:

1. What i/o capacity is required, (i.e) the number of i/o, capability of expansion for future needs.

2. What types of i/o are required, (i.e) isolation, onboard power supply for i/o, signal conditioning.

3. What size of memory is required? This is linked to the number of i/o and the complexity of program used.

4. What speed and power is required for the CPU? This is linked to the number of types of instruction that can be handled by a PLC. As the number of types increases , a faster CPU is required. Likewise, the greater the number of i/o to be handled the faster the CPU required.