OkiePC
Lifetime Supporting Member
Post your code, so we can continue working on the same version.
I didn't include the original in my example, and there are many things that can be done quite easily to clean it up, make it shorter, and even do away with the dummy steps to give the required off time between commands.
The error with the indirect address means that a pointer used in an indirect address ([N7:0] in my example) is greater than the highest element number of the file.
I am not sure what you meant about moving from B3:7/15 to B3:8/1...lost me there...
Since you have 22 macros, I may write up another example to accommodate all of them.
What version of RSLinx do you have? If you have a licensed version, we can use Microsoft Excel as a temporary interface to make it much easier to document the required data for the macros, and then send the data directly to your PLC.
Even with RSLinx Lite (which does not support DDE/OPC), we could use excel to generate all the values, and then copy and paste them into the data files. It is a whole lot easier than toggling bits one at a time in RSLogix.
Plus, it gives you a design document that you can format neatly and print for reference.
Your question about using a separate subroutine to allow duplicate OTE (output coil) instructions: yes, you could do that and it can fix the problem, but can create other issues, and is not usually considered a good practice.
I would suggest sticking with one OTE per output address and we can do other things to clean up the logic to make it more efficient and readable.
So, post the .rss file (zip it first), and we can go forward from here.
Paul
I didn't include the original in my example, and there are many things that can be done quite easily to clean it up, make it shorter, and even do away with the dummy steps to give the required off time between commands.
The error with the indirect address means that a pointer used in an indirect address ([N7:0] in my example) is greater than the highest element number of the file.
I am not sure what you meant about moving from B3:7/15 to B3:8/1...lost me there...
Since you have 22 macros, I may write up another example to accommodate all of them.
What version of RSLinx do you have? If you have a licensed version, we can use Microsoft Excel as a temporary interface to make it much easier to document the required data for the macros, and then send the data directly to your PLC.
Even with RSLinx Lite (which does not support DDE/OPC), we could use excel to generate all the values, and then copy and paste them into the data files. It is a whole lot easier than toggling bits one at a time in RSLogix.
Plus, it gives you a design document that you can format neatly and print for reference.
Your question about using a separate subroutine to allow duplicate OTE (output coil) instructions: yes, you could do that and it can fix the problem, but can create other issues, and is not usually considered a good practice.
I would suggest sticking with one OTE per output address and we can do other things to clean up the logic to make it more efficient and readable.
So, post the .rss file (zip it first), and we can go forward from here.
Paul
Last edited: