Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

System time in vxWorks

1,054 views
Skip to first unread message

Nagaveni

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to
This is a multi-part message in MIME format.
--------------389D924480CFFEFADAC1687A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi All,
how can I get the system time and date in vxWorks on a PC-486 target?

Thanks in advance,
Veni.

--------------389D924480CFFEFADAC1687A
Content-Type: text/x-vcard; charset=us-ascii;
name="Nagaveni.Srikanth.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Nagaveni
Content-Disposition: attachment;
filename="Nagaveni.Srikanth.vcf"

begin:vcard
n:Srikanth;Nagaveni
tel;work:0091-80-5722296
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:Nagaveni...@wipro.com ; ksn...@wipinfo.soft.net
fn:Nagaveni Srikanth
end:vcard

--------------389D924480CFFEFADAC1687A--


Abhijit Lahiri

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to
>
> Hi All,
> how can I get the system time and date in vxWorks on a PC-486 target?

All the time routines for VxWorks are provided by the ansiTime Lib.

Subroutines like time(), localtime etc. will give what you want. Have
a look at ansiTime library in VxWorks
reference Guide.


regards,

abhijit

Girish V Gulawani

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to
> how can I get the system time and date in vxWorks on a PC-486 target?

pl refer ansiTime or search for a specific rtc chip driver.


Jaya Prakash M

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to

Refer clockLib and time related functions of VxWorks first...
Time ??? RTC or dedicated Chip ???....
Any way go thru the piece of code below:

/* Check out the structures for timespec and tm*/

...............
.............

printf("\n\nEnter the Date and Time (24Hr Format) :mm/dd/yyyy hr::min:sec ->");
scanf("\n\n%d%d%d%d%d%d",&mm,&dd,&yyyy,&hr,&min,&sec);

/* initialize the tm structures */
......
..........


t1.tv_sec = mktime(&myStructTime); /* pointer to broken-down structure */
t1.tv_nsec = 0L;
tRes = clock_settime(CLOCK_REALTIME,&t1);

printf("\n\n Clock Set Ok/Failure: %d",tRes);

if(clock_gettime(CLOCK_REALTIME,&t1)==OK)
{
printf("\n\n%ld",t1.tv_sec);
printf("\n\n%s",ctime (&(t1.tv_sec)));

}


Good Luck...???

Regards,
JP & ARP


Mario Semo

unread,
Jan 26, 2000, 3:00:00 AM1/26/00
to
Hello,

PMFJI, but what means "enter date/time" ?

He asked for a 486 PC (and thats what i have to) and this PC has a real time
clock. Doesnt VxWorks support this 486 PC HW? i want to be able to boot my
PC and then asked the PC for the current date/time. not he should ask ME.
i am confused.


--
regards, Mario Semo. http://www.kirchnersoft.com
Jaya Prakash M wrote in message <86h8qq$6s...@overload.lbl.gov>...

Mario Semo

unread,
Jan 26, 2000, 3:00:00 AM1/26/00
to

Mario Semo

unread,
Jan 26, 2000, 3:00:00 AM1/26/00
to

Frank Minich

unread,
Jan 26, 2000, 3:00:00 AM1/26/00
to
Mario Semo wrote:
> i am confused.

The PC has a time of day clock, which maintains and continues
to update its 'time of day' even across PC power cycles. As
VxWorks boots, it should obtain the current time from the time
of day clock and jam it into VxWorks' clock. I don't think
this happens automatically in VxWorks 5.3.

Further, if you never boot the PC to DOS or Windows, you will
probably want some way to update the PC's time of day clock
from the VxWorks shell.

If I remember correctly (it's been a while), the TOD clock is
accessed in a manner similar to that of the PC's CMOS.

Regards,
Frank.

Mario Semo

unread,
Jan 27, 2000, 3:00:00 AM1/27/00
to

--
regards, Mario Semo. http://www.kirchnersoft.com

Frank Minich wrote in message <388F4B...@ti.com>...


>Mario Semo wrote:
>> i am confused.
>
>The PC has a time of day clock, which maintains and continues
>to update its 'time of day' even across PC power cycles. As
>VxWorks boots, it should obtain the current time from the time
>of day clock and jam it into VxWorks' clock. I don't think
>this happens automatically in VxWorks 5.3.

i use T2, so i have 5.4. but as it looks to me, it doesnt happen here too.
o, i really have to tell vxWorks the current TimeAndDate? is there no way to
automatically initialize the TAD from the RTC in the CMOS ?


Tyler, Paul A (DBY)

unread,
Jan 28, 2000, 3:00:00 AM1/28/00
to
VxWorks does not not automatically read the battery backed real time clock.
After all, in many embedded applications time of year does not matter.

I found a WindSurf article (I have lost the reference) which included a
description of the registers in the PC's CMOS (Motorola MC146818 or
equivalent)

I have an application which will read the clock based on that article I can
share.


VxWorks, Tornado

Paul Tyler
Measurement Systems Specialist
Electronics & Measurement Systems Dept.
Rolls-Royce plc.

e-mail Paul.A...@Rolls-Royce.com
Tel. +44 (1332) 247808
Fax. +44 (1332) 247928


Frank Minich <fmi...@ti.com> wrote in message
news:<388F4B...@ti.com>...


> Mario Semo wrote:
> > i am confused.
>
> The PC has a time of day clock, which maintains and continues
> to update its 'time of day' even across PC power cycles. As
> VxWorks boots, it should obtain the current time from the time
> of day clock and jam it into VxWorks' clock. I don't think
> this happens automatically in VxWorks 5.3.
>

0 new messages