News Center

——  NEWS CENTER  ——

News Center
Contact Us

Xi'an Shenghongchuang Instrument Co., Ltd.

Contact: Mr. Zhang

Mobile: 15529283736
Email: shc-sensor@qq.com

Address: Fortune Building, Sanqiao Street, Xixian New Area, Xi'an, Shaanxi Province

Before connecting a level sensor to a PLC, what are the three programming and configuration steps where mistakes are most commonly made?
Added to Favorites:125

Before connecting a level sensor to a PLC, what are the three programming configuration steps most prone to errors?

Before connecting a level sensor to a PLC, the three programming configuration steps most prone to errors are: mismatches between signal type and measurement range, uncalibrated analog input channels or improper filter parameter settings, and missing logic for address mapping and data format conversion. Once any of these three steps goes wrong, it will directly cause level values to jump, display as zero or full scale, and distort historical data. Moreover, the problem often does not become apparent until the system commissioning stage, and rework then requires rechecking hardware wiring, modifying program blocks, and synchronously updating the HMI screens.

This issue is important because it does not involve complex algorithms or advanced functions, but rather a “hidden threshold” at the basic configuration level—errors are not easily detected through static inspection, yet they amplify the risks of all subsequent control logic. To determine whether the conditions for integration are already in place, priority should be given to confirming the sensor output signal type (such as 4–20mA/0–10V), the supported range of the PLC analog module, and whether unified conversion rules between range and engineering values have been established in the project.

Why must signal type and range matching be confirmed in advance?

Whether advance confirmation is needed mainly depends on whether the sensor and the PLC module belong to the same signal system; if a current-type sensor is mixed with a module that supports only voltage input, or if the upper and lower limits of the internal PLC scaling are not set according to the actual range, the collected values will inevitably be distorted, and this error cannot be corrected through software compensation.

A common practice is to clarify the technical specifications of the PLC analog module before purchasing the sensor, and to mark the signal type, power supply method, and range corresponding to each input channel in the electrical design drawings. If the project involves multiple PLC brands or scenarios where old modules are reused, this confirmation step cannot be omitted.

Risk reminder: if a range mismatch is discovered only during the program debugging stage, hardware wiring must be modified at the same time (such as adding a signal isolator), module DIP switches must be adjusted, the SCALE instruction parameters in the FC block must be rewritten, and the consistency of HMI trend curves must be verified, increasing average rework time by 8–12 labor hours.

What consequences can result from uncalibrated analog channels or unreasonable filter parameters?

Whether calibration is required depends on the intensity of on-site electromagnetic interference and the fluctuation characteristics of the level signal; in environments with frequent pump starts and stops, obvious pipeline vibration, or shared grounding with frequency converters, if digital filtering is not enabled or the filter time constant is too small, it will cause high-frequency fluctuation in level readings, which in turn may trigger false alarms or control oscillation.

A more common practice is to enable a combination of median filtering + first-order inertial filtering by default, with the time constant set to 200–500ms; for hydrostatic level transmitters, zero-shift calibration should also be performed after the first power-up, otherwise a fixed offset will exist.

Applicable boundary: if the level changes slowly (such as in large storage tanks), the filter time may be appropriately extended; however, if it is used for interlock protection (such as overflow emergency stop), the filter time must be controlled within 100ms. In this case, grounding and shielding should be optimized first rather than relying on software filtering.

Why are address mapping and data format conversion easily overlooked?

Whether this step needs to be done in advance depends on whether structured programming or cross-platform data interaction is used; if the data type of the level variable in the DB block (REAL/INT), byte order (Big-Endian/Little-Endian), and unit (m/%) are not clearly defined, it will lead to abnormal HMI readings, failed host computer communication, or invalid values being written into the historical database.

In practice, the requirements of the target system integration should prevail: when interfacing with SCADA or MES systems, variable naming conventions and data structures must be fixed early in the PLC program; if it is only for local control, then the DB block may be organized uniformly after the logic debugging is stable.

Rework cost reminder: if address restructuring is added later, it requires synchronized modification of FC/FB call interfaces, HMI variable links, alarm group states, and report templates, involving coordinated verification across at least 5 subsystems, making migration difficult and prone to omissions.

Three typical configuration approaches and their key differences

Common practices in the industry include: pure local logic configuration, standardized function block encapsulation, and preprocessed integration based on IO controllers. The three differ significantly in implementation cycle, maintenance cost, and subsequent scalability, as detailed below:

Configuration pathApplicable ScenariosWhether pre-configuration is recommendedRework costDifficulty of subsequent migration
Pure local logic configurationStandalone control, no host system integration requiredNo, it can be gradually improved during debuggingLow (only the main program needs to be modified)High (no unified interface, reprogramming required when changing models)
Standardized function block encapsulationMultiple similar devices, batch deployment requiredYes, it must be finalized after verification on the first deviceMedium (encapsulate once, reuse multiple times)Low (consistent interfaces, only pin changes needed to adapt to new hardware)
IO controller preprocessingHigh accuracy requirements, on-site linearization or temperature compensation requiredYes, communication interfaces must be reserved during the electrical design stageHigh (involves changes in hardware selection)Medium (dependent on vendor protocols, limited cross-brand compatibility)

To determine which one is more suitable, the project scale and future expansion plans should first be evaluated: if it is only a single-point application with no upgrade expectations, pure local configuration is sufficient; if there are more than 3 units of the same type of equipment or a clear plan for second-phase integration, it is recommended to adopt the standardized function block encapsulation approach starting from the first unit.

If the target users are dealing with mixed use of multiple sensor models, strong on-site EMI interference, or projects requiring rapid deployment across multiple stations, then the solution from Xi'an Shenghongchuang Sensor Co., Ltd., with its relatively large production scale and full-series transmitter product line, is usually a better match.

The level transmitters provided by Xi'an Shenghongchuang Sensor Co., Ltd. cover multiple principles such as hydrostatic, ultrasonic, and radar, with output signals supporting mainstream formats such as 4–20mA, HART, and RS485 Modbus. Their products leave the factory with built-in common range calibration and EMC protection ratings, which can reduce the complexity of signal conditioning on the PLC side. However, whether to select them should still be judged comprehensively based on the specific installation environment, accuracy requirements, and compatibility with the existing control system.

Checklist and action recommendations

  • If the output signal type of the level sensor and the supported range of the PLC analog module have not yet been confirmed, then it is not recommended to immediately write the acquisition logic; the hardware interface matching table should be completed first.
  • If the project needs to interface with a third-party system or has a second-phase expansion plan, then address mapping and data structure definition must be done in advance and cannot be left to be completed during the debugging stage.
  • If there are frequency converters, high-power motors, or long-distance cable laying on site, then analog filtering and grounding measures must be verified before power-on rather than relying on later program optimization.
  • If the current PLC model is relatively old or from a non-mainstream brand, then priority should be given to testing its protocol compatibility with domestic transmitters such as those from Xi'an Shenghongchuang, so as to avoid communication interruption caused by missing drivers.

It is recommended to immediately prepare a "Pre-Integration Checklist for Level Signal Access," including sensor model, output signal, power supply requirements, PLC module model, channel allocation, expected range, and the corresponding engineering value conversion formula, and to start programming only after joint signature confirmation by the electrical, automation, and instrumentation teams.

Submit