How to route pointer ???

naturephoenix

Member
Join Date
Jan 2015
Location
Vienn
Posts
181
I'm working with s7-1200

There are some FB which have input parameter pointer to some area.
For example: P#DB300.DBX0.0 WORD 2

This is usually input to communications functions and it indicates where to store data or from where to take.

What I'm trying is that this "P#DB300.DBX0.0 WORD 2" is stored inside some variable so I can change it according other inputs to my functions. For example if one of the inputs to my function is number 5(INT) and that should mean in my function P#DB300.DBX0.0 WORD 7 or P#DB305.DBX0.0 WORD 2 how can I get this (P#DB300.DBX0.0 WORD 7 or P#DB305.DBX0.0 WORD 2) from P#DB300.DBX0.0 WORD 2 if my input is INT 5.

Help inside SCL or FBD, STL is welcome
 
So what I'm trying is to change input parameter of communication function.
Input parameter is TYPE ANY and it indicates where I should stored data from a communication function.
I'm trying this to make in SCL.
My Try No. 1
I have made a function and inside structure like ANY data type. (10 BYTES) . These bytes are stored inside some new DB500(DB consists of 10 BYTES)
I'm changing values inside these 10BYTES according to my needs.
If I place this DB500(DB consists of 10 BYTES)[not ANY pointer as input parameter, just DB as input parameter] as input parameter to my communication function will I get what I want? I want that communication block store data not inside my DB500(DB consists of 10 BYTES) .
I want to store data on the place where values(10 bytes inside DB) inside DB500 indicates.
My Try No.2
I've made instance DB and inside is just one ANY pointer.(DB250.MYANYPOINTER) I fill this ANY pointer inside another function, when I look online always ANY pointer value is P#0.0 VOID 0 even I fill all bytes with other values.
If I place DB250.MYANYPOINTER as input parameter of my communication function will communication function store or at least try to store data depending on value of DB250.MYANYPOINTER. So inside DB250.MYANYPOINTER is value P#DB100. DBX0.0 BYTE 10 and I want that communication function stores data on that place not on DB250.DBX 0.0
 
Last edited:
You need to construct any variable inside of FC block or if you use FB then you need construct anypointer variable, which you later move to any (temp) variable before block. (This was case on step7 5.5)

L D have maked example of that
http://www.plctalk.com/qanda/showthread.php?p=617261


But there is working sample of scalable modbus program for 1500, if you change CPU model to your 1200 on project, is there any other modifications even needed?
https://support.industry.siemens.co...-using-the-modbus-rtu-protocol?dti=0&lc=en-BR
 
Last edited:

Similar Topics

Good afternoon, I have multiple prox cables about 20 feet away from my electrical cabinet. I found these wiring blocks that I can mount close to...
Replies
6
Views
1,817
TwinCat3 Beckhoff "Add route to remote system failed ADS Error 1804 (0x70C)" Hi everyone, I have a problem connecting with a Beckhoff CX5120...
Replies
4
Views
40,399
Hi Guys, I am having a hard time setting up the route path. Devices been used: PLC-5/80 Node 24 Channel A Backplane...
Replies
5
Views
1,791
Can someone help me with a installation manual for a ROUTE Model 2550 scale controller or a link to a site.
Replies
0
Views
1,288
I need help establish the communications path from a control logixPLC (L63)via a DHRIO module,portA (DH+) through a KA5 module onto a DH Network...
Replies
0
Views
1,343
Back
Top Bottom