Stored Procedure and strings problem


Today we noticed that a stored procedure doesn’t writes strings correctly. Our PLC program is an allen bradley controllogix program and we try to write strings there. The string structure is composed by a lenght parameter and a SINT array, so the array have the chars and the LEN parameter have the lenght of the string. When i write the string tag with my stored procedure, chars are written fine but the lenght still been “0”.

The string tag in ignition was configured like this: [LM_P1]BatchDB_in.Head.String.DATA,SC10

I would like to know if i can do something to avoid write the “LEN” parameter with the procedure.

Thanks in advance.


This is really an issue with RSLinx and how it works with strings. I’m a bit confused though, because we’ve never had a problem with people writing strings. Most of the ones I know of, though, address just the “Data” portion, and don’t use the additional length specifier.

Anyhow, when searching around through RSLinx documentation and other websites, I found several statements like this concerning C-Style strings:

Hope this helps,

In fact help me a lot,

Thank you very much.

Haven’t needed to use strings with Ignition yet, but with RSView, using RSLinx as the OPC server you would read/write to the base tag name and RSLinx would update the string length property automatically. Also note that this is the same behavior for Kepware.

For example is you had a string tag MyString, with contains the data types .LEN as DINT and DATA as SINT(82). When you define it in RSview you only refer to the tag MyString. When you write to the data the text goes in the .DATA portion and the .LEN is updated for the correct number of characters written. If you manipulate the string data inside the PLC and the .LEN is set to 0, your data results will be empty. So the .LEN property must be correct if you are manipulating the string data in the PLC.