Data Manipulation Instructions in Controller Programming
Discover how data manipulation instructions in controller programming enable quantitative decision-making through data operations like comparisons, arithmetic, and conversions. Learn about the different classes of instructions, memory mapping, and data transfer concepts.
Download Presentation
Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Data manipulation instructions allow numerical data stored in the controller s memory to be operated on within the control program The use of data manipulation extends a controller s capability from that of simple on/off control based on binary logic, to quantitative decision making involving data comparisons, arithmetic, and conversions which in turn can be applied to analog and positioning control There are two basic classes of instructions to accomplish data manipulation. Instructions that operate with: Single word data File, or block which involve multiple words
Each data manipulation instruction requires two or more words of data memory for operation Section of memory map Binary bit Word or register 1 0 1 1 0 1 1 1 0 1 0 1 0 1 1 1 The words of data memory in singular form may be referred to either as registers or as words, depending on the manufacturer 1 1 0 1 1 0 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 0 0 0 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 0 1 1 1 1 0 1 1 1 0 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 File or table The terms table or file are generally used when a consecutive group of related data memory words is referenced Data files, words, and bits
Data transfer instructions simply involve the transfer of the contents from one word or register to another 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 MW07 Original data stored in registers MW07 and MW30 MW28 MW29 MW30 MW31 1 1 0 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 1 1 0 MW07 Data transferred from register MW30 to MW07 MW28 MW29 MW30 MW31 Data transfer concept 1 1 0 0 1 1 1 0 0 1 1 0 1 1 1 0
MOVE (Assign a Value) is activated by the Enable EN Input The value specified at the IN input is copied to the address specified at the OUT output ENO has the same logic state as EN MOVE can copy only BYTE, WORD, or DWORD data objects User-defined data types like arrays or structures have to be copied with the system function "BLKMOVE" (SFC 20)
MOVE (Assign a Value) is activated by the Enable EN Input The value specified at the IN input is copied to the address specified at the OUT output ENO has the same logic state as EN MOVE can copy only BYTE, WORD, or DWORD data objects User-defined data types like arrays or structures have to be copied with the system function "BLKMOVE" (SFC 20)
Memory table MW60 Input Ladder logic program L1 A MOVE A EN ENO MW60 MW10 IN OUT MW10 S7 300 block-formatted move instruction
When moving a value to a data type of a different length, higher-value bytes are truncated as necessary or filled up with zeros
Some types of PLC have move with mask (MVM) instruction Input Ladder logic program L1 MVM A MASKED MOVE Source 1010101010101010 Mask A B3:0 The data being moved must pass through the mask to get to their destination values B3:1 FF0F Destination 1010101011001010 B3:4 Source B3:0 1010 1010 1010 1010 Masking refers to the action of hiding a portion of a binary word before transferring it to the destination address 1111 1111 0000 1111 Mask FF0F Destination B3:4 before instruction went true Destination B3:4 after instruction went true 1100 1100 1100 1100 1010 1010 1100 1010 Unchanged Masked move (MVM) instruction