Controllogix PLC5 Conversion DTR

asterof

Member
Join Date
May 2007
Location
Califonia
Posts
554
The DTR requires a DINT
This is a PLC5 conversion to Controllogix without altering the HMI
So the N files must be Ints not Dints
Here I have moved the Ints into Dints to use the DTR
What I can not figure out is how to move a value of zero
into the Int File N (file number is relative to the value of N7[200] )

Any ideas appreciated
Thanks

DTR.jpg
 
Roll you own DTR to get around the DINTs.
The COP instruction is the wrong instruction for this. Use FLL instead.

NEQ N7[200] N7[201] MOV N7[200] N7[201] FLL 0 N[N7[200][0] 10

If you are unfamiliar with the mnemonics then copy the line above and insert a blank rung. Double click the rung number and a text entry field will pop up at the top of your ladder. Paste the copied rung in and hit enter, you'll see the rung.

Here is what it should look like


-+-NEQ-----------+----+-MOV-----------+----+-FLL-----------+
|A N7[200]| |SRC N7[200]| |SRC 0|
|B N7[201]| |DEST N7[201]| |DEST N7[200][0]|
+---------------+ +---------------+ |LEN 10|
+---------------+




Also, you might want to check the way the PLC5 files were translated. It looks like the PLC/5 program used indirection to specify a file number. If this is the case then you are going to have to redefine all your tags that are prefixed with a N into a 2D array or you are going to have to bite the bullet and do it the right way and rewrite the program for CLX instead of using the translator.

In the CLX N7, N9, N10, etc are the tag names of arrays. The numbers 7,9, and 10 are part of the array tag name, they are not an index-able address. If the PLC/5 used indirect addressing on the file number then you have to define an array N[3][200] to get three index-able columns in the array. Now all N7 addresses will translate to N[0][???], N9 addresses translate to N[1][???], and N10 addresses translate to N[1][???].

If that is the case then you will not be able to do this without altering the HMI.
 
Last edited:
Your missing the point of the N[N7[200][0] 10
This is saying, and it is like this in the PLC5, and I did not use the translator

It says Locate the N file of the index in N7[200]
so if the value of N7[200] is 26 then this would zero out
N26[0] length of 10

DTR.jpg
 
I'm not missing the point.

"It says Locate the N file of the index in N7[200]
so if the value of N7[200] is 26 then this would zero out
N26[0] length of 10"

This is exactly what I was referring to above. To do the same thing in the CLX you will need to define a 2D array named N. Just N, not N7, and treat the columns of the array as though they were the same as your PLC/5 files. If you define an array and name it N26 then the ONLY way to access that array is by its explicit name.


Put it another way, if you are using files N26, N27, N28, and N29, and using indirection to select which of those four files you are writing to then you need to define an array N[4][10] (or whatever size you need). Now you will need to either redefine the index value you are putting in N200, or you will need to use an expression that evaluates to 0 through 3 (or however many files you are using).

For example, given that array N[4][10] is defined and the value in N7:200 is 26, then use
FLL 0 N[N7[200]-26][0] 10 to zero the first column of the array. If N7:200 is 27 then the same expression will zero the second column of the array, and so on. Adjust accordingly for your actual file usage.
 
Last edited:

Similar Topics

Hello, I am currently converting a project from PLC5 to ControlLogix. I have migrated the program from Logix5 to Logix5000 and any Block Transfer...
Replies
4
Views
3,347
Hi all, I have used your forum a lot in the past for helpful hints, but I could not find anything on this question. I have a project where I am...
Replies
2
Views
2,862
Hi All! I am going over some PLC 5 code in preparation of an upgrade to a ControlLogix processor. A rung of code in the 5 has a compute block with...
Replies
7
Views
2,618
When I attempt to convert my PLC5 (.PC5 program) to Controlllogix in RSLogix 5000 (v 20.01), it gets about 1/2 way then I get this error: Fatal...
Replies
4
Views
2,924
Hi,I am doing PLC5 To Clx conversion project.I have problem with I/O cofiguration in ControlLogix. 1) when I connect RIO cable to new 1756-DHRIO...
Replies
39
Views
13,109
Back
Top Bottom