String data type for recording data

spandy16

Member
Join Date
Dec 2012
Location
Germany
Posts
58
I am using a IO_LINK CALL FB for reading data from sensor and when I record the Vendor ID or Name in String datatype I get the first two characters missing. I know that it's because of the string datatype. But then how to address the Record area so that I get the full text displayed.
 
I have no idea what is the problem or what it is you must achieve or how you have done it.
But I am taking a guess that your problem has to do with that for STRINGs the values in the two first bytes represent the reserved number of characters and the actually used number of characters.
Depending on what you want to do, you have to start reading the content of the STRING from the 3rd byte.
 
I have no idea what is the problem or what it is you must achieve or how you have done it.
But I am taking a guess that your problem has to do with that for STRINGs the values in the two first bytes represent the reserved number of characters and the actually used number of characters.
Depending on what you want to do, you have to start reading the content of the STRING from the 3rd byte.
yes you are true..that I need to read to 3rd byte so that the whole information is displayed. I am sorry for not displaying screenshots as I work on a different station and there is no internet connectivity there.

I have made for e.g. a Output var "Record1" with string type. Then in my FB there is a field 'RECORD_IOL_DATA' and there I wrote "Record1". So when I observe the values in watch table I get first two char in the string clipped. So I wanted an easy solution for this.
 
Not sure what you mean by 'clipped'.

Anyway, you cannot observe a STRING in a VAT. So I am not sure what you are doing.
But you can observe a series of CHARs. Just be aware to start from the 3rd byte.
 
Not sure what you mean by 'clipped'.

Anyway, you cannot observe a STRING in a VAT. So I am not sure what you are doing.
But you can observe a series of CHARs. Just be aware to start from the 3rd byte.
By 'clipped' I meant that... If the sensor vendorname is 'ABC AG' and by calling the FB with index specific to vendorname, I get a result 'C AG'. I hope you get what I mean.

And about observing the string I meant that I wanted the sensor vendorname to be displayed in my HMI interface.

I might be wrong here trying to write the data to a datatype STRING. But with chars everytime I have to transfer it to a variable so that I can display the result in the output field in HMI. And it's not just one information I want. It's like more than 20 different parameters which I want to read.
 

Similar Topics

I am needing to transfer some prod_cons tags where the data type is a string[10]. Can you move a String data type? Thanks in advance RM
Replies
18
Views
3,512
Hello guys, i want to use string data type in plc m221 by Schneider electric. to transmit data from software scada expert vijeo citect to plc...
Replies
0
Views
2,448
Good Morning , I'm trying to move a total for a dose into a dose history. I'm able to get my totals to move just fine. I would also like to...
Replies
6
Views
2,433
Hello all, I need help creating a string. The PLC is an A/B L-55 logix controller. The controller receives data from a Sick bar code reader in...
Replies
2
Views
4,249
Hi is it possible to use strings as in/out parameters for an FC block in S7. i am trying to make an FC that searches for a specific code in a...
Replies
2
Views
3,668
Back
Top Bottom