![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
![]() Join Date: May 2004
Posts: 2
|
Hello,
I'm trying to read/write String to S7 315 2 DP using the W95_S7.DLL I've no problem with CHAR, REAL, INT, BOOL datatypes, but require information about the Siemens STRING type. When you declare a STRING[10] in the PLC, and have a look to the hexa bytes, you find 12 bytes : - 2 bytes : length and probably something else - 10 bytes : then 10 characters, one character per byte. Of course, to be able to write correctly a STRING in the Siemens structure, I need to know the structure of the 2 first bytes. Can somebody give me that information ? Thanks, Michel. |
|
|
|
#2 |
|
Member
![]() Join Date: Mar 2004
Location: .
Posts: 1,137
|
Michel,
This is the IEC1131 definition of a STRING data type. The first two bytes are always used to hold - i) the maximum length of the STRING when it was declared ii) the number of valid characters currently in the STRING Regards, Ken M |
|
|
|
#3 |
|
Member
![]() Join Date: May 2004
Posts: 2
|
Jackpot
Hello,
According to your advice, I just try to understand some STRING[10] readed from the PLC and ... of course that's it. Thanks a lot for your very very quick help, Michel. |
|
|
|
#4 |
|
Member
![]() Join Date: Jul 2005
Location: germany
Posts: 1
|
hi,
first byte is the reserved length (declaration in S7) and second is then length of the actual string. |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Topics
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| S7 PLC protocol | rkorem | LIVE PLC Questions And Answers | 12 | March 18th, 2005 02:53 AM |
| S7 200 PLC, sensor output... | NewPLCuser | LIVE PLC Questions And Answers | 3 | February 14th, 2005 11:01 AM |
| Problem with S7 STRING to REAL conversion | RMA | LIVE PLC Questions And Answers | 55 | October 4th, 2004 09:51 PM |
| Siemens S7 300 | sparky64 | LIVE PLC Questions And Answers | 3 | May 5th, 2003 03:50 AM |
| asi,profibus and mpi communication in s7 | manjit | LIVE PLC Questions And Answers | 1 | June 27th, 2002 09:21 AM |