Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-VB/ActiveX | API-Java | Examples | Downloads

NETMEX Client File Reference

TINE NETMEX library routines. More...


Functions

int NetmexGetEx (NETKEY *key, void *inbuf, int inbuffmt, int inbuflen)
 The extended version of NetmexGet(). Synchronous. Retrieves a NETMEX keyword.

int NetmexGet (NETKEY *key)
 The extended version of NetmexGet(). Synchronous. Retrieves a NETMEX keyword.

int LinkNetmexEx (NETKEY *key, int PollRate, void(*function)(char *, int), short mode, void *inbuf, int inbuffmt, int inbuflen)
 Extended version of LinkNetmex(). Asynchronous NETMEX data acquisition. Refreshes the input keyword and calls the input callback function.

int LinkNetmex (NETKEY *key, int PollRate, void(*function)(char *, int), short mode)
 Asynchronous NETMEX data acquisition. Refreshes the input keyword and calls the input callback function.


Detailed Description

TINE NETMEX library routines.


Function Documentation

int LinkNetmex NETKEY *  key,
int  PollRate,
void(*  function)(char *, int),
short  mode
 

Asynchronous NETMEX data acquisition. Refreshes the input keyword and calls the input callback function.

This is an asynchronous mechanism to obtain the NETMEX Keyword information for the input Keyword, and is the preferred method of obtaining NETMEX parameters.

Parameters:
key (input/output) is the NETMEX key for which the information is to be acquired. The parameter type NETKEY has usually already been afixed in the appropriate netmex header file. A successful call to NetmexGet() will then refresh the data contents of the keyword syncrhonously.
PollRate is the polling interval in milliseconds passed along the the corresponding server.
function is the callback function to be called when new data arrive. It must have the prototype function(char *keywordName,int completionCode).
mode is the TINE access mode to be used in the data acquisition, typically one of CM_POLL or CM_REFRESH.
Returns:
0 upon success, otherwise a TINE completion code.
See also:
LinkNetmexEx, NetmexGet, NetmexGetEx
Example

#include "cprolog.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "errors.h"
#include "rpctypes.h"
#include "netmex.h"
#include "hera.h"

void showKeyword(char *keyword,int cc)
{
  int i;
  if (!strcmp(keyword,HPENERGY.Property))
  {
    printf("Energy callback: %f Gev\n",*(float *)HPENERGY.data);
    return;
  }
}
int main(int argc, char *argv[])
{
  int i,cycle = 0;
  switch (argc)
  {
    case 2:
      NGdebug = atoi(argv[1]);
      break;
    default:
      NGdebug = 0;
  }
  if ((i=LinkNetmex(&HPENERGY,1000,showKeyword,CM_REFRESH)) != 0) printf("Link error: %d (%s)\n>",i,erlst[i]);
  for (;;)
  {
    SystemCycle(TRUE);
  }

  return 0;
}

int LinkNetmexEx NETKEY *  key,
int  PollRate,
void(*  function)(char *, int),
short  mode,
void *  inbuf,
int  inbuffmt,
int  inbuflen
 

Extended version of LinkNetmex(). Asynchronous NETMEX data acquisition. Refreshes the input keyword and calls the input callback function.

This call differs from LinkNetmex() in that it provides parameters for specifying input information when the Keyword in question requires input (seldem the case). This is an asynchronous mechanism to obtain the NETMEX Keyword information for the input Keyword, and is the preferred method of obtaining NETMEX parameters.

Parameters:
key (input/output) is the NETMEX key for which the information is to be acquired. The parameter type NETKEY has usually already been afixed in the appropriate netmex header file. A successful call to NetmexGet() will then refresh the data contents of the keyword syncrhonously.
PollRate is the polling interval in milliseconds passed along the the corresponding server.
function is the callback function to be called when new data arrive. It must have the prototype function(char *keywordName,int completionCode).
mode is the TINE access mode to be used in the data acquisition, typically one of CM_POLL or CM_REFRESH.
inbuf is a pointer to a buffer holding the input data required by the keyword.
inbuffmt is the input TINE data type.
inbuflen is the size of the input buffer (number of elements).
Returns:
0 upon success, otherwise a TINE completion code.
See also:
LinkNetmex, NetmexGet, NetmexGetEx

int NetmexGet NETKEY *  key  ) 
 

The extended version of NetmexGet(). Synchronous. Retrieves a NETMEX keyword.

This is a synchronous call to obtain the NETMEX Keyword information for the input Keyword.

Parameters:
key (input/output) is the NETMEX key for which the information is to be acquired. The parameter type NETKEY has usually already been afixed in the appropriate netmex header file. A successful call to NetmexGet() will then refresh the data contents of the keyword syncrhonously.
Returns:
0 upon success, otherwise a TINE completion code.
See also:
NetmexGetEx, LinkNetmex, LinkNetmexEx

int NetmexGetEx NETKEY *  key,
void *  inbuf,
int  inbuffmt,
int  inbuflen
 

The extended version of NetmexGet(). Synchronous. Retrieves a NETMEX keyword.

This call differs from NetmexGet() in that it provides parameters for specifying input information when the Keyword in question requires input (seldem the case). This is a synchronous call to obtain the NETMEX Keyword information for the input Keyword.

Parameters:
key (input/output) is the NETMEX key for which the information is to be acquired. The parameter type NETKEY has usually already been afixed in the appropriate netmex header file. A successful call to NetmexGetEx() will then refresh the data contents of the keyword syncrhonously.
inbuf is a pointer to a buffer holding the input data required by the keyword.
inbuffmt is the input TINE data type.
inbuflen is the size of the input buffer (number of elements).
Returns:
0 upon success, otherwise a TINE completion code.
See also:
NetmexGet, LinkNetmex, LinkNetmexEx


Generated on Sun Mar 21 14:20:50 2004 for NETMEX API by doxygen 1.3.2