STRING-tag issue

ceilingwalker

Lifetime Supporting Member
Join Date
Mar 2010
Location
Phoenix, AZ
Posts
1,586
Hello all. I have a feeling I am going to shame myself with this question but I can't resolve it and can't figure it out......probably making it difficult again! I have been trying to write to a string tag that I created in Studio5k. It isn't going well. I have done it before without an issue so out of desperation I copied a rung from a project I had created previously and pasted it into my new project and even it doesn't work, in my new project. I am hoping someone might know what I am doing wrong. Again, this rung works fine in one project PLC code but not in my current one.

Screenshot 2024-01-12 180436.png
 
I literally copied this rung and pasted it to my new project, created the tags in the new project, and it keeps telling me "Invalid data type. Argument must match parameter data type". I am moving a string into a string.
 
Is this an older version of Studio5000?

The use of static text ('text') in an instruction is a fairly new function. The old method is to create a new String tag then populate it in the controller tags > monitor section. Then you can COP from String to String.
 
Use COP instruction instead of MOV. MOV support for strings (and literals) appeared fairly recently and only in 5380/5580 controllers. Maybe it was working in your other project because it was a 5380 (5069) and your new project is 5370 (1769).
 
Is this an older version of Studio5000?

The use of static text ('text') in an instruction is a fairly new function. The old method is to create a new String tag then populate it in the controller tags > monitor section. Then you can COP from String to String.

Both v.30
 
Use COP instruction instead of MOV. MOV support for strings (and literals) appeared fairly recently and only in 5380/5580 controllers. Maybe it was working in your other project because it was a 5380 (5069) and your new project is 5370 (1769).

Yup, worked in my other project because it was a 5380 and my current project uses a 5370. It's AB so I am really not surprised at all. It's alright, not that big of a deal, just figure out another way to do it as others have suggested here.
 
Yep, def model specific.
Learnt this the hard way also
If you want to hard code the characters, you can write to the ‘.DATA[] attributes the ASCII code
Just make sure to write to the .LEN as well
 
Don't you have to COP StringTag.Data using length of StringTag.LEN ?

No, not when you are copying a STRING to a STRING because they are a byte by byte copy.

Where things get weird is when the types are not the same. For example, if you have a barcode reader and the data is in an array of SINTs, you want it in a STRING. You would have to copy the barcode SINT's in to the strings data array, then manipulate the LEN
 

Similar Topics

Hi I am trying to Write into a PLC Tag using the Inger v7 , the Plc is a Micrologix 850 2080-LC50-48QWB , I can write bool , interger , but when...
Replies
1
Views
398
Action On Release command Set(ConveyorPopup,ConveyorPop_1) rejected w/ string tags. SetStringTag(index, data) wants an index. How does one pass...
Replies
8
Views
960
Hello all, I have a FactoryTalk View SE HMI where I am using a macro to display an appropriate display based upon a value that's passed into the...
Replies
0
Views
1,244
Long story short, I am creating a display to display an array of Strings from PLC [topic]VarStrA_RPHD.Desc[VarStrB] totally 100 strings...
Replies
1
Views
1,403
I'm currently working on an MES interface PLC which passes around a whole bunch of strings. A lot of these strings are really just to allow for an...
Replies
0
Views
1,118
Back
Top Bottom