             Dynamic Link Library (DLL) PACKAGE for the MULTIPLEXER
             
 
 
                                                                     Sep '96
 
 
 
 
 
             ͻ
                                                                
                              TABLE OF CONTENTS                 
                                               
                                                                
               1.   Introduction............................ 1  
               2.   Borland 4.02 C++ Environment............ 3  
               2.1     C++ Functions Description............ 3  
               2.2     C++ Arguments Description............ 5  
               3.   Microsoft 3.0 Visual Basic Environment.. 6  
               3.1     VB Functions Description............. 6  
               3.2     VB Arguments Description............. 8  
               3.3     VB Arrays    Description............. 8  
                                                                
             ͼ
 
 
 
 
 
 
 
 
 
1. Introduction

 
The DLL package for the MULTIPLEXER supplies interface with the card(s) for the
Borland 4.02 C++ and for the Microsoft 3.0 Visual Basic programmers. The
following files are needed for the programmer to develop his own application
and/or examine how the interface works, using a supplied test application.
 
Ŀ
               ENVIRONMENT                                                  
    FILE      Ĵ                 DESCRIPTION                     
                C++  VB                                                    
͵
 LCICMUX.DLL     *    *    Should be placed either in the current          
                           directory, or in the WINDOWS directory.         
Ĵ
 TSMUXDLL.EXE         *    Test application interfacing the card using     
                           the DLL.                                        
Ĵ
 MUXDEF.BAS           *    Should be included in the project file (.MAK).  
Ĵ
 LCICMUX.H       *         Should be #included in the CPP source files.    
Ĵ
 LCICMUX.LIB     *         Should be included in the project file.         

 
The Visual Basic programmer may run the supplied test application (TSMUXDLL)
under Microsoft Visual Basic, using additional files supplied.
 
                                     - 1 -
Before running an application:
1. Install and calibrate your card(s).
2. Assure that the LCICMUX.DLL file is either in the current directory, or in
   the WINDOWS directory.
3. Assure that the
    SEGx  file(s) (created during the installation)
    *.SET file(s) (created during the calibration)
   - are in the correct location as specified in the following table.
 
 
                 LOCATION WHERE THE SEGx AND *.SET FILES SHOULD BE
                 
 
   Ŀ
     Running TSMUXDLL.EXE   Running VB application  Running an application  
     or another EXE file    under Microsoft Visual  produced in C++         
     produced in VB         Basic (in single step,                          
                            etc.)                                           
   ͵
     In the same directory  In the same directory   As specified by the     
     as the EXE file.       as the MAK file. E.g.,  argument LCICPath:      
                            when running the test   For SEGx file(s) - as   
                            application supplied,   specified in function   
                            using Microsoft Visual  FupdateListCards.       
                            Basic, the files should For *.SET file(s) - as  
                            be in same directory as specified in function   
                            TSMUXDLL.MAK.           FupdateCalibration.     
                                                    Note that the two       
                                                    specifications are not  
                                                    forced to be identical. 
   
 
 
Chapter 2 describes the C++ interface, and chapter 3 covers the Visual Basic.
Each of the chapters starts with a table describing interface functions.
However, the functions use some arguments, and, for the sake of readabilty,
their description has been gathered into another table titled "Arguments
Description". Chapter 3 includes an additional table, describing arrays
available for the Visual Basic programmer.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 






 
 
 
                                     - 2 -
2. BORLAND 4.02 C++ ENVIRONMENT

 
Ŀ
         2 . 1      C + +   F U N C T I O N S   D E S C R I P T I O N         
Ĵ
                        Function Name                                      
 # Return Type         ͵ Function Description     
                        Argument(s)                                        
Ĵ
                      A. BEGINNING / END of APPLICATION                       
Ĵ
 1 unsigned int far     FupdateListCards          Prepares the user's      
                       ͵ interface with the       
   pascal               LCICPath                  card(s).                 
                       Ĵ Should be called ONCE at 
                                                  application's beginning, 
                                                  BEFORE first addressing  
                                                  to a Multiplexer card.   
                                                  On success:              
                                                  Returns number of Multi- 
                                                  plexer cards in system.  
                                                  Otherwise: Returns 0.    
Ĵ
 2 int far pascal       ResetListCards            Should be called ONCE at 
                       ͵ application's end,       
                        (no arguments)            AFTER last addressing    
                       Ĵ to a Multiplexer card.   
                                                  On a single instance:    
                                                  Returns number of Mult-  
                                                  iplexer cards in system. 
                                                  Otherwise: Returns 0.    
Ĵ
                         B. GETTING LOAD CELL READING                         
Ĵ
         When the read procedure occurs, it includes two steps:             
          Getting the "latest" card's reading                              
          Requesting a new card's reading                                  
         The procedure does NOT wait for card's response on the new         
         request, but supplies the "latest" reading, i.e., the              
         previous reading, WHENEVER IT WAS TAKEN.                           
         Consequently, it's USER'S RESPONSIBILITY to access his             
         relevant channels in such a rate that the latest reading           
         would really be up-to-date.                                        
         Note that due to the speciality of the Multiplexer card,           
         the response to the new request might take up to 600mS.            
Ĵ
 3 char far * far       ReadASCII                 If load cell flag of the 
                       ͵ channel is 1:            
   pascal               CardNumber                Gets channel's ASCII     
                       Ĵ reading, sets the flag   
                        ChannelNumber             to 0 and returns reading 
                       Ĵ pointer. The string is   
                                                  up to 15 characters,     
                                                  plus null terminator.    
                                                  Otherwise: Returns NULL. 
Ĵ
 4                      ReadFloat                     THIS FUNCTION IS     
                       ͵     CURRENTLY NOT YET    
                                                          AVAILABLE.       

 
 
                                     - 3 -
Ŀ
     C + +   F U N C T I O N S   D E S C R I P T I O N   ( c o n t ' d )      
Ĵ
                               C. MISCELLANEOUS                               
Ĵ
 5 unsigned int far     CheckUsingDll             Returns total number of  
                       ͵ application instances    
   pascal               (no arguments)            currently using the DLL. 
Ĵ
 6 unsigned char far *  NumberVersion             On success:              
                       ͵ Returns pointer to       
   far pascal           CardNumber                card's version number.   
                       Ĵ Otherwise: Returns NULL. 
Ĵ
 7 int far pascal       FupdateCalibration        On success:              
                       ͵ Initializes the latter   
                        LCICPath                  four arguments according 
                       Ĵ to user's calibration    
                        CardNumber                (saved in CALIBx.SET     
                       Ĵ file), and returns TRUE. 
                        ChannelNumber             Otherwise: Returns FALSE.
                       Ĵ Recommended to be called 
                        MaxRange                  once at application's    
                       Ĵ beginning, to make these 
                        UnitName                  arguments available.     
                       Ĵ                          
                        Accuracy                                           
                       Ĵ                          
                        Resolution                                         

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 



 
 
 
 
 
 
                                     - 4 -
Ŀ
         2 . 2      C + +   A R G U M E N T S   D E S C R I P T I O N         
Ĵ
 #  Argument Type  Argument Name            Argument Description           
Ĵ
                             A. FOR COMMON USAGE                              
Ĵ
 1  unsigned int   CardNumber     Card number:        1 for seg1,          
                                                      2 for seg2,          
                                                      etc.                 
Ĵ
 2  unsigned int   ChannelNumber  Channel number:     1 for channel 1,     
                                                      2 for channel 2,     
                                                      etc.                 
Ĵ
                        B. FOR APPLICATION'S BEGINNING                        
Ĵ
 3  const char *   LCICPath       Path to the         Should be terminated 
                                  directory of the    by '\'.              
                                  Multiplexer files   Note that in C / C++ 
                                  (SEGx. and          the syntax is '\\'.  
                                  CALIBx.SET):                             
Ĵ
                        C. FOR CALIBRATION INFORMATION                        
Ĵ
 4  float          MaxRange       Maximal planned load as specified by     
                                  calibration.                             
Ĵ
 5  float          Resolution     Resolution as specified by calibration.  
Ĵ
 6  int            Accuracy       Number of digits after the decimal point 
                                  according to Resolution.                 
Ĵ
 7  char *         UnitName       Unit weight as specified by calibration. 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
                                     - 5 -
3. MICROSOFT 3.0 VISUAL BASIC ENVIRONMENT

 
Ŀ
          3 . 1      V B   F U N C T I O N S   D E S C R I P T I O N          
Ĵ
                        Function/Sub Name                                  
 # Return Type         ͵ Function/Sub Description 
                        Argument(s)                                        
Ĵ
                      A. BEGINNING / END of APPLICATION                       
Ĵ
 1 Integer              LCICMUXDefinition         Prepares the user's      
                       ͵ interface with the       
                        (no arguments)            card(s).                 
                       Ĵ Should be called ONCE at 
                                                  application's beginning, 
                                                  BEFORE first addressing  
                                                  to a Multiplexer card.   
                                                  Returns: 0 if success,   
                                                          -1 otherwise.    
                                                  A proper message is      
                                                  displayed in the latter  
                                                  case.                    
Ĵ
 2 (no return value)    ResetListCards            Should be called ONCE at 
                       ͵ application's end,       
                        (no arguments)            AFTER last addressing    
                       Ĵ to a Multiplexer card.   
Ĵ
                         B. GETTING LOAD CELL READING                         
Ĵ
         When the read procedure occurs, it includes two steps:             
          Getting the "latest" card's reading                              
          Requesting a new card's reading                                  
         The procedure does NOT wait for card's response on the new         
         request, but supplies the "latest" reading, i.e., the              
         previous reading, WHENEVER IT WAS TAKEN.                           
         Consequently, it's USER'S RESPONSIBILITY to access his             
         relevant channels in such a rate that the latest reading           
         would really be up-to-date.                                        
         Note that due to the speciality of the Multiplexer card,           
         the response to the new request might take up to 600mS.            
Ĵ
 3 Integer              VBReadASCII               If load cell flag of the 
                       ͵ channel is 1:            
                        CardNumber                Gets channel's ASCII     
                       Ĵ reading into             
                        ChannelNumber             ASCIIReading, sets the   
                       Ĵ flag to 0, and returns 0.
                        ASCIIReading              Otherwise: Returns -1.   
Ĵ
 4                      VBReadFloat                   THIS FUNCTION IS     
                       ͵     CURRENTLY NOT YET    
                                                          AVAILABLE.       

 
 
 
 
 
 
 
                                     - 6 -
Ŀ
      V B   F U N C T I O N S   D E S C R I P T I O N   ( c o n t ' d )       
Ĵ
                        Function/Sub Name                                  
 # Return Type         ͵ Function/Sub Description 
                        Argument(s)                                        
Ĵ
                               C. MISCELLANEOUS                               
Ĵ
 5 Integer              CheckUsingDll             Returns total number of  
                       ͵ application instances    
                        (no arguments)            currently using the DLL. 
Ĵ
 6 Integer              VBNumberVersion           On success:              
                       ͵ Reads card's version     
                        CardNumber                number into Version, and 
                       Ĵ returns 0.               
                        Version                   Otherwise: Returns -1.   
Ĵ
 7                      FupdateCalibration        For internal use only.   
                       ͵ The user should NOT use  
                                                  this function.           
Ĵ
 8                      FupdateListCards          For internal use only.   
                       ͵ The user should NOT use  
                                                  this function.           

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
                                     - 7 -
Ŀ
          3 . 2      V B   A R G U M E N T S   D E S C R I P T I O N          
Ĵ
 #  Argument Type  Argument Name            Argument Description           
Ĵ
                             A. FOR COMMON USAGE                              
Ĵ
 1  Integer        CardNumber     Card number:        1 for seg1,          
                                                      2 for seg2,          
                                                      etc.                 
Ĵ
 2  Integer        ChannelNumber  Channel number:     1 for channel 1,     
                                                      2 for channel 2,     
                                                      etc.                 
Ĵ
                       B. FOR GETTING LOAD CELL READING                       
Ĵ
 3  String         ASCIIReading   Reading accepted    Its length should be 
                                  from the card in    16 or more, since    
                                  ASCII format:       card's response may  
                                                      be up to 15 char.,   
                                                      plus null terminator.
Ĵ
 4  Single         FloatReading   Reading accepted    The float format     
                                  from the card in    used conforms to the 
                                  FLOAT format:       IEEE 32 bit standard 
                                                      and supports 24 bit  
                                                      of precision. The    
                                                      upper bit (MSB) of   
                                                      the mantissa is      
                                                      always a '1' and is  
                                                      therefore not        
                                                      stored.              
Ĵ
                               C. MISCELLANEOUS                               
Ĵ
 5  Integer        Version        Version number:     Version number of    
                                                      Multiplexer card.    

 
 
 
Ŀ
             3 . 3      V B   A R R A Y S   D E S C R I P T I O N             
Ĵ
                The size of each array = cards' quantity X 8;                 
 1st array's index specifies the CARD:    0 for 1st card,    1 for 2nd, etc.  
 2nd array's index specifies the CHANNEL: 0 for 1st channel, 1 for 2nd, etc.  
         The arrays are READ ONLY - the user should NOT modify them.          
͵
 #   Array Type     Array Name               Array Description             
Ĵ
 1  Single         MaxRange       Maximal planned load as specified by     
                                  calibration.                             
Ĵ
 2  Single         Resolution     Resolution as specified by calibration.  
Ĵ
 3  Integer        Accuracy       Number of digits after the decimal point 
                                  according to Resolution.                 
Ĵ
 4  String         UnitName       Unit weight as specified by calibration. 

 
                                     - 8 -
