LLABS Classes
 
Programming interface classes for
--   For Win98/ME/2k/XP   --
download sample code and header files
download archive of all class documentation




 Classes overview


The LLABS classes were created to make the software developer's task of interfacing our USB, TCP/IP, and serial devices easier. The classes and their member functions are designed with various developer's needs in mind. While some functions greatly simplify and expedite the process of device initialization, I/O functionality and even the scanning process, there are other functions for closer analysis of what is "going on internally" such as error and non-error status codes related to functionality of the hardware, driver, and DLL.

Using an example of our USB class, there are various forms of the intitialization process. One allows a quick initialization which uses all default parameters and even looks for a connected device that matches the type that applies to the class being used and initializes the first one that it finds, while another overloaded function of the same type and name, allows many devices to be intialized at the same time with the developer having complete control of the parameters used for initialization as well as complete access to lower-level status codes that indicate the status of each devices such as whether or not the power or USB cable is disconnected or even lets you know if another application is currently using the device.

Click HERE to go to documentation that lists only "simplified" (although somewhat limited) style class member functions. All member functions including simplified versions are included in this documentation but the other is easier to browse if the simplified style functions is all that you'll be using.






 Classes hierarchy and member functions

LLABS
<- root class
 
MyLL_USB
<- can be used
  as base class
   
 
Initialization
   
   
no argument init - function uses first device it finds and all default args.
BOOLEAN Init_SP( );

init single device only - you specify Device ID class uses other default args.
BOOLEAN Init (USHORT usDevID);

init single device only.
BOOLEAN Init (USHORT usDevID, BYTE bChan, DOUBLE* dblRate);

init multiple devices (non-threaded).
BOOLEAN Init (USHORT* pausDevList, BYTE* pabChans, DOUBLE* padblRates);

init multiple devices (threaded).
BOOLEAN Init (USHORT* pausDevList, BYTE* pabChans, DOUBLE* padblRates, BOOLEAN fThreaded);

get current default device ID if Init_SP was used
BOOLEAN GetDefDev_SP (USHORT* usDevID);


 
Rate and calibration
   
   
rate

   
single argument rate change - function uses device from Init_SP()
BOOLEAN ChangeCurDevRate_SP (DOUBLE* pdblRate);

change the rate of device that you pass as arg
BOOLEAN ChangeCurDevRate (USHORT usDevID, DOUBLE* pdblRate);

   
calibration

   
single argument calibration - function uses device from Init_SP()
BOOLEAN Calibrate_SP ();

calibrate device that you pass as an arg
BOOLEAN Calibrate (USHORT usDevID);


 
Basic I/O
   
   
channel

   
single argument chan change - function uses device from Init_SP()
BOOLEAN SetCurChan_SP (BYTE bChan);

change the chan of device that you pass as arg
BOOLEAN SetCurChan (USHORT usDevID, BYTE bChan);

single argument chan read - function uses device from Init_SP()
BOOLEAN GetCurChan_SP (BYTE* pbCurChan);

calibrate device that you pass as an arg
BOOLEAN GetCurChan (USHORT usDevID, BYTE* pbCurChan);

   
analog output (Model 302 only)

   
analog output - function uses device from Init_SP()
BOOLEAN SendAnalogOut_SP (BYTE bDAC, DOUBLE dblVoltage);

analog output to device that you pass as arg
BOOLEAN SendAnalogOut (USHORT usDevID, BYTE bDAC, DOUBLE dblVoltage);

   
digital output

   
single argument digital output - function uses device from Init_SP()
BOOLEAN SendDigitalOutput_SP (BYTE bDigOutVal);

send digital output to device that you pass as arg
BOOLEAN SendDigitalOutput (USHORT usDevID, BYTE bDigOutVal);

   
digital input

   
single argument digital input - function uses device from Init_SP()
BOOLEAN GetDigitalInput_SP (BYTE* pbDiginVal);

get digital input from device that you pass as arg
BOOLEAN GetDigitalInput (USHORT usDevID, BYTE* pbDiginVal);


 
Polled data mode
   
   
get one 24-bit conversion

   
get one conversion (24-bit count) of device that you pass as arg
BOOLEAN GetOneCount (USHORT usDevID, UINT* puiRawCount);

   
get one voltage

   
single argument getting voltage - function uses device from Init_SP()
BOOLEAN GetOneVoltage_SP (DOUBLE* pdblVoltage);

get voltage from device that you pass as arg
BOOLEAN GetOneVoltage (USHORT usDevID, DOUBLE* pdblVoltage);

get voltage from device that you pass as arg with range included as arg
BOOLEAN GetOneVoltage (USHORT usDevID, DOUBLE* pdblVoltage, DOUBLE dblRange);


 
Scanning data mode
   
   
start scan

   
single argument starting scan - function uses device from Init_SP(). Uses current channel.
BOOLEAN StartScan_SP ();

start scanning device that you pass as arg. Does single channel non/digin scan on current chan.
BOOLEAN StartScan (USHORT usDevID);

start scanning devices that you pass as arg. Uses scan types and channel count that you pass as arg
BOOLEAN StartScan (BYTE* pbNumDevices, USHORT* pausDevIDList,
BYTE* pabScanTypeList, BYTE* pabNumChansList, BYTE* pabScanStartedList);
   
read scan data

   
single argument getting scan voltages - function uses device from Init_SP()
BOOLEAN GetScanVoltage_SP (PSCAN_INFO_USB_PNTS_SINGLE pScanInfoPntsSingle, DOUBLE* padblVoltages);

single argument getting scan voltages - same as above except you set Device ID in struct()
BOOLEAN GetScanVoltage (PSCAN_INFO_USB_PNTS_SINGLE pScanInfoPntsSingle, DOUBLE* padblVoltages);

get scan data from device that you pass as arg (device ID must appear in struct pointed to by pScanInfo)
BOOLEAN GetScanData (PSCAN_INFO_USB pScanInfo, PSCAN_PACKET_USB paScanPacket);

get scan data from device that you pass as arg, using your other args as well
BOOLEAN GetScanData (USHORT usDevID, USHORT usNumPntsToRead, USHORT* pusNumPntsRead,
UINT* uiDataBuff, UINT* uiStatusFlags, UINT* uiPntsInBuff, BYTE* bLastDigin);
get scan data from device that you pass as arg, using your other args as well
BOOLEAN GetScanData (USHORT usDevID, USHORT usNumPntsToReadMax,
USHORT usNumPntsToReadMin, USHORT* pusNumPntsRead, UINT* pauiDataBuff, BYTE* pabDiginBuff,
BOOLEAN fOkayToReadLess, UINT* puiStatusFlags, UINT* puiPntsInBuff, BYTE* pbLastDigin);
   
end scan

   
no argument ending scan - function uses device from Init_SP()
BOOLEAN EndScan_SP ();

end scan for device that you pass as arg
BOOLEAN EndScan (USHORT usDevID);

end scan for devices that you pass as arg in array pointed to by pausDevList
BOOLEAN EndScan (BYTE bNumDevices, USHORT* pausDevList);


 
Miscellaneous functions
   
   
get status of last class function call you made

   
single argument get last error for device from Init_SP().
BOOLEAN GetLastDevError_SP (UINT* puiErrorCode);

get last error for device that you pass as arg.
BOOLEAN GetLastDevError (UINT usDevID, UINT* puiErrorCode);

single argument get last error from any previously call function call, any device
BOOLEAN GetLastAnyError_SP (UINT* puiErrorCode);

single argument get last error from any previously call function call, any device (same as above)
BOOLEAN GetLastAnyError (UINT* puiErrorCode);

   
get device connection and power status

   
get device connection and power status for device from Init_SP().
BOOLEAN GetDevStatus_SP (UINT* puiConnectionStat, UINT* puiPowerStat);

get device connection and power status for device that you pass as arg.
BOOLEAN GetDevStatus (USHORT usDevID, UINT* puiConnectionStat, UINT* puiPowerStat);

   
get device initialization status

   
no argument check to see if any device was initialized using call to Init_SP(). Returns TRUE if there was.
BOOLEAN GetCurDevInitStatus_SP ();

single argument check to see if device passed as arg has been initialized
BOOLEAN GetCurDevInitStatus (UINT* puiErrorCode);

   
get device scan status

   
check to see if device is scanning and/or if it is safe to start scanning. Uses device ID from Init_SP()
BOOLEAN GetCurDevScanStatus_SP (USHORT usDevID, BOOLEAN* fOkayToStartScan, BOOLEAN* fScanning);

check to see if device is scanning and/or if it is safe to start scanning. Uses device ID you pass as arg
BOOLEAN GetCurDevScanStatus (USHORT usDevID, BOOLEAN* fOkayToStartScan, BOOLEAN* fScanning);



MyLL_TCPIP
<- can be used
  as base class
   
 
Initialization
   
   
no argument init - function uses first device it finds and all default args.
BOOLEAN Init_SP( );

init single device only - you specify Device ID class uses other default args.
BOOLEAN Init (char* szDevAddress);

init single device only.
BOOLEAN Init (char* szDevAddress, BYTE bChan, DOUBLE* dblRate);

init multiple devices (non-threaded).
BOOLEAN Init (USHORT* pausDevList, BYTE* pabChans, DOUBLE* padblRates);

init multiple devices (threaded).
BOOLEAN Init (USHORT* pausDevList, BYTE* pabChans, DOUBLE* padblRates, BOOLEAN fThreaded);

get current default device ID address string if Init_SP was used. IP Address in format:   xxx.xxx.xxx.xxx
BOOLEAN GetDefDevID_SP (char* usDevID);


 
Rate and calibration
   
   
rate

   
single argument rate change - function uses device from Init_SP()
BOOLEAN ChangeCurDevRate_SP (DOUBLE* pdblRate);

change the rate of device that you pass as arg
BOOLEAN ChangeCurDevRate (char* szDevAddress, DOUBLE* pdblRate);

   
calibration

   
single argument calibration - function uses device from Init_SP()
BOOLEAN Calibrate_SP ();

calibrate device that you pass as an arg
BOOLEAN Calibrate (char* szDevAddress);


 
Basic I/O
   
   
channel

   
single argument chan change - function uses device from Init_SP()
BOOLEAN SetCurChan_SP (BYTE bChan);

change the chan of device that you pass as arg
BOOLEAN SetCurChan (char* szDevAddress, BYTE bChan);

single argument chan read - function uses device from Init_SP()
BOOLEAN GetCurChan_SP (BYTE* pbCurChan);

calibrate device that you pass as an arg
BOOLEAN GetCurChan (char* szDevAddress, BYTE* pbCurChan);

   
analog output

   
analog output - function uses device from Init_SP()
BOOLEAN SendAnalogOut_SP (BYTE bDAC, DOUBLE dblVoltage);

analog output to device that you pass as arg
BOOLEAN SendAnalogOut (char* szDevAddress, BYTE bDAC, DOUBLE dblVoltage);

   
digital output

   
single argument digital output - function uses device from Init_SP()
BOOLEAN SendDigitalOutput_SP (BYTE bDigOutVal);

send digital output to device that you pass as arg
BOOLEAN SendDigitalOutput (char* szDevAddress, BYTE bDigOutVal);

   
digital input

   
single argument digital input - function uses device from Init_SP()
BOOLEAN GetDigitalInput_SP (BYTE* pbDiginVal);

get digital input from device that you pass as arg
BOOLEAN GetDigitalInput (char* szDevAddress, BYTE* pbDiginVal);


 
Polled data mode
   
   
get one 24-bit conversion

   
get one conversion (24-bit count) of device that you pass as arg
BOOLEAN GetOneCount (char* szDevAddress, UINT* puiRawCount);

   
get one voltage

   
single argument getting voltage - function uses device from Init_SP()
BOOLEAN GetOneVoltage_SP (DOUBLE* pdblVoltage);

get voltage from device that you pass as arg
BOOLEAN GetOneVoltage (char* szDevAddress, DOUBLE* pdblVoltage);

get voltage from device that you pass as arg with range included as arg
BOOLEAN GetOneVoltage (char* szDevAddress, DOUBLE* pdblVoltage, DOUBLE dblRange);


 
Scanning data mode
   
   
start scan

   
single argument starting scan - function uses device from Init_SP(). Uses current channel.
BOOLEAN StartScan_SP ();

start scanning device that you pass as arg. Does single channel non/digin scan on current chan.
BOOLEAN StartScan (char* szDevAddress);

start scanning devices that you pass as arg. Uses scan types and channel count that you pass as arg
BOOLEAN StartScan (BYTE* pbNumDevices, USHORT* pausDevIDList,
BYTE* pabScanTypeList, BYTE* pabNumChansList, BYTE* pabScanStartedList);
   
read scan data

   
single argument getting scan voltages - function uses device from Init_SP()
BOOLEAN GetScanVoltage_SP (PSCAN_INFO_TCPIP_PNTS_SINGLE pScanInfoPntsSingle, DOUBLE* padblVoltages);

get scan data from device that you pass as arg (device ID must appear in struct pointed to by pScanInfo)
BOOLEAN GetScanData (PSCAN_INFO_TCPIP pScanInfo, PSCAN_PACKET_TCPIP paScanPacket);

get voltage from device that you pass as arg with range included as arg
BOOLEAN GetScanData (char* szDevAddress, DOUBLE* pdblVoltage, DOUBLE dblRange);

get scan data from device that you pass as arg, using your other args as well
BOOLEAN GetScanData (char* szDevAddress, USHORT usNumPntsToRead, USHORT* pusNumPntsRead,
UINT* uiDataBuff, UINT* uiStatusFlags, UINT* uiPntsInBuff, BYTE* bLastDigin);
get scan data from device that you pass as arg, using your other args as well
BOOLEAN GetScanData (char* szDevAddress, USHORT usNumPntsToReadMax,
USHORT usNumPntsToReadMin, USHORT* pusNumPntsRead, UINT* pauiDataBuff, BYTE* pabDiginBuff,
BOOLEAN fOkayToReadLess, UINT* puiStatusFlags, UINT* puiPntsInBuff, BYTE* pbLastDigin);
   
end scan

   
no argument ending scan - function uses device from Init_SP()
BOOLEAN EndScan_SP ();

end scan for device that you pass as arg
BOOLEAN EndScan (char* szDevAddress);

end scan for devices that you pass as arg in array pointed to by pausDevList
BOOLEAN EndScan (BYTE bNumDevices, USHORT* pausDevList);


 
Miscellaneous functions
   
   
get status of last class function call you made

   
single argument get last error for device from Init_SP().
BOOLEAN GetLastDevError_SP (UINT* puiErrorCode);

get last error for device that you pass as arg.
BOOLEAN GetLastDevError (UINT usDevID, UINT* puiErrorCode);

single argument get last error from any previously call function call, any device
BOOLEAN GetLastAnyError_SP (UINT* puiErrorCode);

single argument get last error from any previously call function call, any device (same as above)
BOOLEAN GetLastAnyError (UINT* puiErrorCode);

   
get device connection status

   
get device connection and power status for device from Init_SP().
BOOLEAN GetDevStatus_SP (UINT* puiConnectionStat);

get device connection and power status for device that you pass as arg.
BOOLEAN GetDevStatus (char* szDevAddress, UINT* puiConnectionStat);

   
get device initialization status

   
no argument check to see if any device was initialized using call to Init_SP(). Returns TRUE if there was.
BOOLEAN GetCurDevInitStatus_SP ();

single argument check to see if device passed as arg has been initialized
BOOLEAN GetCurDevInitStatus (UINT* puiErrorCode);

   
get device scan status

   
check to see if device is scanning and/or if it is safe to start scanning. Uses device ID from Init_SP()
BOOLEAN GetCurDevScanStatus_SP (char* szDevAddress, BOOLEAN* fOkayToStartScan, BOOLEAN* fScanning);

check to see if device is scanning and/or if it is safe to start scanning. Uses device ID you pass as arg
BOOLEAN GetCurDevScanStatus (char* szDevAddress, BOOLEAN* fOkayToStartScan, BOOLEAN* fScanning);

         






















































C/C++ Developer's USB Class usage examples





















back
lawsnlab@lawsonlabs.com
last modified: 5-22-02