Problem reading string using IBH S7 Link (mpi to ethernet) using IBH OPC Server

islman1975

Member
Join Date
Jan 2005
Posts
16
I'm attempting to read some strings from a S7 300 PLC over ethernet. I'm using a IBH S7 Link mpi to ethernet converter and then use IBH OPC server to read write data from Wonderware. I use the following method of adddressing for a string DB100.DBT0[20]. I appear to get two square characters when the string is null and then two square characters infront of any string data which is in the string. Any ideas. I think i'm just going to remove the squares in scripting.
 
Last edited:
The two first bytes of an S7 string contains the max length and the actual length.
There is probably something else than a "square character" in these two bytes. You must evaluate the bytes as 0-255 in hex (00h-FFh).
I also think you have to check at least the actual length. You probably have to discard the unused part of the reserved string. Otherwise your string will contain partial garbage.
 
So am I thinking correctly if I change my start address to start two bytes after the current start address and knock two bytes of my length i wont have to do any string manipulation in scrtipting. The first parameter after the T is the start address of the string and the parameter in the brackets is the length.
 
I think that will work OK.
I just wonder if you f.ex. write "1111111" into the string, and later you write "222" into the same string. Then if you read the whole lenght without checking for the actually used length, you will get "2221111".
If the string always have the same length it doesnt matter I guess.
 
The string wil probably be of different lengths. I'll have to do some testing when I'm on site next to see which method will work. Thanks for the help.
 

Similar Topics

I have this control IO port on a machine panle. I know a little of reading electrical diagrams. Could some friend help me about it. I can not...
Replies
5
Views
2,451
Hello everyone, this is my first time asking for help here, so please bear with any problem my english or lack of experience can cause. i have a...
Replies
3
Views
2,670
Hi im trying to read/write from excel-rslogix. Sometimes works correctly but other times doesnt work and in excel cells i reg #DIV/0! or REF. I...
Replies
0
Views
1,339
Hello, I faced a problem related with a PLC tsx1720 which appears unresolvable.Even tough,I can manage to connect to it,I am not able to read out...
Replies
4
Views
1,797
Hi there everyone, I`m currently working on a Toshiba drive with ASD-G9ETH communication card on it, this drive is linked on our network. So...
Replies
3
Views
2,802
Back
Top Bottom