Siemens TIA Portal: SET: Set byte array instruction parameters and working principle

Publisher:iota19Latest update time:2024-08-06 Source: elecfansKeywords:Siemens Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

illustrate

You can use the "Set bit array" instruction to set the signal state of bits in a specified area to "1". Use a pointer in the S_BIT parameter to define the start of the range. If the pointer points to a memory area for external I/O, the instruction is not executed. In the N parameter, specify the number of bits to be set in the specified area. If the N parameter has the value "0", calling the instruction has no effect.


The instruction is only executed if the MCR bit is "1". If the signal state of the MCR bit is "0", the bits in the specified area remain unchanged.

Note
Parameter N
In the TIA Portal, you can also interconnect the elements of the data blocks in parameter N.

parameter

The following table lists the parameters for the "Set Bit Array" instruction:

parameter statement Data Types Storage Area illustrate
S_BIT Input POINTER I, Q, M, D Pointer to the first bit in the region where the bits are to be set.
For cross-region indirect register addressing, this pointer must be specified in double-word format.
N Input INT I, Q, M, D, L, P or constant Number of bits to set

Example

The following example illustrates how this directive works:

STL illustrate
CALL SET // Call the "set bit array" instruction
S_BIT := P#M0.0 // Pointer to the first bit to be set (M0.0)
N := 10 //Number of bits to set

In this example, this instruction will set 10 bits in the range from M0.0 to M1.2.

illustrate

Use the "Set Byte Array" instruction to set the signal state of a bit in a specified byte area to "1". Define the start of the array in the S_BYTE parameter. Define the size of the array by specifying the number of bits to be set in the N parameter of the instruction.

Note
The value of parameter N must be an integer multiple of 8 (for example, 8, 16, 24, etc.).

The pointer specified in the S_BYTE parameter must refer to the external I/O memory area (P). Since the "P" memory area is accessed as bytes, words or double words, the pointer in the S_BYTE parameter must point to an operand that corresponds to the byte limit, that is, the pointer bit number must be "0".

Description
The signal state of the corresponding bit in the process image output (Q) is reset to "0".

Calling the Set Byte Array instruction will have no effect if any of the following conditions exist:

The pointer in the S_BYTE parameter does not refer to an external I/O memory area (P).

The operand referenced by the pointer in parameter S_BYTE is not a whole byte.

The value of parameter N is not an integer multiple of 8.

The signal state of the MCR bit is "0".

parameter

The following table lists the parameters of the "Set Byte Array" instruction:

parameter statement Data Types Storage Area illustrate
S_BYTE Input POINTER P or constant Pointer to the first byte of the array whose bits are to be set
For cross-region indirect register addressing, this pointer must be specified in double-word format.
N Input INT I, Q, M, D, L, P or constant The size of the array to be set
Specify the array in multiples of 8 (e.g., 8, 16, 24, etc.).

Example

The following example illustrates how this directive works:

STL illustrate
CALL SETI // Call instruction.
S_BYTE := P#2.0 // Pointer to the first byte of the range (P2.0)
N := 16 //Number of bits to set

In the example, this instruction sets 2 bytes (16 bits) ranging from P2.0 to P3.7 (I/O output).

SET: Set a bit array

Description You can use the "Set bit array" instruction to set the signal state of bits in a specified range to "1". Use a pointer in the S_BIT parameter to define the start of the range. If the pointer points to a memory area for external I/O, the instruction is not executed. In the N parameter, specify the number of bits to be set in the specified area. If the N parameter has the value "0", calling the instruction has no effect.

Note Parameter N In the TIA Portal, you can also interconnect elements of a data block at parameter N.

parameter

The following table lists the parameters of this command:

parameter statement Data Types Storage Area illustrate
S_BIT Input POINTER I, Q, M, D Pointer to the first bit in the region where the bits are to be set.
For cross-region indirect register addressing, this pointer must be specified in double-word format.
N Input INT I, Q, M, D, L, P or constant Number of bits to set

Example

The following example illustrates how this directive works:

SCL
SET(S_BIT := P#M0.0,
N := 10);

In this example, this instruction sets 10 bits in the range M0.0 to M1.1.

SET: Set a bit array

illustrate

The "Set bit array" instruction sets the signal state of the bits in the specified area to "1". In the parameter S_BIT, you define the start of the range with a pointer. If the pointer points to a memory area of ​​an external I/O, the instruction is not executed. In the parameter N, you specify the number of bits to be set in the specified area. If the value of parameter N is "0", calling the instruction has no effect.

The instruction is only executed if the MCR bit is "1". If the signal state of the MCR bit is "0", the bits in the specified area remain unchanged.

Note
Parameter N
At parameter N, you can also interconnect elements of a data block.

parameter

The following table lists the parameters for the "Set Bit Array" instruction:

parameter statement Data Types Storage Area illustrate
EN Input BOOL I, Q, M, D, L Enable input
ENO Output BOOL I, Q, M, D, L Enable output
S_BIT Input POINTER I, Q, M, D Pointer to the first bit in the region where the bits are to be set.
For cross-region indirect register addressing, this pointer must be specified in double-word format.
N Input INT I, Q, M, D, L, P or constant Number of bits to set

Example

The following example illustrates how this directive works:

33f19422-1ec5-11ee-962d-dac502259ad0.png

If the signal state of operand TagIn is "1", the instruction sets 10 bits in the area M0.0 to M1.2.


Keywords:Siemens Reference address:Siemens TIA Portal: SET: Set byte array instruction parameters and working principle

Previous article:SIMATIC S7-1500 Timer and Counter Example Application
Next article:What is the difference between a servo drive and a motion controller?

Recommended ReadingLatest update time:2024-11-16 10:34

After two years of preparation, Siemens Intelligent Creation grandly opened in Chengdu Innovation Center
Siemens and the Chengdu Municipal Government jointly announced that after nearly two years of construction, the Siemens Intelligent Creation Chengdu Innovation Center was officially opened.   Tony Hemmelgarn, President and CEO of Siemens Digital Industries Software, Robert Jones, Executive Vice President of Global Sal
[Embedded]
After two years of preparation, Siemens Intelligent Creation grandly opened in Chengdu Innovation Center
Siemens acquires ZONA Technology to help achieve climate-neutral flight goals
As the goal of achieving climate-neutral flight gradually becomes a global consensus and supersonic flight regains market attention, the optimization of aerodynamic and structural design is becoming increasingly important when innovating aircraft configurations. In response to this demand, Siemens Digital Industrial S
[Industrial Control]
Siemens acquires ZONA Technology to help achieve climate-neutral flight goals
Siemens PLC Programming Skills Sharing
1. Unified program structure OB1: main program; OB100: Initialization program (no need to call the main program); OB35: 100ms (modifiable) interrupt (no need to call the main program), can call the PID module; OB80, OB82, OB85, OB86, OB87, OB121, OB122: fault diagnosis module (no need to call the
[Embedded]
What is the difference between the source type and the sink type of Siemens PLC modules?
Q: When using Siemens modules, I often encounter two types of modules: active and leakage. Also, what are the differences between the relay type modules? Answer: 1. Source type (source), the current flows out from the terminal, with the output characteristics of a PNP transistor; sink type (sink), the cur
[Embedded]
Summary of Common Programming Instructions for Siemens S7-200 SMART PLC
01 1. Timer 1. The S7-200 SMART CPU provides three timers: on-delay timer (TON), hold-on delay timer (TONR), and off-delay timer (TOF). 2. Timer number and resolution 3. Timer example analysis ① Turn on the delay timer TON ②Retention type on-delay timer TONR
[Embedded]
Summary of Common Programming Instructions for Siemens S7-200 SMART PLC
How to write Siemens PLC program in a standardized way
1. Unified program structure OB1: Main program; OB100: Initialization program (no need to call the main program); OB35: 100ms (modifiable) interrupt (no need to call the main program), can call the PID module; OB80, OB82, OB85, OB86, OB87, OB121, OB122: Fault diagnosis module (no need to call the main program,
[Embedded]
Deca, ASE and Siemens team up to launch adaptive pattern design suite
Deca, a leading pure-play process technology provider for advanced semiconductor packaging, announces the launch of its new APDK™ (Adaptive Patterning® Design Kit) solution, a result of a collaboration between Deca, Advanced Semiconductor Engineering Ltd. (ASE) and Siemens Digital Industries Software.   Deca works clo
[Semiconductor design/manufacturing]
Deca, ASE and Siemens team up to launch adaptive pattern design suite
Detailed explanation of Siemens PLC basic instruction knowledge!
1. Contact and coil instructions Programming principles of PLC ladder diagram language 1. The ladder diagram consists of multiple rungs. Each coil can constitute a rung. Each rung has multiple branches, and each rung represents a logic equation. 2. The relays, contacts and coils in the ladder diagra
[Embedded]
Detailed explanation of Siemens PLC basic instruction knowledge!
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号