'm trying to retrieve HMI data with the STRING tag via a Siemens S7-300 PLC with OPC UA..
In HMI source TIA Portal, DB41.DBX90.0 is for inputting product name.
In Simatic Manager, DB41.DBX90.0 is a string[18].

Ignition TAG
VALUE

When I enter the tag in ignition with the string data type, the output is "bad."
Is there something wrong with my ignition tag or missing?
Hi Does it do that we a simple integer or boolean read ? If yes, then i think that the put and get mechanism is not activate in your hardware config.
Regards
We need more info to know for sure. Do all of your tags have this issue, or only a subset? Are there any messages in the logs with more info?
From the first screenshot it seems that the variable is an array of 20 bytes, containing a string.
From the second and third screenshot it seems like you are declaring a string 18 characters long. In this case, the string starts with a byte for the maximum length, a byte with the actual length, and 18 bytes for the characters. The tag definition in Ignition is correct with this type of string (S7 String type).
If the first one is correct and the tag in Ignition is not working, probably you have an array of 20 bytes containing a string, not an S7 string type (the declaration on the S7 PLC is also incorrect).
I think you are writing the string from the HMI on the first screenshot (Tia Portal?), but you are not writing an S7 string, but a byte array. Declare the tag as an S7 string also on the first HMI, if possible. Otherwise you have to read the 20 bytes in Ignition and create a string from the array (not as easy as the first solution).
1 Like
A String 18 bytes long has 2 bytes length data pre-pended to it, giving a total 20 bytes in the DB.
Declare three tags in ignition,
[ST4_PLC]DB41,B90
- integer
[ST4_PLC]DB41,B91
- integer
[ST4_PLC]DB41,C92
- string
If the string has been entered in the PLC correctly, you should have two non-zero numbers in the first two tags, and the first character of your string in the third.
Please check this and post the results.
In the HMI machine, to enter the product name, the source HMI and PLC use DB41.DBX90.0 as a string data type, not an integer or a Boolean.
However, I can enter tags other than strings in the DB into ignition.
This isn't the case for all tags. I'm having difficulty entering DB41.DBX90.0, a string data type, into ignition on the source Siemens S7300 PLC. The output from ignition is bad. Perhaps a correction is needed for my ignition tag.
Reread what @taglias posted.
If your HMI is putting characters directly into offset 90, then Ignition cannot read that address as a string. Ignition requires the two length prefix bytes of the S7 string format, and they must conform to the rest of the definition. (The second length byte specifies the max length of the string tag, and therefore must contain exactly 18 in your case.)
2 Likes
this is the result of the tag
