Siemens S7, DT

tomhelliwell

Member
Join Date
Feb 2008
Location
Sheffield
Posts
25
Hi All,
I have a problem with Siemens S7, I have created a FC that generates a DT. The problem is I can't seem to fugure out how to return the DT.

I have attached a Screenshot to show what I mean.

Thanks

Tom

Untitled.jpg
 
Indirect addressing required. Add the following code to the end of your block, and add "outdb" as an INT to your temp area.

Code:
      L     P##DTOUT
      LAR2  
      L     W [AR2,P#0.0]
      T     #outdb
      L     D [AR2,P#2.0]
      LAR2  
      OPN   DB [#outdb]
      LAR1  P##DT_1
      L     D [AR1,P#0.0]
      L     D [AR1,P#4.0]
      T     D [AR2,P#4.0]
      TAK   
      T     D [AR2,P#0.0]
 
I think that "DT" is just a shorter way to write DATE_AND_TIME.
Create a variable in a global DB with type DATE_AND_TIME.
Your BLKMOV can then point to the variable. Just type the symbolic name, i.e. "MyDB".My_DT_var
 
@L D[AR2,P#0.0]

You also need to check that outdb is not zero, and when it is, not open the db! And that when di is accesed you need to use opn di or replace the di address marker with the one for a db!
 
Last edited:
And that when di is accesed you need to use opn di or replace the di address marker with the one for a db!

No. A DT data type parameter is passed to an FC as a DB pointer. Even if the calling block is an FB and the DT is in the STAT area, the db pointer passed will contain a global DB number and the absolute address of the STAT variable.
 

Similar Topics

Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
2
Views
19
Good morning fellow sea captains and wizards, I am being asked to do the above and obtain 4 values from each slave, I know about the MRX and MWX...
Replies
26
Views
308
Hi everyone, I am an omron plc tec , lately I came across a siemens s7 200 cn plc . Can someone help me regarding the software required and...
Replies
26
Views
471
This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
117
Hi, I have PLC S7-1200 and switch XC-208 and Iam trying to implement this SNMP library: SIOS I am not sure, what I am doing wrong, but there is...
Replies
3
Views
123
Back
Top Bottom