Perform MOV instruction on blocks of memory? (AB MicroLogix 1400)

Iridescence

Member
Join Date
Aug 2013
Location
San Francisco
Posts
6
Hello,

I'm currently programming a MicroLogix 1400 using RSLogix Micro Starter, and I'm trying to convert a block of LONG values into FLOAT values. I know that the MOV instruction does this for a single value, but is there a way to do this in batch? I have a lot of values to convert, and I don't want to create a MOV instruction for each one of them....

Thanks for your help.
 
The "CPW" instruction should do that.

Note: I have not actually tried it, but it can't hurt to give it a try.
 
No, the CPW will copy the actual bit patterns, which are very different between Long and Float. If the source and dedtinations locations are each sequential you could use indirect addressing within a JMP/LBL area.
 
bernie - can you explain the indirect addressing concept? I've been looking for something like this for a while to use in applications with repetitive actions.
 
For indirect addressing, you basically use a variable in the name of the name of your address or tag. So instead of using the address N7:33, you would could N7:[N10:0] and it would be the exact same address if the value of N10:0 was 33.

So basically, if you wanted to copy N7:0 - N7:10 to F8:0 - F8:10, you could just set up a move to move N7:[N7:11] to F8:[N7:11] and then make an add instruction that increases N7:11 from 0 - 10.
 
Just be careful of your destination address is within the data limits.
Say, if you call to move to N7:257, which is not existent, your processor will fault.

Regards
 
Unfortunately the ML1400 does not have an FAL instruction, that would be the way to do it.

So, next best thing, if you are moving less than 25 or so words of data then just do a brute force move with each move explicitly programmed. When you use a for/next loop (JMP/LBL loop) the processor actually executes more instructions plus it has the overhead of indirect addressing. For small blocks of data programming a brute force move for each doesn't require significant programming time (less time than waiting for a forum reply), and months or years from now when Bubba has to look at it he doesn't have a WTH? moment when he sees the loop, its easy for him to understand.
 

Similar Topics

Hello Friends, I am trying to index M Bits, however GX Works2 is not allowing it with following message. https://ibb.co/zPcqj6M...
Replies
3
Views
1,299
Hi, I've searched the forums and none of the previous threads seem to have a solution to my problem. I am using Logix Designer 27.11 Professional...
Replies
10
Views
5,775
Hello all, I have a controLogix running studio5k v.21.03 that I am unable to do a couple of things. First, I cannot perform any online edits. I...
Replies
4
Views
1,496
I am trying to open a project file in RSLogix 5000 V20.04.00 (CPR 9 SR 5). This is what I get in the help: Access denied Check to make sure that...
Replies
6
Views
4,482
Can't perform online edit on a PLC5. My problem is similar to this thread: http://www.plctalk.net/qanda/showthread.php?t=61189 In the Processor...
Replies
12
Views
5,030
Back
Top Bottom