[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 49.910::kav30

Title:VAX on VMEbus: KAV30
Notice:Could have been as fast as 68K but its a VAX!
Moderator:CSSVMS::KAV30_SUPP
Created:Thu Apr 18 1991
Last Modified:Fri Aug 02 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:159
Total number of notes:645

145.0. "Compatibility problem with KAV$RTC" by TRN02::BRIATORE () Tue Dec 06 1994 12:07

I've a problem with a KAV30 call (KAV$RTC).
I've used succesfully the aforemontioned call with ELN V4.3.
Now, modifying the icludes files and link libraries ,
according with the release notes for ELN V4.4, I have a run-time
error stating: 

                   "KAV_BAD_PARAMETER"

Is there any uncompatibility between this call in version 4.3 and
the same call in version 4.4 ? (found no mention of this in release notes
for 4.3) 

Thanks in advance

						    Riki
T.RTitleUserPersonal
Name
DateLines
145.1... no changes have been made...EICMFG::KAV30_SUPPTue Dec 06 1994 17:3418
    Hi Riki,
    
    I'm not aware of any change, nevertheless there were some 'leap year'
    problems with KAV$RTC and KAV$TIMERS which have been corrected between
    4.3 and 4.4, but the code path which generates 'BAD_PARAM' was not
    touched...
    
    After changing include files and link libraries you have compiled,
    linked and ebuild' a new system, correct ?
    
    Please check your code according to the Programmers guide V1.1 - if the
    problem persists, send us a code example and we will test it in the
    lab. Thats the only thing I can offer you at the moment...
    
    best regards,
    
    	Thomas
    
145.2fwiw: a test program using the kav$rtc call -works under 4.4,4.5ZYDECO::BODARealtime Expertise CenterTue Dec 13 1994 00:11208
Here is a test program I wrote a while back that uses the kav$rtc call to
set/check the rtc calendar/clock.  I just verified again that it works
under V4.5.

Regards,

Alan

-----------------------------------------------------------------------------
#module set_kav_time
/*                                                                            */
/*              COPYRIGHT �1994 DIGITAL EQUIPMENT CORPORATION                 */
/*                                                                            */
/*   THIS SOFTWARE MAY BE COPIED WITHOUT FEE PROVIDED THAT THE  COPIES  ARE   */
/*   NOT  MADE OR DISTRIBUTED FOR DIRECT COMMERCIAL ADVANTAGE,  THAT CREDIT   */
/*   TO THE SOURCE IS GIVEN AND THAT THIS ENTIRE COPYRIGHT NOTICE IS INCLUDED.*/
/*                                                                            */
/*   THE  INFORMATION  IN  THIS  SOFTWARE  SHOULD  NOT  BE  CONSTRUED  AS A   */
/*   COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.                             */
/*                                                                            */
/*   DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE,     */
/*   SUPPORT, OR RELIABILITY OF THIS SOFTWARE.  THIS SOFTWARE IS              */
/*   DISTRIBUTED "AS IS."                                                     */
/*                                                                            */
/*
**++
**  FACILITY:  SET_KAV_TIME
**
**  MODULE DESCRIPTION:
**
**	This program assures that the system time is set 
**	on a KAV30.
**
**  AUTHORS:
**
**      ATB
**
**  CREATION DATE:  15-JAN-1992
**
**  SYSTEM:  VAXELN V4.4, V4.5
**
**  DESIGN ISSUES:
**
**      This program checks to see if the KAV30 Real Time Calendar Clock
**	(RTC) has been set.  If not, it prompts at the display for the current
**	time. It then sets both the RTC as well as the VAX system time.  If the 
**	RTC has been set, the program checks to see if SYSTEM PARAMETER #1 
**	has been set such that the system time is automatically set at 
**	startup time.  If not, the VAX system time is set from the RTC time.
**	Please note that the rtVAX-300 (which the KAV30 uses), unlike other
**	CVAX-based cpu's (e.g., KA640, KA650), does not implement the TODR
**	register.
**
**
**  COMPILE AND LINK COMMANDS:
**	$set ver
**	$CC/debug/noopt/define=(VAXELN='p2') 'p1' + eln$:vaxelnc/lib
**	$link/debug/map 'p1' + eln$:crtlshare/lib + eln$:rtlshare/lib + -
**	 eln$:rtl/lib
**	$set nover
**
**  SAMPLE EBUILD .DAT FILE:
**	characteristic /remote_cli /shared_status /net_device=EZA -
**	/noserver /objects=1024 /io_region=1024 /target=37 
**	program SET_KAV_TIME /warm_debug 
**	device EZA /vector=%X130 /net_def
**	terminal CONSOLE /scope
**
**  MODIFICATION HISTORY:
**
**      15-JAN-1992  atb - created
**      28-JUL-1992  atb - minor change to sys param 1 check
**	13-APR-1994  sr  - updated for VAXELN V4.4, V4.5
**--
*/

/*
**
**  INCLUDE FILES
**
*/

#include $vaxelnc
#include descrip
#include stdio
#pragma inline (show_time)
#include $kernelmsg
#include chfdef
#include kavdef

#define BUFFER_LENGTH 100

    globalref ker$gl_system_parameter1;

    BOOLEAN good_time_string;    

main ()
{

    struct dsc$descriptor tstring;
    LARGE_INTEGER current_time;
    int status;
    unsigned long rtc_functions;
    unsigned char buffer[BUFFER_LENGTH];
    void dummy_ast();    
    void display_status();
    BOOLEAN check_time_error();


/*	 
**  Check to see if the RTC calendar/clock has ever been set.  A value
**  of KER$_TIME_NOT_SET will be returned if it hasn't.  Assume it hasn't
**  been set if any other value other than KER$_SUCCESS is returned as well.
*/	 
    rtc_functions = KAV$M_READ_CALENDAR;
    kav$rtc( &status,
             rtc_functions,
	     &buffer[0],
	     10,
             &dummy_ast,
             0 );
    if (status != KER$_SUCCESS) 
/*	 
**  The RTC time has never been set. Prompt for it and set both the RTC
**  time as well as the system time.
*/	 
    {

	for (;;)
	{
	    good_time_string = TRUE;
	    printf ("Enter the current time (e.g. DD-MMM-YYYY HH:MM:SS):  ");
	    fgets (buffer, sizeof buffer, stdin);
	    tstring.dsc$a_pointer = buffer;
	    tstring.dsc$w_length = strlen (buffer) - 1;
	    vaxc$establish (check_time_error);    
	    current_time = eln$time_value (&tstring);
	    vaxc$establish (0);    
	    if (good_time_string)
                break;
	}
	ker$set_time (NULL, &current_time);
	kav$set_clock( &status,
		       KAV$K_SET_RTC_TIME|KAV$M_RTC_24_HOUR );
    }
    else
/*	 
**  This path is needed only if the system parameter #1 bits 0..7 and bit 31 
**  have not been set.  If it is set, this allows the VAX system time to be 
**  set from the KAV30 calendar/clock automatically at startup.
*/	 
    {
	if ((0X800000FF & ker$gl_system_parameter1) != 0X800000FF)
	{
	    printf( "Setting system time from RTC.\n");
	    kav$set_clock( &status,
			   KAV$K_SET_VAX_TIME );
	}
	else
	    printf("System Time has been set during system initialization.\n");
    }
    ker$get_time (NULL, &current_time);
    show_time ("System time", &current_time);
}

/*
 * General purpose routine to convert a 64 bit time into a time string and
 *  display it with a meaningful identifier
 */
static int show_time (char *identifier, LARGE_INTEGER *mytime)
{
    char buffer [132];

    eln$time_string (buffer, mytime);
    printf ("%s = %.*s\n", identifier, ELN$K_TIME_STRING_SIZE, buffer);
}

/* This routine is never used but is needed for its address */
void dummy_ast()  
{
int i;
    i = 1234;
return;
}

/*	 
**  General status display utility.  Assumes message files are built in.
*/	 
void display_status(status)
long status;
{
    VARYING_STRING(255) stat_str;

    eln$get_status_text (status, 0, &stat_str);
    printf ("%.*s\n", stat_str.count, stat_str.data );
}

/*	 
**  Used for exception handling on the ELN$TIME_VALUE.
*/	 
BOOLEAN check_time_error(signal_ptr, mechanism_ptr)
    struct chf$signal_array *signal_ptr;
    struct chf$mech_array *mechanism_ptr;
{
    display_status( signal_ptr->chf$l_sig_name);
    good_time_string = FALSE;
    return ( TRUE );
}    
145.3thank you Alan!TRN02::BRIATORETue Dec 13 1994 17:0514
Hi Alan!

    Thank You for the test program. 
    I compiled it, linked ,ebuilded with the specified includes files, 
libraries and options and the resulting status of kav$rtc was "KAV_BAD_PARAM".
    I made the Boot File with Vaxeln 4.3 and it works correctly!

    Is possible a not correct installation of Vaxeln 4.4 ?!?

Regards,

    Riki

145.4problems with kav30 rtc continue!TRN02::BRIATORETue Dec 13 1994 17:2690
    
    Hi Thomas,

    my problem persists then I send you the following code.

    Best regards,

	Riki

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/**
**  $ cc rtc + eln$:vaxelnc/lib
**  $	link rtc + eln$:crtlshare/lib + eln$:rtlshare/lib + eln$:rtl/lib
**/

/***
**    characteristic /connect_time=300 /remote_cli /remote_term /norotate /net_device=EZA /objects=20000 /ports=200 -
**    /loader=20000 /separate_loading /p0_virtual_size=25600 /p1_virtual_size=4096 /io_region=10000 /interrupt_stack=1024 /target=24
**    characteristic /sys1_param=%X870000FF /sys2_param=%XA0006
**    node /lat=active
**    program RTC /warm_debug /kernel_stack=100 /message_limit=16 /job_priority=2
**    program ELN$:EDISPLAY.EXE /norun
**    device EZA /vector=%X130 /file=ELN$:EZDRIVER.EXE /net_def
***/

    
/* #include <eln$:$vaxelnc.h> */

#include descrip
#include stdio
#include <eln$:kavdef.h>

void	ast_routine();
int	ast_count;

main()
{
struct {
    unsigned short int val;
    unsigned char   mod;
}buffer;

int j,i,m,status;

printf("\n INIZIO PROVA ! \n");

buffer.val = 500;
buffer.mod = KAV$K_RTC_1MS;

KAV$RTC(&status,
	KAV$M_RTC_TMR_0 | KAV$M_LOAD_TMR_CNT,
	&buffer,
	3,
	&ast_routine,
	0);
printf("\n status load = %d \n",status);


KAV$RTC(&status,
	KAV$M_RTC_TMR_0 | KAV$M_START_TMR,
	&buffer,
	3,
	&ast_routine,
	0);
printf("\n status start = %d \n",status);

for (i=0;i<10000000;i++);
printf("\n status \n");
for (i=0;i<10000000;i++);
printf("\n status \n");


KAV$RTC(&status,
	KAV$M_RTC_TMR_0 | KAV$M_STOP_TMR,
	&buffer,
	3,
	&ast_routine,
	0);
printf("\n status = %d \n",status);
printf("\n end routine \n");
}


void ast_routine()
{
printf("\n\n\n\n\n AST ROUTINE !, CuCu! ");
return;
}


145.5re: .3 - Think I found your problem . . . check your target typeZYDECO::BODARealtime Expertise CenterWed Dec 14 1994 01:1649
Hi Riki,

Just to be thorough,  I recompiled,linked,built my program under V4.4.
Still worked fine:

	%VAXELN system initializing


    	    BODA's System


	Setting system time from RTC.
	System time = 13-DEC-1994 18:45:16.60

My compile and link were the same as yours (w/no options)
My EBUILD .dat:

characteristic /remote_cli /shared_status /net_device=EZA /noserver -
/objects=2048 /ports=1024 /jobs=48 -
/subprocesses=96 /loader=200 /separate_loading /p0_virtual_size=4096 -
/p1_virtual_size=1024 /io_region=2048 -
/interrupt_stack=20 /target=37
program ELN$:EDISPLAY /norun
program SET_KAV_TIME /warm_debug
device EZA /vector=%X130 /net_def
terminal CONSOLE /scope

Then I compared your .DAT file to mine.  Your .DAT file (in your program
comments) shows that you are using /target=24 which is the
rtVAX-300 cpu type rather than the KAV30 cpu type (/target=37).  If I 
remember correctly, under V4.3 the ELN$:300KER.EXE placed there by 
VAXELN was replaced by the KAV30 kernel.  Else one specified:

	EBUILD/KERNEL=<the kav30 kernel>

to pull in the correct KAV30 kernel.

When I built my system image with /target=24, upon reaching the RTC call,
I immediately took a fatal bugcheck.  The exception code was SYSTEM-F-OPCDEC
(opcode reserved to Digital).  This was to be expected.

Since you didn't get this fatal bugcheck, this tells me that you must be pulling
in perhaps an old KAV30 kernel.

As a test, EBUILD/MAP your V4.4 system image specifying the KAV30 target under
the target menu.  This will cause your .DAT file to have /target=37 and will
cause EBUILD to pull in the 3KVKER.EXE (check the map file to be sure.)

Alan
145.6re .5, make sure you are not using the KAV30 Toolkit any moreZYDECO::BODARealtime Expertise CenterWed Dec 14 1994 01:2611
Rikki,

Want to make sure . . . did you install the KAV30 Toolkit on VAXELN V4.4?

If you did, note that V4.4 of VAXELN bundled in support for the KAV30.
The KAV30 Toolkit is no longer needed. You will need to reinstall VAXELN 
V4.4 to get a clean installation.

If you didn't, nevermind :-{

Alan