S7 reading data array using pointer L P##......

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 Array of ten words of INT??

Thanks in advance
 
Here's some example processing. You can pass the array to an FC as an array (the size/type must match) or by pointer - the processing inside the FC is the same as arrays are actually passed by pointer as well.
 
I dont' know if is possible, but I'd like read in local variable STAT a data STRUCT call eg.: ALPHA.
This struct contains simple variables [BOOL,BYTE,STRING,INT etc. etc.]and also anothers STRUCT call eg.: BRAVO.
The struct BRAVO contains a data DINT call CHARLIE and DATA ARRAY [0..10] of INT call DELTA.

Well, If try to do

L P##ALPHA.BRAVO.CHARLIE there isn't problem

but if try

L P##ALPHA.BRAVO.DELTA the command is not accepted.

I know If define the pointer with the starting address of the STRUCT ALPHA and ADD the offset of the variables there isn't problem.

But for me in this way loses completely the advantages of use the data STRUCT.
 
As you have found out you cannot load a pointer to an element of a structure. You have to write an FC that you pass a pointer to the element of the strucure and the FC extracts the area pointer for you. See the FB in the example attached.
 

Similar Topics

Hello, I don't have much experience with Pro-face products, so I have a few questions. I have an AGP3300-S1-D24-CA1M HMI connected to five...
2
Replies
260
Views
Hello everyone, I’m not looking for a full lesson—I’m currently enrolled in a modular PLC training course and may be getting a bit ahead of...
2
Replies
355
Views
Hey Guys I’m currently setting up a CIP Data Table Read using a MSG instruction between two PLCs. All configurations have been checked and...
3
Replies
575
Views
Hi everyone, I’m working on integrating a Cognex In-Sight IS3805 camera into a Rockwell PLC (ControlLogix, using Studio 5000), and I'm trying to...
0
Replies
795
Views
Hello everyone. I have been trying to read real data type variables from an Allen Bradlley Micro 850 PLC using an **** Flexy 205 gateway without...
6
Replies
1,878
Views
Top