Programming instructions
90
Note how all 32-bit commands were prefixed with a D. All floating point
commands are also prefixed with a D since they operate on 32-bit numbers, and
the commands all begin with an E to indicate floating point format.
Integer square root requires a little more explanation. The square root calculated
will be a rounded number, unless floating point math is being done. If a rounded
answer is produced, special relay M8021 is turned on.
13.10 EXERCISE
Binary Math
Please find Project #4 in the appendix. This project is intended to give the
student practice in using the arithmetic instructions.
13.11 EXERCISE Parking Lot Part 2
This is a modification of the parking lot program from earlier. Add logic to count
the total number of cars today, and store that number in D10. Add logic to count
how much money should be in the cash drawer at the end of the day, assuming
each car pays $5.00 to park, and store that total in D12. There will also be a
reset button for the manager to reset the car count and cash total at the end of
the day. The reset button is addressed M10.
13.12 EXERCISE
Conveyor Control Part 3
Take the Conveyor Control program and modify it to: Use the HMI to set the
number of times the program cycles. The number must be a value between 5
and 15. If the number is not a value between 5 and 15, the program will not start.
Display the number of cycles elapsed on the HMI display.
13.13 High Speed Processing
The FX3U has built-in high-speed counters. These counters are either hardware
counters that execute independent of the PLC scan, or software counters that
execute as interrupts when they count. Thus they function independent of the
program scan. This allows the high-speed counters to count at speeds of up to
60 kHz.
While the use of high-speed counters is somewhat beyond the scope of this
class, all the important information on their use is in section 4.7.1 of the FX3U
Programming Manual.
The counter number used varies based on the type of input and the physical
inputs used to connect it. The chart in Section 4.7.1 of the FX3U Programming
Manual shows the various high speed counters as well as their associated
formats and inputs.
High speed counters are 32 bit counters, thus 32 bit āDā type instructions are
required when using them.