Accessing Time_Of_Day in DB5

Pedro64

Member
Join Date
Oct 2005
Location
Birmingham
Posts
10
This has been bugging me for a few days now so i hope you experts can piont me in the right direction. I need to compare the hours and minutes to the time stored in DB5. Its stored at 8.0. I've tried L DB5.DBD8 which accesses the TOD, but i'm having trouble getting the HOURS and Minutes. I've tried Move LB0 and then did a BCDI on it and moved it to MW310, but i never get the right answer back is it i'm using the wrong data type. If you can post the code to extract the hours and minutes from TOD in DB5 8.0 then i would be grateful.
 
The Time of day data type stores the time of day as a number of milliseconds. You have to 'work out' the hours and minutes yourself. Can you use the Date_and_Time data type instead ?
 
I assume its in the program somewhere already. Its just that when monitoring DB5 i saw the TOD and date displayed there and thought i could access it. FB5 is a protected block called 'Clock' that is called from 0B1. I'm assuming it's done in there. You must be able to access it some how? Also in DB5 are strings for Hours Mins Secs etc used i presume for the date time stamp of the components coming off the line. I have another look and let you know. At least now i know what format TOD is in. Thanks for your help.

Pete.
 
Found another fb where they reconstructed the date and time back to date_and_time format, but to be honest it was easier to just call the read clock (sfc1) function and use lb3 mov lw24 then lw24 bcd_i as someone posted in the clock.zip. My problem now is i can put the answers in mw310 to mw314, hours, mins and secs and read them ok, but i wanted to transfer them to my db99 to store them. If i set up the db99 to hold the values as int, when i try to ouput the answer from bcd_i to the db it says it's the wrong type again. I've tried db99.dbd18, db99.dbw18 and db99.dbb18 to no avail, any ideas?

Pete.
 
If I enter a network with just the BCD_I element, I can enter DB900.DBW0 as the out variable. DB900 does not exist in my project.

The statement list is as follows:
Code:
L W#16#0
BTI
T DB900.DBW0
NOP

Can you do the same ?
 
i've tried what you said in an example at home and it worked. I don't have the project with me at the moment. I'll try it next Wednesday and let you know.

Thanks

Pete.
 

Similar Topics

Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
158
For the past few day, I have had problems accessing the Rockwell Knowledgebase. When I try to access it (and I do have a TechConnect Support...
Replies
7
Views
402
Hi, Small issue i've really been beating myself up over today. I've been working with Panelview panels for years. Currently working on an older...
Replies
1
Views
589
Dear experts, I have the following setup: CPU-313C (6ES7313-5BF03-0AB0 V2.6) + CP343-1 (6GK7343-1EX30-0XE0 V2.0) communicating with Siemens PC...
Replies
7
Views
2,690
I'm looking to replace an AB PanelView 600 2711-K6C2 HMI with a C-more EA9-T10WCL. The PLC in the system is a SLC 5/03, which is staying. I...
Replies
2
Views
1,245
Back
Top Bottom