Step 7 Strings Conversions

ThePortLion

Member
Join Date
Oct 2007
Location
Ireland
Posts
58
Hi guys

This is similar to a thread i had recently but i'll go anyway.
I have set up an s7 connection between two S7 317-2 Dp.
I am using the PUT function to perform the data transfer.

The problem is that PUT will not process STRING data types. I tried converting the STRING to DINT on one end and
reconverting it (DINT to STRING) on the other end but all i get is manure.

Is it possible to convert a string and recover it after a reconversion (relatively easily) in Step 7?
 
When you assign parameters to the PUT function, you specify where the string is in the DB, along with the length in bytes (this is known as an ANY pointer) and takes the form:

P#DB1.DBX10.0 BYTE 20

e.g. PUT will transfer 20 bytes from DB1 starting at byte 10

You can create the ANY pointer at run time if you wish.
 
Something like this : ?
Code:
      CALL  "PUT" , "PUT_DB"
       REQ   :=M0.0
       ID    :=W#16#1 // connection ID defined in NetPro
       DONE  :=M0.1
       ERROR :=M0.2
       STATUS:=MW10
       ADDR_1:=P#DB5.DBX 0.0 BYTE 42 // must be 2 bytes bigger than the STRING
       SD_1  :="MyStrings".string1 // string1 = STRING[40]
 

Similar Topics

Hi Guys. Our system is based on iFix and PLC 300/400. We recentle changed from using the Six driver from Proscada to Keepware server. After...
Replies
4
Views
2,096
I've done a search on this forums (and Siemens forums) trying to get my head around UDT's and strings. I found an example by Daniel Chartier...
Replies
12
Views
6,743
Hi, I will be scanning in a barcode. Here I will compare the scanned string against a table (DB) of known barcodes. Has anyone used FC10...
Replies
2
Views
4,474
hi everyone, is there a better way to display strings in S7? there is a piece of code that depending on program status copies one or another...
Replies
4
Views
8,386
I am having a step7 v5.4 program where the blocks are encrypted and locked. And the manufacturer is stopped the support. Is there any ways to...
Replies
2
Views
175
Back
Top Bottom