Strings in L62

Myles

Member
Join Date
Jul 2007
Location
edinburgh
Posts
175
Hi Guys,
i am using an L62 controllogix unit, i am writing some code to control one of our systems on site.
I have never used the data type "string" before although i understand it can contain letters as well as numbers etc. i thought on this project rather than use text tables on the scada to display what state the machine was in i would use different strings with a step number and smalll description in the program, during the correct stage copy the info into a main string that is displayed on the scada.
this is maybe pretty crazy and way ott but you would then see in the program at a glance whhat stage you were in.
i have posted a rung picture of a rung, just what i came up with after reading some of the instruction help, an ideal solution would have been to use the move function or the copy but they do not appear to support this data type.

thanks

myles
 
You cannot using a MOV block for a string but you can use a COP block. Just make sure the source and destination are of the same type, in your case "String".

I have seen other programmers using the (COP) strings inside the logic to display it out to a PanelView.
 
Thanks Mark

I must have missed that when i was reading the COP help file! do you know if that instruction will wipe out all the characters that was in the main string and replace with all the new ones, in the above rung i was trying to clear the dest. first then move the new one in to it,

cheers

myles
 
I have had problems with old junk being left in a string so what I have done is before I COP, I have a blank_string ("") that I COP first before my actual COP instruction. Hope that makes sense.
 
Yes it makes perfect sense, thanks very much! any idea if what i have got would work? the only benefit over the COP instruction would being able to see the info in the String on the rungs. Now i am just being difficult i know.

thanks for the quick responses

myles
 
Another way , requiring maybe one or rungs of code:

- create an array of strings of Cip_States[XX], where XX is the maximum number of states your CIP program can have.

- You will need an incrementing CIP step counter CIP_STEP

- one change of CIP step CIP_STEP, use the the COP (copy command) to index into the string array to COPY CIP_States[CIP_STEP] to OPERATOR_MESSAGE. The length of the COP command is 1 element. Using the COP moves the String LEN and the DATA from one string to another

- and of course, you will need a state to move blank into the message when CIP is not running
 

Similar Topics

Hey all, was wondering if it was possible to shift values in an array of strings? I have a database that I am loading up with "Users" in the...
Replies
2
Views
310
hi All I am completely green in Mitsubishi PLC (i used to program siemens) but need kepware to connect to FX3U pls with ENET adp module. Could...
Replies
31
Views
7,120
Hi, I have a list selector which I want to display the recipe found inside a plc-5. The recipe is store in an ascii table with each character...
Replies
4
Views
1,435
I'm fairly new to View Studio SE. I'm trying to do a simple visibility animation, but I would like to do so with a string tag. The tag is one...
Replies
0
Views
1,212
For those of you that like living on the bleeding edge of development, you can do this without the need to resort to In/Outs and dummy references...
Replies
51
Views
25,988
Back
Top Bottom