How to understand the LDN instruction operand in PLC after being reversed and loaded into the stack

Updated on technology 2024-04-19
18 answers
  1. Anonymous users2024-02-08

    1. Standard contacts LD, A, O, LDN, AN, ON, LD, take instructions. Represents a normally open contact instruction connected to the input bus, that is, the start of the normally open contact logic operation. ldn, take the negative instruction.

    Indicates a normally closed contact instruction connected to the input bus, that is, the start of the normally closed contact logic operation. a, with instructions. For series connection of a single normally open contact.

    an, with non-directives. For the series connection of a single normally closed contact. o, or directives.

    For parallel connection of a single normally open contact. on, or non-directive. For parallel connection of a single normally closed contact.

    Second, positive and negative hopping changes ED, EUED, after detecting a positive jump (from off to on), let the energy flow connect to a scanning cycle. EU, after a negative hop (from ON to OFF) is detected, let the energy stream turn on for a scan cycle. 3. Output==, when the output instruction is executed, the specified parameter bit in the image register is turned on.

    Fourth, set and reset commands s, rs, when executing the set (set 1) command, n points starting from the address parameter specified by bit or out are set. r, when the reset (set 0) command is executed, the n points starting from the address parameter specified by bit or out are reset. The number of points set and reset can be from 1 to 255, and when the reset command is used, if the bit or out specifies t or c, then the timer or counter is reset and the current value is reset to zero.

    5. The nopnop instruction does not affect the execution of the program, and the execution number n(1-255) Please refer to the library for details? from=search

  2. Anonymous users2024-02-07

    The output of the start-stop circuit is taken from the normally closed point of the output, that is, the LDN is reversed and loaded into the stack.

  3. Anonymous users2024-02-06

    i: Digital Input (DI) Q: Digital Output (DO) AI: Analog Input AQ: Analog Output.

    v: variable store, which can access v-zone data by bit, byte, word, or double word m: bit store, which can access m-zone data t: by bit, byte, word, or double word

    Timer memory area, used for time accumulation, resolution is divided into three types: 1ms, 10ms, and 100ms C: Counter memory area, which is used to accumulate the number of times the pulse level of its input terminal is from low to high. The CPU provides three types of counters:

    One is usually open (ld, a, o) and the contact is closed (open) only when the bit is equal to 1. When the bit is equal to 0, it is usually closed (ldn, an, on) and the contact is closed (open). can increase counting; One can only be subtracted; The other can be both increased and subtracted.

  4. Anonymous users2024-02-05

    A stack is a data structure that executes a last-in, first-out algorithm.

    Imagine a bamboo tube with a small diameter, open at one end and closed at the other. There are several numbered balls, and the diameter of the balls is slightly smaller than that of the bamboo tube. Now put the different numbered balls into the bamboo tube, and you can find a pattern:

    The ball that is put in first can only be taken out later, and conversely, the ball that is put in later can be taken out first. So "first-in, last-out" is the characteristic of this structure.

    A stack is one such data structure. It creates a storage area in memory into which data is stored sequentially (i.e., "pushed") one by one. There is an address pointer that always points to the data unit where the last data pressed into the stack is located, and the register that holds this address pointer is called a stack indicator.

    The unit that starts to put the data into it is called the "bottom of the stack". The data is stored one by one, a process called "stacking". In the process of stacking, each time data is pressed into the stack, it is placed in the next cell connected to the previous unit, and the address in the stack indicator is automatically added by 1.

    When reading this data, the data is read by the address in the stack indicator, which automatically subtracts 1 from the number of addresses in the stack indicator. This process is called "pop-up pop". In this way, the principle of last-in-first-out is realized.

  5. Anonymous users2024-02-04

    Because the parallel circuit blocks that are composed of and before instruction R,1 are used, and the beginning of each circuit block is to be commanded with LD or LDN depending on whether it is a normally open or normally closed contact; The ald command is used to connect the phase of the series circuit block, and here it is used to combine the circuit block composed of the circuit with the circuit block in front of it (here there is only one contact to operate with it.

  6. Anonymous users2024-02-03

    This is a rule not to drill the horns, people's grammar is like that, just remember it.

  7. Anonymous users2024-02-02

    These are basic instructions, which don't seem to make much sense, or you can understand that there are several switches connected to the Reagan wire of the same potential! After all, it's the instructions behind the switches that are what you really need to learn.

  8. Anonymous users2024-02-01

    Landlord, that's how I understand it.

    In the process of computing the CPU in the PLC, it enters the stack only when it needs to be put into the stack.

    For example: 1. You don't need to go into the stack.

    ld x0and x1

    out y0.

    This does not need to be put into the stack, because the result of each operation is stored in CPU accumulator A. (The book says).

    2. If it needs to be entered into the stack, there will be data into the stack during the execution of this instruction. (semicolon followed by comment).

    ld x0 ;Take the state of x0 and put it into the accumulator.

    or x1;Perform OR operation between the state of x1 and the state in the accumulator.

    ld x2;At this time, if you directly take the state of x2 into the accumulator, then the first two instructions will be in vain.

    All of these instructions have an implicit operation, that is, to put the results of the first two instructions into the stack protection, and then take the state of x2 into the accumulator.

    or x3;Next, take the state of x3 and use it with an accumulator or arithmetic.

    anb ;This execution is to put the state value at the top of the stack (i.e., the one that goes into the stack before it is protected).

    and the state of the current accumulator. That's what the book says, blocks and instructions.

    out y0;Output.

    From the above analysis, I have concluded that as long as LD appears, there must be an output. If there is no output, and then there is LD, then there must be an operation into the stack.

    This into the stack is done by the PLC system itself. As long as you're programming it right, there's no need to bother with him.

    But to understand how the fall is executed, I understand it this way, you refer to Ha!!

    Have a nice day!

  9. Anonymous users2024-01-31

    Generally, the previous number will be pressed into the stack, the next one will come in, and the previous one will be pressed down, and their operation results will be stored at the top of the stack.

  10. Anonymous users2024-01-30

    If you're programming with ladders, I think you just need to understand the stack instructions, and you don't need to be stacked for general ladder programming.

  11. Anonymous users2024-01-29

    A stack is a data structure in which data items are arranged sequentially, and data items can only be inserted and deleted at one end, called the top of the stack. Key points: Heap: Order: Arbitrary stack: last-in first-out

    1. Prerequisites - Memory allocation of the program The memory occupied by a program compiled by C C++ is divided into the following parts: 1. Stack - automatically allocated and released by the compiler, storing the parameter values of functions, the values of local variables, etc. It behaves like a stack in a data structure. 2. Heap — Assigned by the programmer to release, if the programmer does not release, the program may end by OS**.

    Note that it's not the same thing as a heap in a data structure, and it's allocated in a similar way to a linked list. 3. Global (static) — The storage of global variables and static variables is placed together, the initialized global variables and static variables are in one area, and the uninitialized global variables and uninitialized static variables are in another adjacent area. It will be released by the system after the program ends.

    4. Text Constant Area — The constant string is placed here, and it will be released by the system after the program is over. 5. Program area — the binary of the function body. 2. Example program This is a predecessor who wrote it in great detail int a = 0; global initialization area char *p1; The global uninitialized area main() is the 10- and 20-byte allocated area right in the heap.

    strcpy(p1, "123456");123456 0 in the constant area, the compiler may point it to the one that p3 points to"123456"Optimize into one place.

  12. Anonymous users2024-01-28

    It's like a magazine, one bullet at a time, the bullet represents the data, and the bottom bullet of each bullet will go down until it is full. If you put another bullet in it, the bottom bullet will be squeezed out. Changing bullets to data makes sense.

  13. Anonymous users2024-01-27

    Like all assembly languages, the PLC stack is used to process the intermediate data of the user's program process.

    1. When the circuit blocks are connected in series or parallel, it is used to store the intermediate operation results.

    2. When the contact and the coil, or the contact and other output instructions form a multi-branch circuit, it is used to save the operation result of the branch point.

    During the stack access process, the PLC has dedicated FIFO and LINFO instructions.

  14. Anonymous users2024-01-26

    In layman's terms, a stack is a temporary storage area for data, which follows the first-in, last-out principle, that is, the data that is pressed in first and taken out last. It is not only used in PLC programming, all computer programming has a stack, and all follow the first-in, last-out rule.

  15. Anonymous users2024-01-25

    What is a heap called? You use a dozen mahjong tiles stacked vertically into a stack, which is called a pile, and you can draw any card from above, below, or in the middle, or you can insert one at will.

    What is a stack? The AK-47's magazine is a stack of bullets that you can't take out until the bullets on top are removed - although you can read the type and color of bullets inside from the transparent part on the side.

  16. Anonymous users2024-01-24

    Stack instructions and stack instructions assembled by microcomputers have the same meaning, that is, "first-in, last-out", generally this instruction can be used for data protection, such as the execution of the previous program segment, call another program segment, in order to prevent the original register data from being modified, you can push (into the stack), and then out of the stack (pop) after the execution of that program, the previous data will be restored again. Continue with the previous paragraph. These two commands are very useful at this point!

  17. Anonymous users2024-01-23

    Look at the programming manual, where there is an introduction to belief.

  18. Anonymous users2024-01-22

    It is equivalent to this contact being a long-closed contact.

Related questions
6 answers2024-04-19

PLC has the concept of macro, in fact, the so-called macro is any kind of programming software, it is just a thought, the specific form may be different, but the function is the same, is to simplify the process of repeated programming and the establishment of the concept of macro, and Excel in the macro concept is similar. It refers to a set of algorithms. For example, Mitsubishi PLC's Q series, there is a macro function, that is, a macro function, the approximate usage is that you write a program, you can register this program as a macro, and then set some macro parameters, and then you can call the macro and set some parameters that you set when establishing the macro, you can automatically generate the corresponding program, simplifying the writing steps. >>>More

6 answers2024-04-19

People are asking about PLC industrial control.

9 answers2024-04-19

TO is to write the command of the special function module, that is, to send the data in the PLC to the special function module and buffer memory BFM. >>>More

4 answers2024-04-19

If it is a Siemens 300PLC directly call the proportional library FC105, it is OK to change the upper and lower limits. >>>More

21 answers2024-04-19

It's simple, do you pay for it, I'll do it for you.