The core of building a flow meter is to establish a mapping relationship that tells the controller: Is an 8-point input module or a 16 point output module installed on channel 1, rack 1, and slot 4 (for example)? Where should the corresponding memory address (reference number) start?
A typical configuration process is as follows:
Stop controller: Before modifying the flow meter, it is necessary to ensure that the PLC is in stop mode, which is the safety red line.
Enter the I/O configuration interface: Enter the relevant configuration program through the main menu of the programming software.
Locate the target slot: The screen will display a spreadsheet like interface, with rows representing racks and slots and columns representing various parameters.
Input module type: For an empty slot, a placeholder (such as "B8") is usually displayed by default. You need to enter the suffix number of its model code based on the actual installed module (for example, for B805 module, type "05"). A very practical feature is that the controller can communicate with the physical module and read its model. If the model of a module is highlighted on the screen, it means that your software configuration does not match the actual module on the physical slot. This is an extremely important visual warning!
Assign reference number: Assign a starting address to this module. For a 16 point input module, you may type "10001". The system will automatically calculate the end address "10016" for you. For the output module, allocate "00001" and so on. The selection of reference numbers is crucial, ensuring that they do not overlap with the addresses of other modules.
The most powerful diagnostic tools in flow meter configuration are the Health and Mismatch functions.
Health check during operation: Perform health check function while the controller is running. It will query the I/O modules you have configured one by one and report whether they are communicating normally. A healthy system will display 'This channel module is normal' on the screen. If a module is configured incorrectly, physically damaged, or communication interrupted, it will be clearly listed as' unhealthy '.
Stop mismatch check: This function is executed when the controller is stopped. It will compare your software configuration list with the actual scanned physical module list one by one and list all inconsistencies. For example, it will report: 'Slot 104: Software configured as B802 (8-point output), actually detected as B805 (16 point input)'.
These two functions are powerful tools for troubleshooting I/O issues. When you are at a loss when faced with a cabinet of flashing indicator lights, they can instantly focus your attention on the problem point and say goodbye to blind guessing.
The Art of Logic: Ladder Diagram Editing and Efficient Debugging
With the correct hardware configuration, the next task is to write and debug user logic. The classic PLC uses the Ladder Logic programming language, which simulates relay control circuits and is very intuitive for electrical engineers.
The program consists of individual "networks", each of which is equivalent to a "cascade" in a relay circuit diagram.
1. The cornerstone of network programming: elements and editors
A network has a fixed maximum size, such as a width of 11 columns and a height of 7 rows. The rightmost column is dedicated to placing coils. A network can be freely composed of contacts, coils, and various functional blocks such as timers, counters, and mathematical operation blocks.
Programming software usually provides two editing modes, and understanding their differences can greatly improve programming efficiency:
Online editing mode (Element Editor): In this mode, any modifications you make on the programmer (such as adding a contact) will be immediately sent to the PLC and affect the logical execution of the next scanning cycle. This is the ideal mode for fine-tuning and online troubleshooting, as it allows you to observe in real-time the impact of logical changes on physical processes. When the PLC is running, the "power rail" on the screen is highlighted, indicating that the logic is being scanned.
Offline editing mode (Network Editor): This mode is safer, especially when making significant program modifications. You can create or edit the entire network in this mode, but the modifications will not be immediately sent to the PLC. The entire set of modifications will only take effect once you execute the 'Replace Network' or 'Insert Network' command. The most valuable application of this mode is the Exchange Network function: you can read a network from the PLC into the programmer, modify it in offline mode (while the PLC is still running old logic), and then "exchange" the old network in the PLC with the modified network. If there is a problem with the new logic, you can use the "Flip Stack" function to immediately restore the previous version. This provides a secure and fallback experimental environment for testing and validating new programs.