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,672
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,850
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,762
OK. You guys helped me out a bunch with my first Siemens question. I found a bunch of issues with integrity checking the PLC programs I was...
Replies
3
Views
104
Hi, I have a 1214 on ip 192.168.0.100. This is connected to other modules through a switch on same network. I need to connect this to a company...
Replies
1
Views
95
Back
Top Bottom