Lawson Labs, Inc. 3239 Phoenixville Pike Malvern, PA 19355 610 725-8800 or 800 321-5355 ________________________________________________________________________ ------------- OVERVIEW OF DOWNLOAD FILES ------------------------------ ************************************************************************ /Download/Software/Model201_LabView/32-bit/201LAB32.zip ************************************************************************ archive contain the following files: 201Lab32.vi - Main application VI init32.vi - Driver initialization VI write32.vi - Driver write VI read32.vi - Driver read VI close32.vi - Driver close VI global32.vi - Global variable VI used in all of the above VI's spare32.vi - Additional entry point into driver to be used for debugging or adding features. 201Lab32.LLB - Library file containing all of the VIs. 201Lab32.DLL - DLL used by instrument. runMsg.txt - Sample debugging file. Application writes runMsg.txt when debugging option is set. 201Lab32.h - Header file provided for your convenience to show the driver function prototypes. Lab_M201.001 - Sample data logging file for single-channel scan mode. Lab_M201.002 - Sample data logging file for multi-channel scan mode. Lab_M201.003 - Sample data logging file for multi-channel cal. scan mode. NOTE: Log files best viewed with tab-stops set to 6 readme.txt - Similiar to this file. **NOTE: the following are all the same, but can be opened in various editors. the .txt is plain ascii text, the .doc was made in the old windows "wordpad" and is not ascii text, the .rtf was made in WinXP WordPad, and is in "Rich Text" format which is compatible with many editors much like the .txt file is. ArrayInf.txt ArrayInf.doc ArrayInf.rtf ************************************************************************ I M P O R T A N T N O T I C E ************************************************************************ You must create a configuration file, prior to "running" this application. That file is easily created using our CVI Model 201 application also available at this site: /Download/Software/Model201_CVI That application is compatible with both 16- and 32-bit Windows environment. It's a fully functional application and is free of charge. You must have the LabVIEW programming environment. This is not a standalone application. ************************************************************************ ________________________________________________________________________ ------------- PRODUCT OVERVIEW ---------------------------------------- The VI's as distributed, work together to form a workable application demonstrating access into the DLL. However, only about 2% of the total of the VI's is necessary in order to build your own application. Since execution speed and memory optimization have in no way been concidered in my example VIs, I would not recommend simply "extending" these VIs. I would instead, suggest copying the applicable icons as discussed below, and building your application around those. The exception would be if you desired only to add a "little" more functionality to the existing VIs. In which case I would still recommend re-working of the VIs to improve speed, and memory optimization. ________________________________________________________________________ ------------- GETTING STARTED ----------------------------------------- Installation and initial setup instructions for Model-201 LabView Application and driver. The LabView application is designed as a model to show the use of the driver for the Model-201. It loads a configuration file which was previously created by the M201_CVI application. Below are the requirements for installation and usage of the 201Lab(xx) app. 1. Copy the zipped file "201Lab(xx).zip" to it's own directory of your choosing. Unzip the file to create the following files: 2. Run the M201_CVI application and save a working configuration. All Model-201 configuration parameters can be set and tested within that application. Copy the new configuration file that you just created to the directory that you made for 201Lab(xx). 3. Start LabView, and open 201Lab(xx).vi. That file can be accessed either as a standalone VI or within the 201Lab(xx).LLB. Start the application by clicking on the "continuous run" arrows. Once started, the online help is available by clicking on the blue "help" button located on the front panel. That button is the only one within the application's execution loop, until the "run driver" button is pressed. Pressing the "run driver" button will start the application's execution loop running. It will first do preliminary initialization of program variables, and will then call the driver at the initialization function. If the driver fails to initialize (sign on) then the application's execution loop will be terminated, and the main panel's execution will be stopped. If the driver's initialization sequence is successful, the NOT-SIGNED-ON message will be replaced with SIGNED ON. You will then be able to access the driver with the main panel controls. ___________________________________________________________________________ ---- Suggested usage of distributed DLL and VIs --------------------------- The DLL and example VI's are organized in such a fashion, that you need only to select and copy the "call library" icon from the pertinent VI, paste it into your own VI, and wire the leads as demonstrated in the VIs I created. A review of the M201_CONFIG array template within the Global1.VI gives a full overview of the parameters being passed between the Virtual Instrument, and the DLL. The only requirement for initializing the driver, is that you pass it a pointer to a 50 member array of doubles as I've done in the init.vi, and the presence of the configuration file. Since LabVIEW manages the memory for the DLL, that pointer must be passed. It's also a good idea to do the same with the byte array. Below is a list of the steps taken by the driver during initialization. 1 - When called, the driver attempts to open, and read from the configuration file. 2 - If the first arg to the M201_init function is wired as a 1 or 2, the driver will create the file "runMsg.dat", and begin logging the initialization process. 3 - The driver loads the data from the configuration file, and fills the array M201_CONFIG with that data. That array and the byte array MUST be initialized within your VI as I've done in the init VI. 4 - The driver attempts to establish communication with the serial port set in the configuration file. 5 - The driver initializes the Model 201 board, calculating and setting up the 201 according to the configuration parameters established in the configuration file. 6 - If failure is encountered during any step, the driver returns non-zero. If the runMsg.dat file was created, the source of the failure is reported there. 7 - Once initialized, the driver will remain on alert, for further instructions (read, write, or close). No further maintenance is required to keep the driver running and in a "ready" state. The only requirement to start the driver running is the presence of the configuration file created by the CVI application, and wirering of the initialization icon as prescribed above. A call to the close function should also be done to close files, and serial port before shutting down the application or otherwise terminating interraction with the driver. An attempt to connect to the entirety of the VIs that I've provided, with an application of your own could prove to be a bit awkward, while connecting a minimal amount of leads to the icons copied from my VIs into your own would be a simple task. The read, write, and spare functions in the VI only require that the byte array be initialized if and when they are called. And that the double type array be initialized when calling the "read" function. Reading and writing to the driver is the same as outlined in the Model 201 user's manual. All functions return a zero value on success. Tim Van Dusen - Lawson Labs, Inc. - 10-25-2006