Siemens S7 Strings

cjd1965

Lifetime Supporting Member
Join Date
Apr 2007
Location
UK
Posts
1,659
Hi
I have a task whereby I have a DB which is a list of strings which are defined as STRING[25] and there are 100 strings.

I wish to be able to copy 2 strings based on the 'row' within the DB into a totally seperate DB which will display them onto the HMI

ie if i had ints 1 and 6 this would copy string 1 and string 6 into the other db into slots 1 and 2

I am thinking i will need a pointer to do this and am uncertain how to proceed
 
If possible use SCL, this makes it a lot easier...
Else you can make a function which uses 2 pointers (source and destination) to copy the strings with the blkmov function (SFC20).
There are a lot of threads about pointers...
 
See example code attached. To make it easier to test, I've created a DB with the source strings in it, and another DB of the same size to contain the destination strings. You can copy any source string number into any destination string number.

Open the blocks folder online and then open DB6 to view the strings that have been copied.
 
Thanks for your input. I think i will be abl to chop it slightly to suit my purposes.

I dont think i am going to break my neck over pointers because i have been told the new s7 software due at the end of the year wont support stl at all (IEC only)

Cheers
 

Similar Topics

I have a Function Block, FB10, with IN_OUT variables of type string called MyString1 and MyString2. I want to copy MyString1 to MyString2 and...
Replies
11
Views
10,731
Hi I have been using Siemens S7 317 PLC's for quite a while but this is the first time i've had to do anything with strings. I basically need to...
Replies
21
Views
13,919
So, my problem is I have a DB of 4 strings of 254 bytes (total of 1024). I need to clear them every cycle (sorta like a buffer I guess). I tried...
Replies
3
Views
1,787
I have never had the pleasure of working with a "Thermistor" until now and have a question. The Thermistor is a 10KOhm 4-20mA 2-wire device and I...
Replies
2
Views
57
Hello, I have a CPU 317-2DP Firmware Version V2.1.8. In TIA Portal only V2.6 is available, and there is no option to upgrade FW. Then I open it...
Replies
9
Views
174
Back
Top Bottom