Home / Kiến thức / Tổng hợp danh sách tập lệnh lập trình plc siemens s7-1200

Tổng hợp danh sách tập lệnh lập trình plc siemens s7-1200

Bài viết này thuộc khóa học lập trình plc Siemens online miễn phí của abientan, mời các bạn tham khảo chi tiết tại:

khóa học lập trình plc siemens s7-1200 online miễn phí

Trong bài viết này mình sẽ giới thiệu cho các bạn tập lệnh lập trình plc tổng hợp bao gồm tất cả các lệnh được hỗ trợ trên plc siemens s7-1200 kèm mô tả ngắn gọn. Đối với một số lệnh phức tạp các bạn vui lòng tham khảo thêm trong manual của nhà sản xuất.

Tham khảo sản phẩm: Plc cũ giá rẻ

Bit logic operations

• —| |—: Normally open contact (S7-1200, S7-1500)

• —| / |—: Normally closed contact (S7-1200, S7-1500)

• –|NOT|–: Invert RLO (S7-1200, S7-1500)

• —( )—: Assignment (S7-1200, S7-1500)

• –( / )–: Negate assignment (S7-1200, S7-1500)

• —( R )—: Reset output (S7-1200, S7-1500)

• —( S )—: Set output (S7-1200, S7-1500)

• SET_BF: Set bit field (S7-1200, S7-1500)

• RESET_BF: Reset bit field (S7-1200, S7-1500)

• SR: Set/reset flip-flop (S7-1200, S7-1500)

• RS: Reset/set flip-flop (S7-1200, S7-1500)

• –|P|–: Scan operand for positive signal edge (S7-1200, S7-1500)

• –|N|–: Scan operand for negative signal edge (S7-1200, S7-1500)

• –(P)–: Set operand on positive signal edge (S7-1200, S7-1500)

• –(N)–: Set operand on negative signal edge (S7-1200, S7-1500)

• P_TRIG: Scan RLO for positive signal edge (S7-1200, S7-1500)

• N_TRIG: Scan RLO for negative signal edge (S7-1200, S7-1500)

• R_TRIG: Detect positive signal edge (S7-1200, S7-1500)

• F_TRIG: Detect negative signal edge (S7-1200, S7-1500)

Timer operations

• TP: Generate pulse (S7-1200, S7-1500)

• TON: Generate on-delay (S7-1200, S7-1500)

• TOF: Generate off-delay (S7-1200, S7-1500)

• TONR: Time accumulator (S7-1200, S7-1500)

• —( TP )—: Start pulse timer (S7-1200, S7-1500)

• —( TON )—: Start on-delay timer (S7-1200, S7-1500)

• —( TOF )—: Start off-delay timer (S7-1200, S7-1500)

• —( TONR )—: Time accumulator (S7-1200, S7-1500)

• —( RT )—: Reset timer (S7-1200, S7-1500)

• —( PT )—: Load time duration (S7-1200, S7-1500)

Counter operations

• CTU: Count up (S7-1200, S7-1500)

• CTD: Count down (S7-1200, S7-1500)

• CTUD: Count up and down (S7-1200, S7-1500)

Comparator operations

• CMP ==: Equal (S7-1200, S7-1500)

• CMP <>: Not equal (S7-1200, S7-1500)

• CMP >=: Greater or equal (S7-1200, S7-1500)

• CMP <=: Less or equal (S7-1200, S7-1500)

• CMP >: Greater than (S7-1200, S7-1500)

• CMP <: Less than (S7-1200, S7-1500)

• IN_RANGE: Value within range (S7-1200, S7-1500)

• OUT_RANGE: Value outside range (S7-1200, S7-1500)

• —-I OK I—-: Check validity (S7-1200, S7-1500)

• —-I NOT_OK I—-: Check invalidity (S7-1200, S7-1500)

• VARIANT (S7-1200, S7-1500)

Math functions

• CALCULATE: Calculate (S7-1200, S7-1500)

• ADD: Add (S7-1200, S7-1500)

• SUB: Subtract (S7-1200, S7-1500)

• MUL: Multiply (S7-1200, S7-1500)

• DIV: Divide (S7-1200, S7-1500)

• MOD: Return remainder of division (S7-1200, S7-1500)

• NEG: Create twos complement (S7-1200, S7-1500)

• INC: Increment (S7-1200, S7-1500)

• DEC: Decrement (S7-1200, S7-1500)

• ABS: Form absolute value (S7-1200, S7-1500)

• MIN: Get minimum (S7-1200, S7-1500)

• MAX: Get maximum (S7-1200, S7-1500)

• LIMIT: Set limit value (S7-1200, S7-1500)

• SQR: Form square (S7-1200, S7-1500)

• SQRT: Form square root (S7-1200, S7-1500)

• LN: Form natural logarithm (S7-1200, S7-1500)

• EXP: Form exponential value (S7-1200, S7-1500)

• SIN: Form sine value (S7-1200, S7-1500)

• COS: Form cosine value (S7-1200, S7-1500)

• TAN: Form tangent value (S7-1200, S7-1500)

• ASIN: Form arcsine value (S7-1200, S7-1500)

• ACOS: Form arccosine value (S7-1200, S7-1500)

• ATAN: Form arctangent value (S7-1200, S7-1500)

• FRAC: Return fraction (S7-1200, S7-1500)

• EXPT: Exponentiate (S7-1200, S7-1500)

Move operations

• MOVE: Move value (S7-1200, S7-1500)

• Deserialize: Deserialize (S7-1200, S7-1500)

• Serialize: Serialize (S7-1200, S7-1500)

• MOVE_BLK: Move block (S7-1200, S7-1500)

• MOVE_BLK_VARIANT: Move block (S7-1200, S7-1500)

• UMOVE_BLK: Move block uninterruptible (S7-1200, S7-1500)

• FILL_BLK: Fill block (S7-1200, S7-1500)

• UFILL_BLK: Fill block uninterruptible (S7-1200, S7-1500)

• SCATTER: Parse the bit sequence into individual bits (S7-1200, S7-1500)

• SCATTER_BLK: Parse elements of an ARRAY of bit sequence into individual bits (S7-1200, S7-1500)

• GATHER: Merge individual bits into a bit sequence (S7-1200, S7-1500)

• GATHER_BLK: Merge individual bits into multiple elements of an ARRAY of bit sequence (S7-1200, S7-1500)

• AssignmentAttempt: Attempt assignment of a VARIANT to a reference (S7-1500)

• SWAP: Swap (S7-1200, S7-1500)

• ARRAY DB (S7-1500)

• VARIANT (S7-1200, S7-1500)

• ARRAY[*] (S7-1200, S7-1500)

Conversion operations

• CONVERT: Convert value (S7-1200, S7-1500)

• ROUND: Round numerical value (S7-1200, S7-1500)

• CEIL: Generate next higher integer from floating-point number (S7-1200, S7-1500)

• FLOOR: Generate next lower integer from floating-point number (S7-1200, S7-1500)

• TRUNC: Truncate numerical value (S7-1200, S7-1500)

• SCALE_X: Scale (S7-1200, S7-1500)

• NORM_X: Normalize (S7-1200, S7-1500)

Program control operations

• —( JMP ): Jump if RLO = 1 (S7-1200, S7-1500)

• —( JMPN ): Jump if RLO = 0 (S7-1200, S7-1500)

• LABEL: Jump label (S7-1200, S7-1500)

• JMP_LIST: Define jump list (S7-1200, S7-1500)

• SWITCH: Jump distributor (S7-1200, S7-1500)

• –(RET): Return (S7-1200, S7-1500)

• Runtime control (S7-1200, S7-1500)

Word logic operations

• AND: AND logic operation (S7-1200, S7-1500)

• OR: OR logic operation (S7-1200, S7-1500)

• XOR: EXCLUSIVE OR logic operation (S7-1200, S7-1500)

• INVERT: Create ones complement (S7-1200, S7-1500)

• DECO: Decode (S7-1200, S7-1500)

• ENCO: Encode (S7-1200, S7-1500)

• SEL: Select (S7-1200, S7-1500)

• MUX: Multiplex (S7-1200, S7-1500)

• DEMUX: Demultiplex (S7-1200, S7-1500)

Shift and rotate

• SHR: Shift right (S7-1200, S7-1500)

• SHL: Shift left (S7-1200, S7-1500)

• ROR: Rotate right (S7-1200, S7-1500)

• ROL: Rotate left (S7-1200, S7-1500)

Date and time-of-day

• T_COMP: Compare time tags (S7-1500)

• T_CONV: Convert times and extract (S7-1200, S7-1500)

• T_ADD: Add times (S7-1200, S7-1500)

• T_SUB: Subtract times (S7-1200, S7-1500)

• T_DIFF: Time difference (S7-1200, S7-1500)

• T_COMBINE: Combine times (S7-1200, S7-1500)

• Time-of-day functions (S7-1200, S7-1500)

String + Char

• S_MOVE: Move character string (S7-1200, S7-1500)

• S_COMP: Compare character strings (S7-1500)

• S_CONV: Convert character string (S7-1200, S7-1500)

• STRG_VAL: Convert character string to numerical value (S7-1200, S7-1500)

• VAL_STRG: Convert numerical value to character string (S7-1200, S7-1500)

• Strg_TO_Chars: Convert character string to Array of CHAR (S7-1200, S7-1500)

• Chars_TO_Strg: Convert Array of CHAR to character string (S7-1200, S7-1500)

• MAX_LEN: Determine the length of a character string (S7-1200, S7-1500)

• JOIN: Join multiple strings (S7-1500)

• SPLIT: Splitting an array of characters into multiple strings (S7-1500)

• ATH: Convert ASCII string to hexadecimal number (S7-1200, S7-1500)

• HTA: Convert hexadecimal number to ASCII string (S7-1200, S7-1500)

• LEN: Determine the length of a character string (S7-1200, S7-1500)

• CONCAT: Combine character strings (S7-1200, S7-1500)

• LEFT: Read the left character of a character string (S7-1200, S7-1500)

• RIGHT: Read the right characters of a character string (S7-1200, S7-1500)

• MID: Read middle characters of a character string (S7-1200, S7-1500)

• DELETE: Delete characters in a character string (S7-1200, S7-1500)

• INSERT: Insert characters in a character string (S7-1200, S7-1500)

• REPLACE: Replace characters in a character string (S7-1200, S7-1500)

• FIND: Find characters in a character string (S7-1200, S7-1500)

• Runtime information (S7-1200, S7-1500)

Distributed I/O

• Overview of the types of data records (S7-1200, S7-1500)

• RDREC: Read data record (S7-1200, S7-1500)

• WRREC: Write data record (S7-1200, S7-1500)

• GETIO: Read process image (S7-1200, S7-1500)

• SETIO: Transfer process image (S7-1200, S7-1500)

• Program example for GETIO & SETIO (S7-1200, S7-1500)

• GETIO_PART: Read process image area (S7-1200, S7-1500)

• SETIO_PART: Transfer process image area (S7-1200, S7-1500)

• Program example for GETIO_PART & SETIO_PART (S7-1200, S7-1500)

• RALRM: Receive interrupt (S7-1200, S7-1500)

• D_ACT_DP: Enable/disable DP slaves (S7-1200, S7-1500)

• ReconfigIOSystem: Reconfigure IO system (S7-1200, S7-1500)

• Others (S7-1200, S7-1500)


• Description of PROFIenergy (S7-1200, S7-1500)

• IO controller (S7-1200, S7-1500)

• iDevice / iSlave (S7-1200, S7-1500)


• ATTACH: Attach an OB to an interrupt event (S7-1200, S7-1500)

• DETACH: Detach an OB from an interrupt event (S7-1200, S7-1500)

• Cyclic interrupt (S7-1200, S7-1500)

• Time-of-day interrupt (S7-1200, S7-1500)

• Time-delay interrupt (S7-1200, S7-1500)

• Asynchronous error event (S7-1200, S7-1500)


• Gen_UsrMsg: Generate user diagnostic alarms (S7-1200, S7-1500)

• Program example for Get_Alarm & Ack_Alarms (S7-1200, S7-1500)


• RD_SINFO: Read current OB start information (S7-1200, S7-1500)

• RT_INFO: Read out runtime statistics (S7-1500)

• LED: Read LED status (S7-1200, S7-1500)

• Get_IM_Data: Reading identification and maintenance data (S7-1200, S7-1500)

• GET_NAME: Read out name of an IO device or a DP slave (S7-1200, S7-1500)

• GetStationInfo: Read information of an IO device (S7-1200, S7-1500)

• GetChecksum: Read out checksum (S7-1200, S7-1500)

• GetSMCinfo: Reading out information about the SIMATIC memory card (S7-1500)

• GetClockStatus: Read out status of the CPU clock (S7-1500)

• DeviceStates: Read module status information in an IO system (S7-1200, S7-1500)

• ModuleStates: Read module status information of a module (S7-1200, S7-1500)

• GEN_DIAG: Generate diagnostics information (S7-1500)

• GET_DIAG: Read diagnostic information (S7-1200, S7-1500)


• CTRL_PWM: Pulse-width modulation (S7-1200)

• CTRL_PTO: Output a pulse sequence with a preset frequency (S7-1200)

Recipes and data logging

• Recipe functions (S7-1200, S7-1500)

• Data logging (S7-1200, S7-1500)

Data block functions

• CREATE_DB: Create data block (S7-1200, S7-1500)

• READ_DBL: Read from data block in the load memory (S7-1200, S7-1500)

• WRIT_DBL: Write to data block in the load memory (S7-1200, S7-1500)

• ATTR_DB: Read data block attribute (S7-1200, S7-1500)

• DELETE_DB: Delete data block (S7-1200, S7-1500)

• Program example for CREATE functions (S7-1200, S7-1500)


• Instructions for address conversion (S7-1200, S7-1500)

• GEO2LOG: Determine hardware identifier from slot (S7-1200, S7-1500)

• LOG2GEO: Determine slot from hardware identifier (S7-1200, S7-1500)

• LOG2MOD: Determine the hardware identifier from addressing of STEP 7 V5.5 SPx (S7-1500)

• IO2MOD: Determine hardware identifier from an IO address (S7-1200, S7-1500)

• RD_ADDR: Determine IO addresses from the hardware identifier (S7-1200, S7-1500)

• System data type GEOADDR (S7-1200, S7-1500)

• Legacy (S7-1200, S7-1500)

Motion Control

S7-1200 Motion Control (S7-1200)

High-speed counters

CTRL_HSC: Control high-speed counters (S7-1200)

PID Control

• PID_Compact (S7-1200, S7-1500)

• PID_3Step (S7-1200, S7-1500)

• PID_Temp (S7-1200, S7-1500)

• PID basic functions (S7-1500)

• Polyline (S7-1200, S7-1500)

• SplitRange (S7-1200, S7-1500)

• RampFunction (S7-1200, S7-1500)


• S7 communication (S7-1200, S7-1500)

• Open User Communication (S7-1200, S7-1500)

• OPC UA (S7-1500)

• Web server (S7-1200, S7-1500)

• Communications processor (S7-1200, S7-1500)

• TeleService (S7-1200)

4.8/5 - (6 đánh giá)
Theo dõi
Thông báo của
0 Bình luận
Phản hồi nội tuyến
Xem tất cả bình luận
Nếu có thắc mắc hoặc đóng góp vui lòng gửi bình luận.x