storing and organizing data

67
Storing and Organizing Data

Upload: odell

Post on 05-Jan-2016

23 views

Category:

Documents


0 download

DESCRIPTION

Storing and Organizing Data. Why Do I Need to Understand How Data Is Represented?. In order to install, program,maintain, and troubleshoot today’s PLCs, you must understand the different methods by which internal data is represented. Objectives. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Storing and Organizing Data

Storing and Organizing Data

Page 2: Storing and Organizing Data

Why Do I Need to Understand How Data Is Represented?

• In order to install, program,maintain, and troubleshoot today’s PLCs, you must understand the different methods by which internal data is represented.

Page 3: Storing and Organizing Data

Objectives

• Identify the commonly used number systems used in PLCs.

• Convert binary data to decimal.

• Examine how data is stored in PLC data tables.

• Describe how BCD field devices interface.

Page 4: Storing and Organizing Data

PLC Words

• One measure of a computer’s capabilities is the length of the data words on which it can operate.

• Many current PLCs use 16-bit words.• Many newer PLCs use 32-bit words.• SLC 500 and PLC 5 family PLCs are 16-bit

computers.• Control Logix is a 32-bit computer.

Page 5: Storing and Organizing Data

Number Systems Typically Used with PLCs

Page 6: Storing and Organizing Data

We Use Words to Represent Information

• Our words are groups of characters grouped together to represent something.

• The words we use are of different lengths.– Controller– The– Monday

Page 7: Storing and Organizing Data

We Use Symbols Called Numbers to Represent Data

• Everyday numbers are decimal. 12,345

Page 8: Storing and Organizing Data

Computers Do Not Understand

• Computers do not understand the words and numbers humans use.

• Computers have their own language called binary.

Page 9: Storing and Organizing Data

Binary Concept

• Two-state devices are described as either discrete or digital devices.– Discrete or digital devices are simply either on

or off.– Binary is based on two states, on or off.

Page 10: Storing and Organizing Data

Binary Language

• Binary information is also represented in groups of characters.

• A group of binary digits called bits can be organized into words.

• Binary bits consist of only two characters– 1 and 0

Page 11: Storing and Organizing Data

Binary Words

• 16 bits grouped together is called a word.

• A binary word might look like:

1010 1010 1010 1010 1010

Page 12: Storing and Organizing Data

Information Represented as Combinations of Bits

Page 13: Storing and Organizing Data

Decimal Numbers

• Ten digits– 0,1,2,3,4,5,6,7,8,9

• Base or radix– 10

• Weights– 1, 10, 100, 1000

Page 14: Storing and Organizing Data

Decimal Number System

Page 15: Storing and Organizing Data

The Binary Number System Has the Following Characteristics

• Two digits– 0 or 1

• Base or radix– 2

• Weights– 1, 2, 4, 8, 16, 32, 64…

Page 16: Storing and Organizing Data

16-bit Binary Word Bit Weighting

MSB LSB

• LSB = least significant bit• MSB = most significant bit

Page 17: Storing and Organizing Data

Binary Numbers Place Values

Page 18: Storing and Organizing Data

Binary Number Weighting

Page 19: Storing and Organizing Data

Decimal 0 through 7 Represented with Binary Bits

Page 20: Storing and Organizing Data

Comparison of Decimal to Binary Numbers

Page 21: Storing and Organizing Data

Parts of a 16-bit Word

Page 22: Storing and Organizing Data

Bytes, Nibbles, and Bits

Page 23: Storing and Organizing Data

PLC Data Formats

• Two 8-bit unsigned bytes of data

• 16-bit unsigned integer

• 16-bit signed integer

• 32-bit signed integer

• Binary coded decimal

• Hexadecimal

Page 24: Storing and Organizing Data

Two 8-bit Unsigned Bytes of Data

Page 25: Storing and Organizing Data

Hexadecimal

Page 26: Storing and Organizing Data

16-bit Signed Integer

Page 27: Storing and Organizing Data

16-bit Unsigned Integer

Page 28: Storing and Organizing Data

32-bit Signed Integer (1 of 2)

0 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0

0 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0

Double Word

Sign bit

Lower 31 bits contain the value

32 – bit signed integer data range:

-2,147,483,648 to +2,147,483,647

Page 29: Storing and Organizing Data

32-bit Signed Integer (2 of 2)

0 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0

0 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0

Double Word

WordWord

Byte Byte Byte Byte

Page 30: Storing and Organizing Data

Basic PLC Data TypesData Type Description Size Range

Bool Single bit Bit 1 = ON

0 = OFF

Sint 8 bits Byte -128 to

+127

Int 16 bits Word -32,768 to +32,767

Dint 32 bits Double

Word

-2,147,483,648 +2,147,483,647

Real Floating point Real or

floating Point

Larger than Dint or with Decimal

point

Page 31: Storing and Organizing Data

Data Table Format

• Words are 16 bits.– Bits 0 through bit 15

• First word or bit is always 0.

• SLC 500 data tables can contain up to 256 words (0 to 255).

• PLC 5 data tables can contain up to 1,000 words (0 to 999).

Page 32: Storing and Organizing Data

Words Arranged in a Data Table

Page 33: Storing and Organizing Data

Status Table Words Assigned by Module Requirements

• The number of status table words assigned depend on what a specific module needs.– 16-point module equals 16 bits.– 32-point module equals 32 bits.– Four-channel analog equals four words.– Eight-channel analog needs eight.

Page 34: Storing and Organizing Data

SLC 500 I/O Configuration

Page 35: Storing and Organizing Data

16-point Module’s I/O Points Represented in a Word

Page 36: Storing and Organizing Data

Physical Input Conditions and the Corresponding Input Data Word

Page 37: Storing and Organizing Data

8-Point Input Module Represented in a Word

Page 38: Storing and Organizing Data

SLC 500 Input Status Table

Page 39: Storing and Organizing Data

24-point I/O Module Represented in Two Words

Page 40: Storing and Organizing Data

Two Words Representing Inputs for a 32-bit Module

Page 41: Storing and Organizing Data

Output Status File Correlation to Module

Page 42: Storing and Organizing Data

SLC 500 Digital Outputs

Page 43: Storing and Organizing Data

Four Words Representing a Four-channel Analog Module

Channel 0

Channel 1

0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1

0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

1 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0

Channel 2

Channel 3

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Page 44: Storing and Organizing Data

SLC 500 Analog Input Channels

Page 45: Storing and Organizing Data

SLC 500 Output Analog Channels

Page 46: Storing and Organizing Data

So, What’s in It for ME??

• I need to be able to work with different number systems.– PLC configuration– PLC troubleshooting– Program interpretation– Error code

interpretation– Data conversion to

different hardware

Page 47: Storing and Organizing Data

SLC 500 Analog Input Module Configuration

• You need to configure a 1747sc-INI4i analog input module.

• Module configuration specifications are listed below.

Page 48: Storing and Organizing Data

Channel Configuration Word

SLC 500Processor

AnalogInput

ModuleAnalog Input Signal

Channel Data Word

Channel Status Word

Channel Configuration

Page 49: Storing and Organizing Data

Specifications

• Enable the input channel

• 4- to 20-mA input range

• Work in engineering units

• Pump to run maximum if open input

• 60-Hz input filter

• Auto calibration disabled

Page 50: Storing and Organizing Data

What Do You Need to Do?

• Determine the 16-bit data word for the configuration.

• Convert the binary word into decimal.

• Program a move instruction on your SLC 500 ladder to move the configuration data to each analog channel.

Page 51: Storing and Organizing Data

Input Channel Configuration Word

Page 52: Storing and Organizing Data
Page 53: Storing and Organizing Data

• What value will you enter into the move instruction’s source?

Page 54: Storing and Organizing Data

Understanding Binary Coded Decimal (BCD)

Page 55: Storing and Organizing Data

Single-digit BCD Thumb-wheel Interfaced to a PLC

Page 56: Storing and Organizing Data

Binary Coded Decimal Number Bit Patterns

Page 57: Storing and Organizing Data

Binary Coded Decimal

Page 58: Storing and Organizing Data

Two-digit BCD Thumb-wheel Interface

Page 59: Storing and Organizing Data

Four-digit BCD Thumb-wheel

Page 60: Storing and Organizing Data

Output Module Connected to Seven-segment Display

Page 61: Storing and Organizing Data

Comparison of BCD to Decimal and Binary Numbers

Page 62: Storing and Organizing Data

BCD Invalid Codes

Page 63: Storing and Organizing Data

Decimal, Hexadecimal, and BCD Comparisons

Page 64: Storing and Organizing Data

SLC 500 Conversion from BCD

Page 65: Storing and Organizing Data

SLC 500 Converting to BCD

Page 66: Storing and Organizing Data

PLC 5 Converting from BCD

Page 67: Storing and Organizing Data

PLC 5 Converting to BCD