data manipulation and math instruction on rslogix 500

55
Data Manipulation and Math Instruction Lino Hugun Saputra (23315309) INSTITUT TEKNOLOGI BANDUNG

Upload: lino-hugun-saputra

Post on 26-Jan-2017

128 views

Category:

Software


14 download

TRANSCRIPT

Page 1: Data Manipulation and Math Instruction on RSLogix 500

Data Manipulation and Math Instruction

Lino Hugun Saputra (23315309) INSTITUT TEKNOLOGI BANDUNG

Page 2: Data Manipulation and Math Instruction on RSLogix 500

Data Manipulation and Math Instruction

Data Manipulation involves transfer of data and operation on data with math instruction, data conversion, data comparison, and logical operations.

1. Data Transfer Operation

2. Data Compare Instructions

3. Math Instructions

Page 3: Data Manipulation and Math Instruction on RSLogix 500

Data Manipulation Instruction

Each data manipulation instruction requires two or more words of data memory for operation

Data file, word, and bits

Page 4: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

Data transfer concept

Page 5: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

1. MOV (Move)Moves the source value to destination

Source is the address of the data you want to move. The source can be a constant.Destination is the address that identifies where the data is to be moved.

MOVE/LOGICAL

Page 6: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

2. MVM (Masked Move)Moves the source location to selected portion of the destination

Source is the address of the data you want to move.Mask is the address of the mask through which the instruction moves data. Destination is the address where the instruction moves the data.

MOVE/LOGICAL

Page 7: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

Mask is the address of the mask through which the instruction moves data. The mask can also be a hexadecimal value. You can enter the value in binary, decimal, or hexadecimal. RSLogix 500Micro will make any necessary conversion and display the hexadecimal value.

The mask acts like a filter for the destination. The pattern of characters in the mask determines which bits will be passed from the source to the destination, and which bits will be masked. Only bits in the mask that are set (1) will pass data to the destination.

For example:If before the move, the destination address contains 0000000000000000and the bit values in the source word are - 1111000011110000and the bit setting in the mask address are - 0000000011111111after the move, the destination will contain - 0000000011110000

Page 8: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

3. AND (And)Performs a bitwise AND operation

Sources A and B can be either word addresses or constants; however, both sources cannot be a constant. The Destination must be a word address.

MOVE/LOGICAL

Page 9: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

4. OR (Or)Performs a bitwise OR operation

Sources A and B can be either word addresses or constants; however, both sources cannot be a constant. You can enter a constant or a word address for either Source parameter.The destination must be a word address.

MOVE/LOGICAL

Page 10: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

5. XOR (Exculive Or)Performs a bitwise XOR operation

Sources A and B of the XOR instruction are Exclusive ORed bit by bit and stored in the destination. Sources A and B can be either word addresses or constants; however, both sources cannot be a constant.

MOVE/LOGICAL

Page 11: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

6. NOT (Not)Performs a NOT operation

The source of the NOT instruction is NOTed bit by bit and stored in the destination.The source and destination must be word addresses

MOVE/LOGICAL

Page 12: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

7. CLR (Clear)Sets all bits of a word to zero.

When rung conditions are true, this output instruction sets all the bits in a word to zero. The destination must be a word address.

MOVE/LOGICAL

Page 13: Data Manipulation and Math Instruction on RSLogix 500

Data Manipulation Application

Changing the preset value of a timer using the move (MOV) instuction

Page 14: Data Manipulation and Math Instruction on RSLogix 500

Data Manipulation Application

Moving data using file instruction

Page 15: Data Manipulation and Math Instruction on RSLogix 500

Data Manipulation Application

SLC 500 word and file address

(a) Adrress N7:30 is a word address that represents a single word: word number 30 in integer file 7

(b) Address #N7:30 represents the starting address of a group of conssecutive words in integer file 7. The length shown is eight words, which is determained by the instruction where the file address is used

Page 16: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

1. COP (Copy)Example file copy instruction

FILE/MISK

Page 17: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

2. FLL Example FLL instruction.

FILE/MISK

Page 18: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Application

Using the FFL instruction to change all the data in a file to zero

Page 19: Data Manipulation and Math Instruction on RSLogix 500

Q & A

1. Aplikasi data manipulation and math instruction di industri?2. Pengoperasian filter yang ada pada perintah MVM (masked move)?3. Jika ada dua perintah pada rung yang berbeda, tetapi mengirimkan data ke alamat

memori yang sama. Mana yang menang?4. Word & file apakah istilah yang hanya digunakan di Allen Bradley atau yang lain

juga sama?5. Kerja file to word bagaimana?6. File to file jika ada beda length, apa yang terjadi?7. Beda FFL dan COP?8. Tujuan block ladder selalu diberi input?9. Cara memindahkan data bit to word? Dari Input ke N (integer) ?10. Cara memindahkan data word to bit? Dari N (integer) ke O?

Page 20: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

1. Batch ProcessConsist of a sequence of one or more steps in a difined order.

Page 21: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

5. FAL (file arithmatic and logic)Example FAL instruction.

Page 22: Data Manipulation and Math Instruction on RSLogix 500

Data Transfer Operation

9. BTD (bit distribute)Example BTD instruction.

Page 23: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

Basic PLC data compare instructions

Page 24: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

Compare menu tab

Page 25: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

EQU logic rung(Tests whether two values are equal)

Page 26: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

NEQ logic rung(Tests whether one values is not equal to a second value)

Page 27: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

GRT logic rung(Tests whether one values is greater than a second value)

Page 28: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

LES logic rung(Tests whether one values is less than a second value)

Page 29: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

GEQ logic rung(Tests whether one values is greater than or equal to a second value)

Page 30: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

LEQ logic rung(Tests whether one values is less than or equal to a second value)

Page 31: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

LIM instruction where the low limit value is less then the high limit value(Tests whether one values is within the limit range of two other value)

Page 32: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

LIM instruction where the low limit value is greater then the high limit value

(Tests whether one values is within the limit range of two other value)

Page 33: Data Manipulation and Math Instruction on RSLogix 500

Data Compare Instructions

Masked comparison for equal (MEQ) logic rung(Tests portion of two values to see whether they are equal. Compare 16-bit data of a source

address to 16-bit data at a reference address thrugh mask)

Page 34: Data Manipulation and Math Instruction on RSLogix 500

Application of Data Compare Instructions

Timer program using the EQU instruction

Page 35: Data Manipulation and Math Instruction on RSLogix 500

Application of Data Compare Instructions

Counter program using the LES instruction

Page 36: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

Compute/Math menu tab

Page 37: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

CPT ( compute) instruction(Evaluate an expression and stores the result in the destination)

Page 38: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

ADD instruction(Adds source A to source B and stores the result in the destination)

Page 39: Data Manipulation and Math Instruction on RSLogix 500

Application of Math Instructions

Counter program that uses the ADD instruction

Page 40: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

SUB instruction(Subtracts source B from source A and stores the result in the destination)

Page 41: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

Multiply instruction (MUL)(Multiplies sourch A by source B and stores the result in the destination)

Page 42: Data Manipulation and Math Instruction on RSLogix 500

Application of Math Instructions

Multiply (MUL) instruction used to calculate the product of two sources

Page 43: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

Divide instruction (DIV)(Divide sourch A by source B and stores the result in the destination and math register)

Page 44: Data Manipulation and Math Instruction on RSLogix 500

Application of Math Instructions

Divide (DIV) instruction used to calculate the value that result from dividing sources A by sources B

Page 45: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

Square instruction (SQR)(Calculates the square root of the source and places the integer result in the destination)

Page 46: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

Negate instruction (NEG)(Changes the sign of the source and places it in destination)

Page 47: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

TOD (convert to BCD) instruction(Converts a 16-bit integer source value to BCD and stores it in the math register or the destination)

Page 48: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

FRD (convert from BCD) instruction(Converts a BCD value in the math register or the source to an integer and stores it in the destination)

Page 49: Data Manipulation and Math Instruction on RSLogix 500

Q & A

1. Fasilitas instruksi dari masing-masing menu tab sudah tetap atau bisa di upgrade?2. Pada instruksi compute apakah semua operasi matematis bisa dilakukan?3. Apakah bisa menggunakan memori float pada memori tujuan dari hasil matematis

yang dilakukan pada perintah compute?4. Kalau Hexadesimal BCD bisa menggunakan input huruf tidak? Huruf A sebagai

pengganti nomor 10 misalnya?5. Bisakah rumus di blok compute disimpan dulu agar dapat digunakan/ dipanggil

kembali untuk perhitungan lainnya?6. Apa implementasi convert to BCD (TOD)?7. Apa implementasi convert from BCD (FRD)?8. Adakah intruksi yang digunakan untuk mengkonversi BCD ke graycode?9. Apa fungsi DDV?

Page 50: Data Manipulation and Math Instruction on RSLogix 500

Math Instructions

DDV instruction

Page 51: Data Manipulation and Math Instruction on RSLogix 500

Application of Data Manipulation Instructions

Memindahkan tiap bit data yang ada pada input ke output

Page 52: Data Manipulation and Math Instruction on RSLogix 500

Application of Data Manipulation Instructions

Set-point control program

Page 53: Data Manipulation and Math Instruction on RSLogix 500

Application of Math Instructions

Converting Celsius temperature to Fahrenheit

Page 54: Data Manipulation and Math Instruction on RSLogix 500

Application of Math Instructions

Vessel overfill alarm program

Page 55: Data Manipulation and Math Instruction on RSLogix 500

Application of Math Instructions

Temperature control program