Sign in to follow this  
Followers 0
Conor

L35E Byte swap an Array

4 posts in this topic

Hi guys, I am doing a new project were I am connecting an L35E to a Siemens controller. I have the Profibus connected and working, but I have found that there is byte swapping when sending INT data from Siemens to L35E. I have been able to use the SWPB instruction to reverse the byte swap, but this instruction only is for a length of one INT. I have an Array of data coming over, about 100 INT's. Can someone tell me the best way of un-swapping the complete Array Thanks, Conor

Share this post


Link to post
Share on other sites
The FOR instruction in ControlLogix is like an "indexed JSR", so you could use a For/Next Loop if you want this to happen in the background. If you want to do it all at once, I say write a subroutine with a hundred SWPB instructions and call it when the Input data updates. That will be much faster than a FOR/NEXT loop because you won't have the time required to jump to the subroutine and back. Doesn't the Profibus module for CompactLogix include a "swap bytes" configuration setting ? Edited by Ken Roach

Share this post


Link to post
Share on other sites
Not sure about that setting Ken. I am off tomorrow, but will check on Thurs when back in Thanks for your advise Edited by Conor

Share this post


Link to post
Share on other sites
In the Prosoft Configuration Builder software's Profibus configuration, when you go to a Slave Node's properties and select the third tab "Tags", there will be a set of Data Swap selections; Word, Byte, Both, or None. That's where I would do the data swapping; it will all be done at a low level and very rapidly by the Prosoft module, without any delay or complication in your ladder logic.

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