Example #1
0
int __po_hi_storage_file_close (__po_hi_storage_file_t* file)
{
   if ( (file == NULL) || (file->filename == NULL))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_close: invalid file argument\n");
      return __PO_HI_INVALID;
   }

#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   if (file->fd == -1)
   {
      __DEBUGMSG ("[STORAGE] Warning, file %s does not exist, continue anyway\n", file->filename);
      return __PO_HI_INVALID;
   }

   if ( close (file->fd))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_close: %s cannot close file\n", file->filename);
      return __PO_HI_ERROR_UNKNOWN;
   }

   file->fd = -1;

   return __PO_HI_SUCCESS;
#endif

   return __PO_HI_NOTIMPLEMENTED;
}
Example #2
0
void __po_hi_wait_end_of_instrumentation ()
{
#ifdef __PO_HI_RTEMS_CLASSIC_API
   rtems_task_wake_after (10000000 / _TOD_Microseconds_per_tick);
#else
   #include <po_hi_time.h>
   #include <unistd.h>

   __po_hi_time_t now;
   __po_hi_time_t ten_secs;
   __po_hi_time_t time_to_wait;
   __po_hi_get_time (&now);
   __po_hi_seconds (&ten_secs, 10);
   __po_hi_add_times (&time_to_wait, &ten_secs, &now);
   __po_hi_delay_until (&time_to_wait);
#endif
  __DEBUGMSG ("Call exit()\n");
  __po_hi_tasks_killall ();
   exit (1);

  __DEBUGMSG ("exit() called\n");
#ifdef __PO_HI_RTEMS_CLASSIC_API
  rtems_task_delete (rtems_self ());
#endif
}
Example #3
0
int __po_hi_storage_file_append (const __po_hi_storage_file_t* file, char* buf, int bufsize)
{
   int ret;

   if ((file == NULL) || (file->filename == NULL))
   {
      return __PO_HI_INVALID;
   }

#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   if (file->fd == -1)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_append: file %s does not have an appropriate descriptor\n", file->filename);
      return __PO_HI_INVALID;
   }

   if (lseek (file->fd, 0, SEEK_END))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_append: error when trying to set file offset\n");
      return __PO_HI_ERROR_UNKNOWN;
   }

   ret = write (file->fd, buf, bufsize);

   if (ret != bufsize)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_append: cannot write %d bytes\n", bufsize);
      return __PO_HI_ERROR_UNKNOWN;
   }

   return __PO_HI_SUCCESS;
#endif
   return __PO_HI_NOTIMPLEMENTED;
}
Example #4
0
int __po_hi_storage_file_write (const __po_hi_storage_file_t* file, char* buf, int bufsize)
{
   int n;

   if ((file == NULL) || (file->filename == NULL))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_write: invalid file parameter\n");
      return __PO_HI_INVALID;
   }

#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   if (file->fd == -1)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_write: invalid file handle (%d)\n", file->fd);
      return __PO_HI_INVALID;
   }

   n = write (file->fd, buf, bufsize);

   if (n != bufsize)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_write: invalid buffer size\n");
      return __PO_HI_ERROR_UNKNOWN;
   }

   return __PO_HI_SUCCESS;
#endif
   return __PO_HI_NOTIMPLEMENTED;
}
Example #5
0
int __po_hi_storage_directory_create (const __po_hi_storage_dir_t* dir)
{
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   struct stat ss;
#endif

   if (dir == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_create: invalid directory parameter\n");
      return __PO_HI_INVALID;
   }

#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   if (stat (dir->dirname, &ss))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_create: file already exists\n");
      return __PO_HI_ERROR_EXISTS;
   }

   if (mkdir (dir->dirname, S_IRWXU | S_IRGRP | S_IROTH))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_create: mkdir error\n");
      return __PO_HI_INVALID;
   }
   return __PO_HI_SUCCESS;
#endif

   return __PO_HI_NOTIMPLEMENTED;
}
Example #6
0
int __po_hi_storage_directory_open (const char* dirname, __po_hi_storage_dir_t* dir)
{
   int len;

   if (dirname == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_open: invalid directory parameter\n");
      return __PO_HI_INVALID;
   }

   if (dir == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_open: invalid directory parameter\n");
      return __PO_HI_INVALID;
   }

   len = strlen (dirname);

   if (len >= __PO_HI_STORAGE_FILENAME_MAXLENGTH)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_open: name too long\n");
      return __PO_HI_INVALID;
   }

   memset (dir->dirname, 0, __PO_HI_STORAGE_FILENAME_MAXLENGTH);

   memcpy (dir->dirname, dirname, len);

   dir->nb_files = 0;

   return __PO_HI_SUCCESS;
}
Example #7
0
int __po_hi_storage_directory_list (__po_hi_storage_dir_t* dir)
{
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   struct dirent* ent;
   DIR*           sdir;

#endif

   if ((dir == NULL) || (dir->dirname == NULL))
   {
      return __PO_HI_INVALID;
   }


#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   sdir = opendir (dir->dirname);

   if (sdir == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_list: fail to call opendir on %s\n", dir->dirname);
      return __PO_HI_ERROR_NOEXISTS;
   }

   dir->nb_files = 0;

   while ( ( ( ent = readdir (sdir) ) != NULL ) && (dir->nb_files < __PO_HI_STORAGE_DIRECTORY_MAXFILES) )
   {
      int n = dir->nb_files;
      int len = strlen (ent->d_name);
      if (len < __PO_HI_STORAGE_FILENAME_MAXLENGTH)
      {
         n = dir->nb_files;
         memset (dir->filename[n], 0, __PO_HI_STORAGE_FILENAME_MAXLENGTH);
         memcpy (dir->filename[n], ent->d_name, len);
         dir->nb_files++;
      }
      else
      {
         __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_list: invalid filename %s\n", ent->d_name);
      }
   }

   if (closedir (sdir))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_list: fail to call closedir on %s\n", dir->dirname);
      return __PO_HI_ERROR_UNKNOWN;
   }

   return __PO_HI_SUCCESS;
#endif

   return __PO_HI_NOTIMPLEMENTED;
}
Example #8
0
int __po_hi_storage_file_rename (const __po_hi_storage_file_t* oldfile, const __po_hi_storage_file_t* newfile)
{
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   struct stat ss;
#endif

   if ((oldfile == NULL) || (oldfile->filename == NULL))
   {
      return __PO_HI_INVALID;
   }

   if ((newfile == NULL) || (newfile->filename == NULL))
   {
      return __PO_HI_INVALID;
   }

#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   if (stat (newfile->filename, &ss) == 0)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_rename: destination file %s already exists\n", newfile->filename);
      return __PO_HI_ERROR_EXISTS;
   }

   if (stat (oldfile->filename, &ss))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_rename: source file %s does not exist\n", oldfile->filename);
      return __PO_HI_ERROR_NOEXISTS;
   }

   if (! S_ISREG (ss.st_mode))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_rename: source file %s is not a regular file\n", oldfile->filename);
      return __PO_HI_ERROR_NOEXISTS;
   }

   if (rename (oldfile->filename, newfile->filename))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_rename: error when trying to delete old file\n");
      return __PO_HI_ERROR_UNKNOWN;
   }

   return __PO_HI_SUCCESS;
#endif

   return __PO_HI_NOTIMPLEMENTED;
}
Example #9
0
int __po_hi_storage_directory_rename (const __po_hi_storage_dir_t* olddir, const __po_hi_storage_dir_t* newdir)
{
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   struct stat ss;
#endif

   if ((olddir == NULL) || (olddir->dirname == NULL))
   {
      return __PO_HI_INVALID;
   }

   if ((newdir == NULL) || (newdir->dirname == NULL))
   {
      return __PO_HI_INVALID;
   }

#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   if (stat (newdir->dirname, &ss) == 0)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_rename: destination directory %s already exists\n", newdir->dirname);
      return __PO_HI_ERROR_EXISTS;
   }

   if (stat (olddir->dirname, &ss))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_rename: source directory %s does not exist\n", olddir->dirname);
      return __PO_HI_ERROR_NOEXISTS;
   }

   if (! S_ISDIR (ss.st_mode))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_rename: source directory %s is not a directory\n", olddir->dirname);
      return __PO_HI_ERROR_NOEXISTS;
   }

   if (rename (olddir->dirname, newdir->dirname))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_rename: error when trying to rename\n");
      return __PO_HI_ERROR_UNKNOWN;
   }

   return __PO_HI_SUCCESS;
#endif

   return __PO_HI_NOTIMPLEMENTED;
}
Example #10
0
int __po_hi_storage_directory_delete (const __po_hi_storage_dir_t* dir)
{
   if (dir == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_delete: invalid directory parameter\n");
      return __PO_HI_INVALID;
   }

#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   if (rmdir (dir->dirname))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_directory_delete: rmdir error\n");
      return __PO_HI_INVALID;
   }
   return __PO_HI_SUCCESS;
#endif
   return __PO_HI_NOTIMPLEMENTED;
}
void __po_hi_driver_generic_keyboard_init (__po_hi_device_id id)
{
   WINDOW* win = initscr();
   keypad (stdscr, TRUE);
   noecho ();
   nodelay (win, TRUE);

   __DEBUGMSG ("INIT KEYBOARD\n");
}
Example #12
0
int __po_hi_storage_packet_store_write (__po_hi_storage_packet_store_t* store, __po_hi_storage_packet_t* packet)
{
   int retcode = __PO_HI_ERROR_UNKNOWN;

   if (store == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_packet_store_write: store is NULL\n");
      return __PO_HI_INVALID;
   }

   if (packet == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_packet_store_write: packet is NULL\n");
      return __PO_HI_INVALID;
   }

   if (__po_hi_mutex_lock (&store->mutex) != __PO_HI_SUCCESS)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_packet_store_write: cannot lock mutex\n");
      return __PO_HI_ERROR_MUTEX_LOCK;
   }

   if (store->n_packets >= store->capacity)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_packet_store_write: store is full\n");
      retcode = __PO_HI_TOOMANY;
   }
   else
   {
      memcpy (&(store->packets[store->write_off * __PO_HI_STORAGE_PACKET_SIZE]), packet, __PO_HI_STORAGE_PACKET_SIZE);

      store->write_off  = (store->write_off + 1 % store->capacity);
      store->n_packets  = store->n_packets + 1;

      retcode = __PO_HI_SUCCESS;
   }

   if (__po_hi_mutex_unlock (&store->mutex) != __PO_HI_SUCCESS)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_packet_store_write: cannot unlock mutex\n");
      return __PO_HI_ERROR_MUTEX_UNLOCK;
   }
   return retcode;
}
Example #13
0
int __po_hi_storage_file_open (const char* filename, __po_hi_storage_file_t* file)
{
   int len;
   int fd;

   if (file == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_open: invalid file argument\n");
      return __PO_HI_INVALID;
   }

   len = strlen (filename);

   memset (file->filename, 0, __PO_HI_STORAGE_FILENAME_MAXLENGTH);

   if (len >= __PO_HI_STORAGE_FILENAME_MAXLENGTH)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_open: file failed to be opened\n");
      return __PO_HI_INVALID;
   }

   strncpy (file->filename, filename, len);

#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   /*
    * If the file already exist, we open it for reading/writing
    */

   fd = open (filename, O_RDWR | O_SYNC);

   if (fd == -1)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_open: warning, file %s does not exist, continue anyway\n", filename);
   }
   else
   {
      file->fd = fd;
   }

   return __PO_HI_SUCCESS;
#endif
   return __PO_HI_NOTIMPLEMENTED;
}
Example #14
0
int __po_hi_storage_file_create (__po_hi_storage_file_t* file)
{
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   struct stat ss;
   int fd;
#endif

   if ((file == NULL) || (file->filename == NULL))
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_create: invalid file parameter\n");
      return __PO_HI_INVALID;
   }

#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
   if (stat (file->filename, &ss) == 0)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_create: file %s already exists\n", file->filename);
      return __PO_HI_ERROR_EXISTS;
   }

   /*
    * We assume the file is not open previously by a call to open().
    * Otherwise, we assume this is an error.
    */
   if (file->fd != -1)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_file_create: file already opened (%d)\n", file->fd);
   }

   fd = open (file->filename, O_RDWR | O_CREAT | O_SYNC, S_IRWXU | S_IRGRP | S_IROTH);

   if (fd == -1)
   {
      __DEBUGMSG ("[STORAGE] Warning, cannot open file %s with create attributes\n", file->filename);
      return __PO_HI_INVALID;
   }

   file->fd = fd;

   return __PO_HI_SUCCESS;
#endif
   return __PO_HI_NOTIMPLEMENTED;
}
int __po_hi_driver_xc4v_fpga_initialize() 
{
   int ret;
   int instance = 0;
   int pbus = 0;
   int pdev = 0;
   int pfun = 0;

   init_pci ();

   ret = BSP_pciFindDevice (__PO_HI_DRIVER_XC4V_VENDOR_ID, __PO_HI_DRIVER_XC4V_DEVICE_ID, instance, &pbus, &pdev, &pfun);

   if (ret != 0)
   {
      __DEBUGMSG ("Device not found, return =%d\n");
      return 0;
   }
   else
   {
      __DEBUGMSG ("Device found, bus=0x%x, dev=0x%x, fun=0x%x\n", pbus, pdev, pfun);
   }

   pci_read_config_dword(pbus, pdev, pfun, 0x10, &__po_hi_driver_xc4v_bar0);

   __DEBUGMSG ("Configuration, bar0=0x%x\n", __po_hi_driver_xc4v_bar0);

   /* 
    * The three lines above are equivalent to the Configure_XC4V 
    * Ada procedure
    */
   __po_hi_driver_xc4v_fpga_set_page0_register (0x80000000);
   __po_hi_driver_xc4v_fpga_set_grpci_mmap (0x400, 0x40000000);
   __po_hi_driver_xc4v_fpga_set_page1_register (0x400, 0x40000000);

   /* 
    * Equivalent to the Configure_IO_Port procedure of Ada
    */

   __po_hi_driver_xc4v_fpga_configure_ioports ();
   __po_hi_driver_xc4v_drv_addr = __po_hi_driver_xc4v_bar0;
   return 1;
}
Example #16
0
int __po_hi_storage_packet_store_read (__po_hi_storage_packet_store_t* store, __po_hi_storage_packet_t* packet)
{
   int retcode = __PO_HI_ERROR_UNKNOWN;

   if (store == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_packet_store_read: store is NULL\n");
      return __PO_HI_INVALID;
   }

   if (packet == NULL)
   {
      __DEBUGMSG ("[STORAGE] __po_hi_storage_packet_store_read: packet is NULL\n");
      return __PO_HI_INVALID;
   }

   if (__po_hi_mutex_lock (&store->mutex) != __PO_HI_SUCCESS)
   {
      return __PO_HI_ERROR_MUTEX_LOCK;
   }

   if (store->n_packets < 1)
   {
      retcode = __PO_HI_UNAVAILABLE;
   }
   else
   {
      memcpy (packet, &(store->packets[store->read_off * __PO_HI_STORAGE_PACKET_SIZE]), __PO_HI_STORAGE_PACKET_SIZE);

      store->read_off   = (store->read_off + 1 % store->capacity);
      store->n_packets  = store->n_packets - 1;

      retcode = __PO_HI_SUCCESS;
   }

   if (__po_hi_mutex_unlock (&store->mutex) != __PO_HI_SUCCESS)
   {
      return __PO_HI_ERROR_MUTEX_UNLOCK;
   }
   return retcode;
}
Example #17
0
BOOL APIENTRY Piplx_DllMain(handle_t handle,pu32 reason,void *reserved) {  
  switch(reason) {
    /* Process attached to DLL */
    case DLL_PROCESS_ATTACH:
      if(__libPiplx_Reference == 0) {
        /* DEBUG RECORD BEGIN */
        #ifdef DEBUG
          //__DEBUG_MEM_USAGE();
          __DEBUGMSG(FALSE,"Piplx library initialization, reference: %d",__libPiplx_Reference);
        #endif				
        /* DEBUG RECORD END */
        #ifdef WIN32
          __libPiplx_Instance = handle;
        #endif			 
        __libPiplx_Guard = new safety_lock_c();
        __libPiplx_Module = new piplx_module_c(PILPXI_LIBRARY_FILE);
        __libPiplx_Reference++;
      }        
      break;
    /* Process detached to DLL */
    case DLL_PROCESS_DETACH:
      /* DEBUG RECORD BEGIN */
      #ifdef DEBUG
        __DEBUGMSG(FALSE,"\nPiplx library deinitialization, reference: %d",__libPiplx_Reference);
      #endif
      /* DEBUG RECORD END */
      if(__libPiplx_Reference == 1) {        
        delete __libPiplx_Module;
        delete __libPiplx_Guard;
        /* DEBUG RECORD BEGIN */
        #ifdef DEBUG
          //__DEBUG_MEM_USAGE();        
        #endif
        /* DEBUG RECORD END */
        __libPiplx_Reference--;
      }        
      break;
  };
  return TRUE;
}
Example #18
0
DWORD PIPLX_API PIPLX_WriteCal(SESSION Sid,DWORD CardNum,DWORD OutSub,DWORD Idx,DWORD Data) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_WriteCal +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->writeCal(Sid,CardNum,OutSub,Idx,Data);
  __libPiplx_Guard->unlock();
  return result;
}
Example #19
0
DWORD PIPLX_API PIPLX_ResGetResistance(SESSION Sid,DWORD CardNum,DWORD OutSub,double *Resistance) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_ResGetResistance +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->resGetResistance(Sid,CardNum,OutSub,Resistance);
  __libPiplx_Guard->unlock();
  return result;
}
Example #20
0
DWORD PIPLX_API PIPLX_ReadCalDate(SESSION Sid,DWORD CardNum,DWORD OutSub,DWORD Store,DWORD *Year,DWORD *Day,DWORD *Interval) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_ReadCalDate +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->readCalDate(Sid,CardNum,OutSub,Store,Year,Day,Interval);
  __libPiplx_Guard->unlock();
  return result;
}
Example #21
0
DWORD PIPLX_API PIPLX_ReadCalFP(SESSION Sid,DWORD CardNum,DWORD OutSub,DWORD Store,DWORD Offset,DWORD NumValues,double *Data) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_ReadCalFP +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->readCalFP(Sid,CardNum,OutSub,Store,Offset,NumValues,Data);
  __libPiplx_Guard->unlock();
  return result;
}
Example #22
0
DWORD PIPLX_API PIPLX_AttenInfo(SESSION Sid,DWORD CardNum,DWORD SubNum,DWORD *TypeNum,DWORD *NumSteps,float *StepSize) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_Atteninfo +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->attenInfo(Sid,CardNum,SubNum,TypeNum,NumSteps,StepSize);
  __libPiplx_Guard->unlock();
  return result;
}
Example #23
0
DWORD PIPLX_API PIPLX_SetCalPoint(SESSION Sid,DWORD CardNum,DWORD OutSub,DWORD Index) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_SetCalPoint +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->setCalPoint(Sid,CardNum,OutSub,Index);
  __libPiplx_Guard->unlock();
  return result;
}
Example #24
0
DWORD PIPLX_API PIPLX_PsuEnable(SESSION Sid,DWORD CardNum,DWORD SubNum,BOOL State) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_PsuEnable +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->psuEnable(Sid,CardNum,SubNum,(pbool)State);
  __libPiplx_Guard->unlock();
  return result;
}
Example #25
0
DWORD PIPLX_API PIPLX_AttenSetAttenuation(SESSION Sid,DWORD CardNum,DWORD SubNum,float Atten) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_AttenSetAttenuation +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->attenSetAttenuation(Sid,CardNum,SubNum,Atten);
  __libPiplx_Guard->unlock();
  return result;
}
Example #26
0
DWORD PIPLX_API PIPLX_PsuSetVoltage(SESSION Sid,DWORD CardNum,DWORD SubNum,double Voltage) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_PsuSetVoltage +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->psuSetVoltage(Sid,CardNum,SubNum,Voltage);
  __libPiplx_Guard->unlock();
  return result;
}
Example #27
0
DWORD PIPLX_API PIPLX_PsuType(SESSION Sid,DWORD CardNum,DWORD SubNum,LPCHAR Str,DWORD StrLen) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_PsuType +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->psuType(Sid,CardNum,SubNum,Str,StrLen);
  __libPiplx_Guard->unlock();
  return result;
}
Example #28
0
DWORD PIPLX_API PIPLX_CloseSpecifiedCard(SESSION Sid,DWORD CardNum) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_CloseSpecifiedCard +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->closeSpecifiedCard(Sid,CardNum);
  __libPiplx_Guard->unlock();
  return result;
}
Example #29
0
DWORD PIPLX_API PIPLX_SetMode(SESSION Sid,DWORD ModeFlags) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_SetMode +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->setMode(Sid,ModeFlags);
  __libPiplx_Guard->unlock();
  return result;
}
Example #30
0
DWORD PIPLX_API PIPLX_ReadInputSub(SESSION Sid,DWORD CardNum,DWORD InSub,DWORD *Data,DWORD DataLen) {
  register DWORD result;

  /* DEBUG RECORD BEGIN */
  #ifdef DEBUG
    __DEBUGMSG(FALSE,"\n+++ PIPLX_ReadSubEx +++");
  #endif
  /* DEBUG RECORD END */
  __libPiplx_Guard->lock();
  result = __libPiplx_Module->readSub(Sid,CardNum,InSub,Data,DataLen);
  __libPiplx_Guard->unlock();
  return result;
}