Ch 5: Move, Math, and Data Compare Instructions (Studio 5000)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/59

encourage image

There's no tags or description

Looks like no tags are added yet.

60 Terms

1
New cards

MOV

Move instruction

2
New cards

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

3
New cards

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


4
New cards

When does the MOV Instruction perform?

During every program scan as long as it has true logical continuity path to the instruction

5
New cards

Where is the MOV Instruction located?

In the Move/Logical tab

6
New cards

What two parameters for the MOV instruction need to be configured?

The source and the destination

7
New cards

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)

8
New cards

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.

9
New cards

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

10
New cards

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

11
New cards

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

12
New cards

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

13
New cards

What does the MOV instruction need to operate effectively?

An input

14
New cards

What two instructions will the MOV instruction have?

An input (initiate operation) and a one shot (ONS) instruction (limit it’s operation)

15
New cards

Describe what the MOV instruction is used to do

The MOV instruction is used to copy information from a source to a destination

16
New cards

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.)

17
New cards

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)

18
New cards

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

19
New cards

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

20
New cards

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

21
New cards

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

22
New cards

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

23
New cards

Where is the ADD instruction located?

Compute/math tab of the language element toolbar

24
New cards

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)

25
New cards

The destination of a math instruction must:

be an assigned memory location. Supports SINT, INT, DINT, or REAL data types.

26
New cards

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

27
New cards

In addition to the ADD instruction being an output instruction, what else can it be used for?

A custom counter

28
New cards

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

29
New cards

What instruction is used to limit the ADD instruction to operate only once each time the input is true?

The ONS (one-shot) instruction

30
New cards

What mathematical law dictates how the ADD instruction functions?

The communicative law

31
New cards

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.

32
New cards

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

33
New cards

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.

34
New cards

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)

35
New cards

The destination of the DIV instruction must be:

A memory location in the processor

36
New cards

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.

37
New cards

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)

38
New cards

What does the compute (CPT) Instruction do?

Evaluates the mathematical expression and places the result in the destination

39
New cards

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


40
New cards

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

41
New cards

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

42
New cards

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)

43
New cards

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.

44
New cards

Define mathematical expression

Mathematical phrase that can contain ordinary numbers, variables, and operators such as add, subtract, multiply, and divide

45
New cards

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)

46
New cards

When data compare instructions have constant values, where is it placed?

Source B must be the only source with constant values

47
New cards

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.

48
New cards

Where is the GRT instruction?

Compare tab

49
New cards

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

50
New cards

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

51
New cards

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

52
New cards

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.

53
New cards

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

54
New cards

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

55
New cards

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).

56
New cards

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

57
New cards

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

58
New cards

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

59
New cards

Why is it not recommended to use tags with REAL data types with the EQU instruction?

They are rarely absolutely equal

60
New cards

When is an NEQ instruction true?

When source A is not equal to source B