MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › How do you use the MOVE and conversion instructions in S7-1500 ladder diagram?
HomeModels
Table of contents

On this page

PLC & Programming (100 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

How do you use the MOVE and conversion instructions in S7-1500 ladder diagram?

MOVE moves a source value to a destination, while conversion instructions change how the data is interpreted between types such as integer, floating point and string. If you are not clear on the division of labour and the limits of each, the program will fail on type mismatches or numeric overflow. The sections below explain the usage and the common pitfalls.

1. What MOVE actually does

MOVE copies the data at IN to OUT verbatim, without any type interpretation, as long as the destination is long enough. It is a bit-by-bit transfer: different source and destination types do not raise an error, but the result depends on the lengths and the way each side is interpreted. It moves once per scan, and if the enabling condition stays true the destination is overwritten continuously.

2. The execution condition for MOVE in ladder

In LAD, MOVE is a box whose left-hand EN input is driven by contacts or a coil. In the one scan where the condition is true, a single move takes place. To make the destination track the source continuously, keep EN true; for a one-shot transfer, use a rising edge or pair it with a pulse timer so the move is not repeated within the same scan.

3. Data length and the overrun boundary

The rule for MOVE is that it transfers as long as the destination is long enough: a 2-byte source moved into a 4-byte destination has its upper bits filled according to the instruction's extension rule, while a source longer than the destination is truncated or raises an error. When moving strings and arrays, watch the length field. Moving bytes across word boundaries easily swaps high and low bytes, so handle it explicitly with a conversion or a shift.

4. The conversion instruction family

Conversions fall into three groups: between integer and floating point (such as INT to REAL), between integer widths (INT and DINT), and between encodings (BCD and integer, string and numeric). You must call the matching instruction explicitly; MOVE does not convert for you. A failed conversion, for example one outside the destination range, sets an error bit that the program has to test and handle.

5. Using CONV and implicit conversion

The S7-1500 provides a unified CONV instruction that converts according to a target-type parameter, and IEC arithmetic also performs implicit conversions, for example promoting an INT when it is mixed with a REAL. Implicit conversion is convenient but can hide loss of precision, so good practice is to convert explicitly and bound the values.

6. MOVE and common conversion instructions at a glance

Instruction or caseWhat it doesInput typeOutput type and notes
MOVECopies one value verbatimAny bit stringDestination long enough; no type interpretation
MOVE_BLKCopies an array as a blockArrayElement count and length must match
FILLFills an array with one valueScalarCommon for clearing and initialising
CONVConverts to a target typeAny numericSets an error bit when out of range
INT to DINTWidens the integer16-bit integerSign bit must extend correctly
DINT to REALInteger to floating point32-bit integerLarge values lose precision
REAL to INTFloating point to integer32-bit floatRounds the fraction; out of range errors
BCD to INTEncoding conversionBCD wordInvalid BCD digits set an error
INT to STRINGNumeric to textIntegerMake the destination long enough

7. Notes

MOVE solves "moving", conversion solves "re-interpreting", and neither can replace the other: moving data of one type with MOVE just replicates the bytes, and the result is usually not the number you expect. When writing ladder, work out the data-type chain for each step first, then decide whether that step needs MOVE or a conversion instruction. This avoids most numeric anomalies.

8. References

Instruction semantics and data type definitions follow GB/T 15969.3, Programmable controllers, Part 3: Programming languages (equivalent to IEC 61131-3). The graphical symbols and contact designations of ladder logic follow the GB/T 4728 series, Graphical symbols for electrical diagrams. The exact instruction names and error bits are as stated in the manual of the CPU version in use.

9. Points to watch

⚠️ Three common traps:
1. Moving between integer and floating point with MOVE, assuming it converts, so the value comes out completely wrong;
2. Not testing the range before a conversion, so an over-range analog input overflows while the program keeps computing with the bad value;
3. Ignoring the precision loss of implicit conversion, so a large floating-point value is truncated when converted to integer and the error accumulates over a long cycle.

For analog conversion, check the range before changing the type, and clamp the result so a bad value never reaches the closed loop or the display.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL