Jump to page titleUNITED STATES
hp.com home products and services support and drivers solutions how to buy
» contact hp

:

more options
 

hp.com home
End of Jump to page title
Simple PLI program using common TDMS calls
Jump to content



» 

business support center

Home & Home Office Support:
» HP branded products
» Presario branded products
» Services & Warranties
Small & Medium Business Support:
» Small & Medium Business products
» Small & Medium Business services
Support for IT Professionals:
» Enterprise products (IT Resource Center)
» NonStop enterprise products
» Business & IT Services
Content starts here
LAYERED PRODUCT or COMPONENT: TDMS, V1.7 PLI, V3.1         OP/SYS: VMS, V4.7

LAST TECHNICAL REVIEW: 19-MAY-1988 16:02

SOURCE: Technical Support Services Europe



OVERVIEW:

This example is written to show how to write a PLI program using commom
TDMS calls.


CAUTION:  This sample program has been tested using:
          PRODUCT: TDMS, V1.7   PLI, V3.1 on OPERATING SYSTEM: VMS, V4.7
However, we cannot guarantee its effectiveness because of the possibility of
errors in transmitting or implementing it.  It is meant to be used as a
template for writing your own program, and it may require modification for use
on your system.


PROGRAM NOTES:

This example includes a simple request and library definition, although
your own request can be used as long as the TDMS record does not exceed
the 350 characters declared for the buffer in the PLI program.

The request name should be "REQU" and the library name "LIB".

PROGRAM SAMPLE:

/* start of PLI example source                                         */
tdms_prog_1:       procedure options (main);

/*                                                                     */
/*                declaration of functions                             */
/*                                                                     */
declare tss$open_rlb external entry(char(*), fixed bin (31))
                     options (variable)
                     returns (fixed bin (31));
declare tss$request  external entry(fixed bin (31),fixed bin (31),char(*),char(*))
                     options (variable)
                     returns (fixed bin (31));

declare lib$signal external entry (fixed bin (31) value)
              returns (fixed bin (31));
declare tss$open external entry (fixed bin (31) )
              returns (fixed bin (31));
declare tss$close external entry (fixed bin (31) )
              returns (fixed bin (31));
/*                                                                     */
/*                 rlb_lib contains the name of the library            */
/*                                                                     */

declare rlb_lib         character (3) initial (
 'lib');

/*                                                                     */
/*                 request_1 contains the name of the request          */
/*                                                                     */

declare request_1       character (4) initial (
 'requ');

/*                                                                     */
/*       Buffer use by the request                                     */
/*                                                                     */
declare buffer             character (350);
declare library_id       fixed bin (31);
declare channel          fixed bin (31);
declare istat            fixed bin (31);

%include $stsdef;

/*                                                             */
/*       open rlb                                              */
/*                                                             */

sts$value = tss$open_rlb (rlb_lib, library_id );
istat = lib$signal (sts$value);

/*                                                             */
/*       open channel                                          */
/*                                                             */
sts$value = tss$open  (channel );
istat = lib$signal (sts$value);

/*                                                             */
/*       run request                                           */
/*                                                             */
sts$value = tss$request  (channel,library_id,request_1,buffer );
istat = lib$signal (sts$value);

/*                                                             */
/*       close tdms                                            */
/*                                                             */
sts$value = tss$close (channel );
istat = lib$signal (sts$value);

end tdms_prog_1;
/* end of PLI example source                                   */

TDMS REQUEST DEFINITION

!source begins here
!       TDMS Request REQU
!
REPLACE REQUEST REQU
FORM IS TEXT;
RECORD IS RECTEXT;
USE FORM TEXT;
        INPUT TEXTE_1    TO TEXTE_1;
        INPUT TEXTE_2    TO TEXTE_2;
END DEFINITION;
!source ends here

TDMS LIBRARY DEFINITION
!Source begins here
!       TDMS library LIB
!
REPLACE LIBRARY LIB
    REQUESTS ARE REQU;
    FILE IS LIB.RLB";
END DEFINITION;
!
BUILD LIBRARY LIB/LOG/AUDIT
!Source ends here

Defintion of RECTEXT record:
DEFINE RECORD RECTEXT USING
01 RECTEXT.
02      TEXTE_1 PIC X(20).
02      TEXTE_2 PIC X(20).
;


HOW TO COPY THIS PROGRAM:

We suggest reading this article on a hardcopy terminal to reduce the
possibility of errors from copying the code by hand. If you must copy the
code by hand, we strongly recommend that after you''ve copied it, you select
the article from the menu a second time and compare the two versions. This
process will help you spot possible transmission errors.




buy online or call 1.800.AT.COMPAQ
privacy statementusing this site means you accept its terms