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:
If the signal state of operand TagIn is "1", the instruction sets 10 bits in the area M0.0 to M1.2.
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
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Two AT24C02 read and write examples on the I2C bus
- High power driver amplifier 55453 replacement problem, please recommend
- 【McQueen Trial】Python Programming (3)
- How to sign in on the mobile version?
- [Reprint] Summary of Zynq7010 NAND startup
- Free sharing of LDO and DCDC basic principle explanation video
- No response when controlling GPIO in user mode?
- Logistics POS machine with serial port expansion IC
- EEWORLD University Hall----Live Replay: Infineon system solutions make electric motorcycle design more reliable and efficient!
- EEWORLD University Hall----Live Replay: ADI's smoke detector integrated solution based on ADPD188BI