Copy String array to STR_480 array ?

passwordg

Member
Join Date
Aug 2011
Location
South Carolina
Posts
224
I need to change a Controllogix 5000 program to work with longer strings, so I decided to replace a String array with a STR_480 array.
Am I right in that this is just a string which can hold more characters ?

To copy values from string[1000] to STR_480[1000]:
How can I copy the data from the smaller array to the larger one ?

COP is giving unexpected values as I think multiple members of the smaller array are copied to a single member of the larger array. MOV is giving an error because different data types.

Is there any way to do this at all please ?
 
Create your new String Data-Type (1)

Save the program, as an L5K (ASCII) file.

Edit it with notepad or wordpad to change all the STRING[1000] references to your new data-type. (2)

Re-import the L5K (save a backup of your old .ACD file in case it goes pear-shaped). (3)

Repeat as required until successful.

Notes on the above

(1) Don't Create the STR_480 Array, (delete it if you have before saving as L5K) or you will need to delete it in the export

(2) All you need to do is find the STRING[1000] Tag, of data-type STRING, and change it to STR_480 Tag, and change the data-type to STR_480

(3) The import will overwrite your original ACD file, so back-it-up

I've just tried this, and it works, even though there's only 82 characters in the import for a 480 character string, it accepts it
 
Last edited:
Daba's idea is better.



Had to look that euphemism up, never heard it before though the meaning is obvious. Seems its a UK thing.


Pear-shaped is a much nicer euphemism than some that the site won't allow. :eek:
 
I'm just a little curious as to why you need 480-character Strings ??
 
I said STR_480, because it is already defined in Rslogix and I thought it would be easier to convey my thoughts. I actually need to handle strings of 150 characters or so in length.

IT, gets data from Oracel/SQL and sends me data for parts to be built in the form of these strings which contain part description etc. The 82 character default generally "just" works, but occasionally there is an error and they send a string with leading 0's which takes the length beyond 100 (but <150). This was my idea of a solution.
Plus Controllogix's have quite a bit of memory.
 
I said STR_480, because it is already defined in Rslogix and I thought it would be easier to convey my thoughts. I actually need to handle strings of 150 characters or so in length.

IT, gets data from Oracel/SQL and sends me data for parts to be built in the form of these strings which contain part description etc. The 82 character default generally "just" works, but occasionally there is an error and they send a string with leading 0's which takes the length beyond 100 (but <150). This was my idea of a solution.
Plus Controllogix's have quite a bit of memory.

IMHO, the string sent to the controller should be "in spec", and the controller knows how to handle it...

asking the controller to accept a badly constructed string of indeterminate length is asking for trouble....

the problem should be fixed at source, i.e. Oracle/SQL

edit : STR_480 is not a pre-defined STRING data-type, someone must have put it there, so the question still stands, what is a 480-character string being used for ?
 
Last edited:

Similar Topics

I am using v14 with a 1215 dc/dc/dc. I need to copy a 50 element array of strings to another 50 element array of strings. I can work it out for...
Replies
3
Views
4,055
Productivity3000. I have a 32 bit integer, 1d array that i need converted to a string. The string to array seems to work with the same time type...
Replies
0
Views
2,171
Topic says it all, is there an easy way to copy an Excel table into a string array in RSLogix?
Replies
3
Views
1,952
Hi all, I'm trying to populate a STRING with ASCII characters from an SINT array. My COP command is setup in the following fashion...
Replies
3
Views
3,395
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
131
Back
Top Bottom