S7: DATE_AND_TIME and ANY pointer

jormaga

Member
Join Date
Sep 2010
Location
Madrid
Posts
9
Hi everyone!

First of all, I'll introduce myself. I'm new to this forum and work as an engineer in Spain. I'll hope I'll be able to help and be helped in this exciting field.

My question is the following:

When I call the FC6 (DT to DATE) the FC expects a DATE_AND_TIME parameter as input. Would it be possible to assign an ANY pointer to do this?

For example:

CALL "DT to DATE"
IN := P#DB1.DBX 10.0 DT 1
RET_VAL := DB1.DBW 1

I previously declared this variable in the DB as DATE_AND_TIME. I've already tried it and get an error, but I don't know if there's a way to do it.

Thanks in advance!

PD: btw sorry because of my probable not-accurate english due to the fact that i'm not a native speaker
 
When I call the FC6 (DT to DATE) the FC expects a DATE_AND_TIME parameter as input. Would it be possible to assign an ANY pointer to do this?

For example:

CALL "DT to DATE"
IN := P#DB1.DBX 10.0 DT 1
RET_VAL := DB1.DBW 1


No.
 
Your problem is probably caused by the fact that you have created the entry in the DB whilst the calling block is still open. Close down all the blocks and then open the calling block again and this time it will work.

fc6009.JPG
 
Sorry I didn't explain it correctly. Here's the new explanation:

I've got in DB1 this declaration:
0.0 YEAR BYTE
1.0 MONTH BYTE
2.0 DAY BYTE
3.0 HOUR BYTE
4.0 MINUTE BYTE
5.0 SECOND BYTE
6.0 MS BYTE
7.0 MS_DAY BYTE

(I declared 8 bytes separately in the same structure as the DATE_AND_TIME format).

What I want to do is to call FC6 with this data declared in DB1. Is there a way to tell the compiler that group of information (DB1.DBB0 to DB1.DBB7) is a DT? (Like casting in other high-level languages like C).

Something like:

CALL "DT to DATE"
IN := // HERE I DON'T KNOW WHAT TO USE...
RET_VAL := DB1.DBW 20

A simpler way to me is to copy each byte in a already declared DATE_AND_TIME variable, but I just wanted to know if there are any other possibilities.

Thanks!
 

Similar Topics

From the Red Lion website, after some customer enquiries in the last week or so... Rev. March 25, 2024 [18:30] Just thought it might help a...
Replies
9
Views
277
How do you install update on Red Lion Crimson ver 3.1. Do I just need to run the exe file on the host server?
Replies
1
Views
106
Has anyone found a way to convert/replace/update the firmware on old Parker TS80xx series HMIs (i.e. TS8010, TS8006, etc) to accept Crimson...
Replies
0
Views
90
Hello, I have an automation direct d2 262 plc and C-more HMI EA9T6CL-R. I need to prepare a program, scheduled to be performed on a future date. I...
Replies
1
Views
117
Hi All, we've recently upgraded from FTView SE v10 to v12. Since the upgrade we've been having a problem where the HMI is slow to update tags in...
Replies
0
Views
87
Back
Top Bottom