Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Data Manipulation
and Math Instruction
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
3. Math Instructions
Data Manipulation Instruction
Each data manipulation instruction requires two or more words of data memory for
operation
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.
Data Transfer Operation
MOVE/LOGICAL
2. MVM (Masked Move)
Moves the source location to selected portion of the destination
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 0000000000000000
and the bit values in the source word are - 1111000011110000
and the bit setting in the mask address are - 0000000011111111
after the move, the destination will contain - 0000000011110000
Data Transfer Operation
MOVE/LOGICAL
3. AND (And)
Performs a bitwise AND 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.
Data Transfer Operation
MOVE/LOGICAL
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
Data Transfer Operation
MOVE/LOGICAL
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.
Data Manipulation Application
Changing the preset value of a timer using the move (MOV) instuction
Data Manipulation Application
(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
Data Transfer Operation
FILE/MISK
1. COP (Copy)
Example file copy instruction
Data Transfer Operation
FILE/MISK
2. FLL
Example FLL instruction.
Data Transfer Application
Using the FFL instruction to change all the data in a file to zero
Q&A
1. Batch Process
Consist of a sequence of one or more steps in a difined order.
Data Transfer Operation
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)
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)
Data Compare Instructions
ADD instruction
(Adds source A to source B and stores the result in the destination)
Application of Math Instructions
Counter program that uses the ADD instruction
Math Instructions
SUB instruction
(Subtracts source B from source A and stores the result in the destination)
Math Instructions
Divide (DIV) instruction used to calculate the value that result from dividing sources
A by sources B
Math Instructions
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?
Math Instructions
DDV instruction
Application of Data Manipulation Instructions