Hello I've already come up with a solution to the problem described below, so this is mainly a curiosity had the situation been different. I'm wondering if there is a clean way to solve this should many different values exist and not just a few as in my situation:
Background:
I was faced with an issue where the PLC-5 code for a PLC5/11 used indirect addressing in a copy instruction with "#N[N251:0]:1" as the source and a length of 50. Using the translate tool to convert the PLC-5 code to ControlLogix, I ended up with "N[N251_0][1]" which returns an error. Since there were only 3 possible values for N251_0 (101, 102, or 103) allowed by the code, I set up 3 EQU instructions (each on their own branch) to copy the value of the appropriate N101[1], N102[1], or N103[1] length of 50. This was a quick fix because there were only 3 possible values.
My question is: What if there were many values for N251_0? Is there a way to make the indirect addressing work as it did in the PLC5 code without having to make major modifications the code that was converted from PLC-5 to CLX?
I've attached screenshots of the before and after conversion, and of the solution I used.
Thank you for any input!
Background:
I was faced with an issue where the PLC-5 code for a PLC5/11 used indirect addressing in a copy instruction with "#N[N251:0]:1" as the source and a length of 50. Using the translate tool to convert the PLC-5 code to ControlLogix, I ended up with "N[N251_0][1]" which returns an error. Since there were only 3 possible values for N251_0 (101, 102, or 103) allowed by the code, I set up 3 EQU instructions (each on their own branch) to copy the value of the appropriate N101[1], N102[1], or N103[1] length of 50. This was a quick fix because there were only 3 possible values.
My question is: What if there were many values for N251_0? Is there a way to make the indirect addressing work as it did in the PLC5 code without having to make major modifications the code that was converted from PLC-5 to CLX?
I've attached screenshots of the before and after conversion, and of the solution I used.
Thank you for any input!