You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old May 27th, 2004, 07:40 AM   #1
michelv
Member
Belgium

michelv is offline
 
Join Date: May 2004
Posts: 2
Question Prodave MPI Windows - PLC S7 300 - String

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.
  Reply With Quote
Old May 27th, 2004, 07:46 AM   #2
Ken M
Member
Scotland

Ken M is offline
 
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
  Reply With Quote
Old May 27th, 2004, 07:57 AM   #3
michelv
Member
Belgium

michelv is offline
 
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.
  Reply With Quote
Old July 7th, 2005, 12:32 PM   #4
nineball
Member
Germany

nineball is offline
 
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.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 06:09 AM.


.