PLC5 COP to MVM

cncsparky

Member
Join Date
Dec 2014
Location
Ks
Posts
98
Have a need to mask some bits that are currently being copied from one integer file to another. Looks like the MVM instruction is fairly straight forward, can I just replace the current COP to a MVM?

COP
Source #N10:12
Dest #N22:52
Length 2

Do I need two MVM instructions to do this? It has no length parameter, so assuming it only does one integer per instruction.

MVM
Source N10:12
Mask XXXX
Dest N22:52

MVM
Source N10:13
Mask XXXX
Dest N22:53
 
I just want to make sure you know that the MVM instruction is not like a bitwise AND. The MVM will leave unaffected the bits in the destination aligned with a 0 in the mask. As an example:

Source 0000 1111 0000 1111
Mask 0101 0101 0101 0101

Destination before operation:
1010 1010 1010 1010

Destination after operation:
1010 1111 1010 1111

Keith
 

Similar Topics

I am using the following formula and I am getting error, Invalid Expression - too many closing parenthesis. when i copy the formula to notepad or...
Replies
4
Views
152
Preface: Kinda long, so I made section titles Intro: I just want to see if anyone here has seen anything similar. A PLC5-40 series C enhanced...
Replies
3
Views
365
Hi, can anyone help me get a pdf file for this RSP files. They are from a PLC5. Thanks
Replies
5
Views
517
Hello all, I am seeing this behaviour where an integer file (N46:33), has an integer in binary (11110) which is 30 in decimal. I did a...
Replies
7
Views
516
Back
Top Bottom