Sign in to follow this  
Followers 0
Ken Moore

ML1400 Two Integers to LONG

8 posts in this topic

I'm using a ML1400 to read Modbus registers on a Chiller. The time values are all stored in two consecutive registers at the chiller, and I have them stored in two integer registers. N7:0 and N7:1. Does anyone know if the copy word instruction CPW will convert these two 16 bit integers to one long integer? thanks, Ken
1 person likes this

Share this post


Link to post
Share on other sites
CPW can do this. Soure for the first integer address N7:0, Dest for long integer address, the length is 2.

Share this post


Link to post
Share on other sites
Ken, I have an example that demonstrates the CPW command on a ML-1400. The example is basically doing what I believe you are trying to do... combining two adjacent N-registers into a (long) L-register. See page 3 on this document: http://scadametrics.com/PDF/App_Note_002.pdf Hope this helps! -Jim.

Share this post


Link to post
Share on other sites
Along the same lines. How would you combine an array of them if the high byte was in N7:0 and the low byte was in N7:1, high byte was in N7:2 and the low byte was in N7:3, etc. I'm actually working in RsLogix 5000 but the only way I can figure out how to do it is to use a million BTDs...

Share this post


Link to post
Share on other sites
Nice write-up.Other vendors would do well to take note of what you have done. Very helpful. I see you have others. Edited by Mickey

Share this post


Link to post
Share on other sites
Tim, swap the high and low words using three XOR statements A := A XOR B. B:= A XOR B A:= TagA XOR TagB. Then copy.

Share this post


Link to post
Share on other sites
Yes, that would work too, just trying to figure out something a little more automated

Share this post


Link to post
Share on other sites
I go it working, thanks for all the replies.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0