Pointer to Array inside structure

zigsmund

Member
Join Date
Nov 2016
Location
hgf
Posts
1
Hello,

I'm still fresh in plc programming so I have still many questions to answer. I searched forum/web for similar topic but i didn't anything similar.
Currently I'm working on project where i need to display a different messages on led display so i created a DB where i saved more preconfigured text(ARRAY) and its length(INT). (see pictures)

In OB1 I call my FB for sending/receiving text to/from LED display with some logic and FC5/FC6 (AG_SEND/AG_RECEIVE) inside. In FB I would like to add a input parameter (probably any pointer) which points to structure message ("TEXT_DB".MSG_12). Inside fb I would then like to modify pointer so it would points on my text("TEXT_DB".MSG_12.TEXT [1..15]) and add another pointer to points on length parameter ("TEXT_DB".MSG_12.TXT_LEN).
I now how to get a DB number, quantity, etc. from a pointer. But I don't know how to get an offset inside DB(Byte,Bits) of a pointer.
Is my request even possible, and if, how could i achieve that? All ideas are welcome.

db.jpg db2.jpg
 

Similar Topics

Not sure if this is possible but thought I would put it out there. Using Rockwell Studio 5000, is it possible to shift the address of an array...
Replies
7
Views
2,048
Must modify / expand a program which is made with a many block move (SFC20) as shown in the attached image. It moves data between array of...
Replies
13
Views
13,971
Hi! I modified some code, probably from member LD, to make a function element := ReadFromArray(firstElement : ANY, offset : INT) It seems...
Replies
2
Views
4,149
Hi all....... someone knows if is possible in S7, using the indirect adressing by means of a pointer L P## to read a data struct defined as...
Replies
5
Views
3,709
hi all, i have a pointer in a db in a char array? how to access the data pointed to. thnx
Replies
8
Views
2,225
Back
Top Bottom