1/59
Looks like no tags are added yet.
MOV
Move instruction
The MOV Instruction
Is an output instruction. Can move a numerical value/information of one memory location to another location; Used to copy information from a source to a destination
Does the MOV Instruction need to go from false to true to operate?
FALSE; The MOV Instruction does NOT need to change states to operate
When does the MOV Instruction perform?
During every program scan as long as it has true logical continuity path to the instruction
Where is the MOV Instruction located?
In the Move/Logical tab
What two parameters for the MOV instruction need to be configured?
The source and the destination
What is the source of the MOV instruction?
The information that will be copied to the destination; either a numerical value or a memory location (That can hold a numerical value)
What is the destination of the MOV instruction?
Must be a memory location that can hold a numerical value; can be one of the many different memory locations; can be the PRE of a timer, ACC of a counter, a base tag, ect.
What are the limiting factors for the memory location of the source/destination (MOV instruction)?
Cannot be a bit-level memory location; tag data type must have a sufficient memory size
T/F: The use of a numerical value as a source of a MOV instruction presents a limitation in terms of programming flexibility
True: if a numerical value is used in the source perimeter, it cannot easily be changed once the processor is in run mode
T/F: The use of a numerical value as a source of a MOV instruction presents a limitation in terms of programming flexibility
True: if a numerical value is used in the source perimeter, it cannot easily be changed once the processor is in run mode
T/F: The use of a tag and a source perimeter of a MLB instruction will in NOT allow for programming and editing flexibility while the PLC processor is in run mode
False: The use of a tag will allow for programming and editing flexibility, even though the PLC processor is in run mode
What does the MOV instruction need to operate effectively?
An input
What two instructions will the MOV instruction have?
An input (initiate operation) and a one shot (ONS) instruction (limit it’s operation)
Describe what the MOV instruction is used to do
The MOV instruction is used to copy information from a source to a destination
What are the conditions the destination perimeter of the MOV instruction must conformed to?
Must be a memory location that can hold a numerical value (Such as PRE value of a timer, ACC value of a counter, a base tag, ect.)
Explain the difference when the source of a MOV instruction is a numerical value versus when the source is a tag
Numerical: cannot easily be changed once in red mode( Will not have a blue arrow)
Tag: allows for programming and editing flexibility while PLC is in run mode (can be altered in the Value column)
Math instruction
I’ll put instruction that is used to perform basic math operations. Requires two input sources (source A and source B) And a destination; does not need to change from false to true to run
When does the math instruction stop performing its operation?
Until the logic continuity to the instruction becomes false; it does not need to change from a state from false to true to operate
T/F: you do not need to use constant values with source A or source B, and both of the sources must be an assigned memory location
False: Constant values can be used with source A and source B, but one of the sources must be an assigned memory location
What should be the assigned memory location for source A or source B
Examples: ACC value of a timer, or base tag with the SINT, INT, DINT, or REAL data type
ADD instruction
The addition instruction: Outputs instruction that adds the values of source A and source B and stores the result in the destination tag
Where is the ADD instruction located?
Compute/math tab of the language element toolbar
Is the use of a constant value for source A or source B allowed for the ADD instruction?
It is allowed, but it does decrease the programming flexibility of the math instruction; like the MOV instruction, once a constant value is used in a source, it cannot be easily changed while the PLC is run mode (no blue arrow for source A; blue arrow for source B)
The destination of a math instruction must:
be an assigned memory location. Supports SINT, INT, DINT, or REAL data types.
An output instruction is typically used for the effective operation for the ADD instruction
False: an input instruction is typically used for the effective operation of the ADD instruction
In addition to the ADD instruction being an output instruction, what else can it be used for?
A custom counter
What is the difference between the ADD instruction and CTU (count-up) Instruction?
CTU Instruction can only increment by one count every time there’s a change of state from false to true.
When variables for source A, source B, and the destination are specifically selected, the ADD instruction can be used to increment at different values other than 1
What instruction is used to limit the ADD instruction to operate only once each time the input is true?
The ONS (one-shot) instruction
What mathematical law dictates how the ADD instruction functions?
The communicative law
SUB instruction
The subtraction instruction: Output instruction that subtracts source B from source A and places the results in the destination tag. Does not need to change a state from false to true to perform.
F/T: like the ADD instruction, The SUV instruction functions the same
False: Source A and source B are not interchangeable values for the SUB instruction, unlike the ADD instruction where those values are interchangeable
DIV instruction
Division instruction: input put instruction that divides source A from source B and stores result in the destination tag. Does not need a change of state from false to true to perform. Values in source A and source B matter.
Source A or source B must be a memory location:
In the PLC processor (e.x. ACC of a counter, PRE of a timer, or a base tag with the SINT, INT, DINT, or REAL data types)
The destination of the DIV instruction must be:
A memory location in the processor
MUL instructon
Multiplication instruction: Output instruction that multiplies the value in source A by the value in source B and stores the result in the destination tag. Values in source A or B can be constant values or addressable locations (tags). Both source A and source B cannot be constant values.
CPT instruction
Compute instruction: Output instruction that performs an arithmetic operation defined in a mathematical expression (ordinary numbers, variables, and operators such as add, subtract, multiply, and divide)
What does the compute (CPT) Instruction do?
Evaluates the mathematical expression and places the result in the destination
Some rules that apply to using the CPT instruction:
Conventional rules for how mathematical expressions operate (Order of operations: Parentheses, exponents, Multiplication and division [Left to right], Addition and subtraction [Left to right]).
Mathematical expression must have at least one variable in it. Must have addressable location or tag
there cannot be a mathematical operation in the expression that only contains constant values (1.8 instead of 9/5)
Destination must be a tag/addressable location in the processor’s memory
What is different about the CPT instruction from the other instructions?
Allows for a complex mathematical expression to be entered using one instruction rather than multiple basic math instructions
T/F: Do math instructions need a change of state and logic continuity to operate similar to counter instructions?
True. The logic continuity must be true for math instructions to operate
Can source or the destination for math instruction be a constant value?
Source can be a constant value, but it decreases the programming flexibility of the math instruction. The destination MUST be an assigned memory location (SINT, INT, DINT, and REAL data types)
Data compare instruction
An input instruction. Used to compare the numerical data from two sources. Determines whether the comparison is true or false. If both sources are determined to be true, It will allow logic continuity through to the next instruction.
Define mathematical expression
Mathematical phrase that can contain ordinary numbers, variables, and operators such as add, subtract, multiply, and divide
What is different about data compare instructions from math instructions?
One of the sources must be an assigned memory location (ACC of a timer, or a base tag with one of the SINT, INT, DINT, or REAL data types)
When data compare instructions have constant values, where is it placed?
Source B must be the only source with constant values
GRT instructions
Greater Than instruction (a data compare instruction): determines if source A is greater than source B. If source A is greater than source B, the instruction will be true and allow logic continuity to next instruction.
Where is the GRT instruction?
Compare tab
T/F: addressable locations—like timers, counters, or any tags with the data type that can store a numerical value—cannot be used for either source of a GRT instruction
False: addressable locations CAN be used for either source of a GRT instruction
T/F: If an addressable location (e.x. ACC of timer) in source B is greater than the constant value in source A, there will be logic continuity
True: there will be logical continuity if the addressable location in source B is greater than the constant value in source A
You can use a constant value in source B, however:
It does not allow an easy way to edit the value when the processor is in run mode
GEQ Instruction
Greater than or equal to instruction (data compare instruction): determines if source A is greater than or equal to source B. If source A is greater, continuity is allowed through to the next instruction.
LES instruction
Less than instruction (data compare instruction): determines if source A is less than source B. When source A is less, the LES instruction is true and will allow logic continuity through to the next instruction. If source A is greater than source B, the instruction is false
LEQ Instruction
Less than or equal to instruction (Data compare instruction): Determines if source A is less than or equal to source B. If source A Is less than/Equal to source B, logical continuity is allowed through to the next instruction
EQU instruction
Equal to instruction (Data Compare instruction): Determines if source A is equal to source B. If equal, it is true, and logic continuity is allowed through the instruction. REAL values are rarely absolutely equal (too many places after the decimal point that must be exactly equal).
NEQ instruction
Not equal to instruction (Data compare instruction): determines if source A is not equal to source B. If not equal, the instruction is true and will allow logic continuity through. If source A is equal to source B, the NEQ instruction is false and will not allow logic continuity through the instruction
Can all the parameters (Source A and source B) be constant values in data compare instructions?
Constant values can be used with source A and source B, but one of the sources must be in assigned memory location. When constant values are used with some types of data compare instructions, source B must be the only source that has constant values
Can all the parameters (Source A and source B) be constant values in data compare instructions?
Constant values can be used with source A and source B, but one of the sources must be in assigned memory location. When constant values are used with some types of data compare instructions, source B must be the only source that has constant values
Why is it not recommended to use tags with REAL data types with the EQU instruction?
They are rarely absolutely equal
When is an NEQ instruction true?
When source A is not equal to source B