SFC52 Any Data Type Pointer

CliveBaker

Member
Join Date
Sep 2005
Location
Midlands
Posts
83
HI All,

I am trying to set up a FB to pass details to to get Simocode data records 92, 94 amd 95. I have 30 motors to read.

I can get it to work ok it it is hard coded but I want to pass variables to the FB.
This is what I have in the FB

CALL "RDREC" , DB10
REQ :=#RD_REC
ID :=#RD_Addr
INDEX :=#RD_Indx
MLEN :=#RD_MLen
VALID :=#RD_Valid
BUSY :=#RD_Busy
ERROR :=#RD_Error
STATUS:=#RD_Status
LEN :=#RD_Len
RECORD:=P#M 20.0 BYTE 32

My Question Is how do I pass the RECORD:
 
Here's an example where the record is created at run time - you have to provide the processing to set up the record to point to different areas according to the motor etc. I'd suggest using a global DB


record008.JPG
 
Thanks for that but CAn you please explain the Load and Transfer sections, I am new to this.

I think understand but need some confermation.

Cheers
Clive
 
If you use Help from Simatic manager (not the editor) and search for "any pointer" you can read about the format. The load/transfers are setting up the any pointer according to this format.

any0011.JPG
 
CliveBaker said:
Thanks for that but CAn you please explain the Load and Transfer sections, I am new to this.

I think understand but need some confermation.

Cheers
Clive

L #Data = Load Data into accumulator area
T #Data = Transfer value held in accumulator into the variable Data.
 
May be I am not explaining myself very well.

What I am trying to do is retrieve data records from the simocode.
I have several drives that i need to do this for so I thought I would write a FB to do it.
I can get it to work using OB1

A "True"
= L 22.0
BLD 103
CALL "RDREC" , DB10
REQ :=L22.0
ID :=DW#16#7FE
INDEX :=92
MLEN :=32
VALID :=M0.2
BUSY :=M0.3
ERROR :=M0.4
STATUS:=MD2
LEN :=MW10
RECORD:=P#M 20.0 BYTE 32
NOP 0
(This is the STL version of the Ladder)
The records I need to retrieve have different lenghts, 32, 61 and 69 bytes.

My FB contains

LAR1 P##MyRecord
L W#16#1002
T W [AR1,P#0.0]
L #iNumberOfBytes
T W [AR1,P#2.0]
L #dbNumber
T W [AR1,P#4.0]
L #dwAreaPtr
T D [AR1,P#6.0]
as per above however
I get this with thw call

A #bReadEnable
= L 2.0
BLD 103
CALL "RDREC" , DB10
REQ :=L2.0
ID :=#dwID
INDEX :=#iIndex
MLEN :=
VALID :=
BUSY :=
ERROR :=
STATUS:=
LEN :=
RECORD:= #MyRecord - this is in red
NOP 0
The ID and Index variables are the passsed data.

Am i correct in thinking that the record in DB10 holds the any pointer info for the area for the read data to go.


I think I am trying to hard and may end up hard coding all 24 drives as I am running out of time.

So any help would be good.
 
Got it all working now on port 2 (DP1) however I need to getit to work on a 342-5 so my question is how do I address the individual simocode, dp-read will read the network and populate the db for the cyclic data, but I need to read acyclic via sfb 52 so I need the ID.
 

Similar Topics

Hi everyone, I have a 505 workshop program with PLC type of 555- 1106 and I was wondering how can I download the data documentation window as a...
Replies
3
Views
65
Hello everybody, I'm currently working on a project where I need to implement an IoT platform based on Microsoft Azure Cloud. Communication is...
Replies
2
Views
65
Hello. I have a db which is 1000 INT, and this db is represented in WinCC as a raw data type set of 5x 400 Bytes. This set is read with a script...
Replies
1
Views
79
So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
67
Hello I have a s7-1200 and I would like to read the tags present in this controller with my controllogix controller. The two controllers don't use...
Replies
5
Views
179
Back
Top Bottom