8 Arithmetical Macros

 

Numerical data imply the ability to do arithmetical operations, and almost all PLCs provide some arithmetical operations, such as add, subtract, multiply, and divide. Arithmetical functions will retrieve one or more values, perform an operation, and store the result in memory. As an example, Figure 8.1 shows an ADD function that will retrieve and add two values from sources labeled source A and source B and will store the result in destination C. The list of arithmetical functions (macros) described for the PIC16F648A-based PLC is as follows The increment and decrement functions are unary, so there is only one source

  1. ADD (source value 1, source value 2, destination): Add two source values and put the result in the ...

Get Building a Programmable Logic Controller with a PIC16F648A Microcontroller now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.