Micrologix 1400 combine 2 words

bwiring

Member
Join Date
Nov 2005
Location
mpls. mn.
Posts
66
How do es a person combine two words of data into one. N7:0 and N7:1, High word and Low word, 1234 and 5678 and get 12345678.
 
Multiple N7:0 (1234) X 10000 then add N7:1 (5678). Your destination(s) will have to be a "floating point" or "Long" data type.
 
Micky thanks for the quick response. I did that using a long word data type and the processor faulted with a 20h fault. any suggestions?
 
Some information on the fault code is attached. As Mickey said, make sure that the destination of all your math instructions are a LONG data type (not INT), and follow the advice from the manual below if necessary.

Also be aware that the "multiply by 10000" trick will only work if your first value always has 4 digits. If you had 123 and 456, you'd get 1230456, not 123456. If different digit counts are a possibility, you might have to do some trickery with dividing by 10 until you get a number less than 10, see how many divides you have to do, and then multiply by [10 times that number].

Screen Shot 2015-11-30 at 3.18.17 pm.jpg
 
I think you need to multiply n7:0 by 0x10000 (10000 hex) or 65536 to move the first word to the high word of the destination.
 
Post your .RSS filw (zip it first) If what ASF said did not work.

A "CPT" ( compute instruction) should work, with a destination of a long data type.

Move N7:0 to L9:0
Move N7:1 to L9:1

Then:

(L9:0*10000)+L9:1=L9:2

Let us know.
 
Last edited:
Just curious, could a masked move MVM be used to do this? Seems like I did it this way once many years ago.
 

Similar Topics

Hey all, first time poster here. I am wondering if anyone has tried using a Keyence SR-X300 barcode scanner to a Micrologix 1400. Keyence sent...
Replies
0
Views
58
I'm using a SLC typed write from the ControlLogix5572 to the MicroLogix 1400, with path: 2, (MicroLogix IP). The ControlLogix equipment has a...
Replies
0
Views
111
Hi, I am working with a Micrologix 1400 model 1766-L32BXB. With no input wires connected to the “in12” thru “in19”, I am getting 24 volts while...
Replies
4
Views
230
Hi everyone, I hope I don't butcher this up, please feel free to critique me wherever if I do, I have an issue I would equate to "chasing...
Replies
4
Views
313
Hi everyone, I'm working on a project where I need to exchange data between a Siemens S7-1200 PLC and an Allen-Bradley MicroLogix 1400 PLC. The...
Replies
8
Views
678
Back
Top Bottom