LabView Sample source code
-- a very basic LabView sample application --
-----   Level 2   -----
( use when no changing of   default configuration,   parameters required )
--  last updated: 11-21-05  --


A little about this document
Quick jump to
Screenshots     Log File sample



This documentation was created using the sample application found within    .  
It's intended be used as a reference to understand the simplicity of interracting with the Model 201 using the combination of VisualBasic and our   M201_SP.DLL   dynamically linked library. The Library is included in the archive linked to above and all available   function calls   are well documented.

Since LabView uses a graphical interface for it's programming, it would be difficult to explain what goes on within the sample application without the use screenshots. So below are screenshots showing the contents of a couple of the VIs used within the sample application. I've created a   "main.vi"   that calls all the other VIs. Each VI can also be used independently but not much true functionality would be obtained that way. I've demonstrated just a handful of ways to interract with the Model 201 using M201_SP.DLL but there are numerous ways to control the Model 201 shown in the   QuickRef.htm  documentation file. To use any of the functions shown in that file the same technique is used as shown in the various functions within the sample application and discussed within this document.

For this documention, I've chosen to show a main panel screen shot showing the result of the two function calls:
        EX_SetPolledModeChan
        EX_GetOneConversion
The actual applicatin (within the archive) also demonstrates the use of the M201_SP.INI file which can be used to completely configure the device both for signon and all required runtime parameters. I've also chosen to highlight interraction of the  RunOrStop.vi   which makes use of the  EX_Run( )  and  EX_Stop( )   function calls. The  M201_SP.DLL  is very easy to interract with using LabView. I've shown an example of setting up for a call as one can see within the images further down within this document. When the sample application is run, and if the option to use the M201_SP.INI configuration file is not used, the scan data will be output to ScanLog_0.txt. An example of what he contents of that logfile will look like after a run, look  HERE

I think for LabView programmers, a "picture is worth a thousand words" so here are the   pictures :


































































The Screenshots
Quick jump to
About this document     Log File sample



 
Front Panel
-- of main.vi --

This is a main panel which can be used to access each of the modules included in the sample application. Each of the modules is independent and can be controlled from their own front panels, for example you can load the   RunOrStop.vi   into LabView, click it's "Run" button and providing you have a Model 201 connected and are connected to COM-1 the device will start scanning and writing it's data to a log file, "ScanLog_x.txt" without any further interraction. However, it will continue to write to that file until you click the "Stop" button or exit the application. The data can also be written to memory which the application can read from in order to display the data on the screen - as a graph for example. To set the data logging method, simply make a call to   EX_SetDataLogOptions .

Shown in the panel above, channel 7 was selected and then the "GetOneVoltage" button was pressed with the results being shown in the box as "-0.00001". Since the setting of the channel was the first command issued, and automatic   sign on  was performed by the DLL.





Diagram
-- used by main.vi --

This screenshot shows access to the various VI's. I've used a lot of "sequence frames" just to keep everything related to a single VI grouped together, and there is obviously a lot hidden from view. There are also a lot of "case frames" and boolean controls to control all the buttons and LED's on the front panel. However, access to each of the VIs is extremely simple, and interraction between the VIs and DLL is likewise very simple.





Diagram
-- going from main.vi to RunOrStop.vi --

This screenshot shows the sequence from   main.vi   making the call to   RunOrStop.vi,   and a shot of the configuration screen used to configure the call to EX_Run( ) within  M201_SP.DLL.

































































Sample Log File
Quick jump to
About this document     Screenshots



Time / s   	0 - 0    	
00000.0   	1.4847893	
00000.1   	1.4847744	
00000.2   	1.4847792	
00000.3   	1.4847816	
00000.3   	1.4847762	
00000.4   	1.4847774	
00000.5   	1.4847816	
00000.6   	1.4847816	
00000.7   	1.4847732	
00000.8   	1.4847816	
00000.9   	1.4847792	
00001.0   	1.4847720	
00001.0   	1.4847762	
00001.1   	1.4847726	
00001.2   	1.4847786	
00001.3   	1.4847738	
00001.4   	1.4847726	
00001.5   	1.4847762	
00001.6   	1.4847726	
00001.7   	1.4847828	
00001.7   	1.4847762	
00001.8   	1.4847792	
00001.9   	1.4847762	
00002.0   	1.4847756	
00002.1   	1.4847792	
00002.2   	1.4847780	
00002.3   	1.4847714	
00002.4   	1.4847756	
00002.4   	1.4847798	
00002.5   	1.4847756	
00002.6   	1.4847786	
00002.7   	1.4847738	
00002.8   	1.4847792	
00002.9   	1.4847786	

Minimal System Interval:	0.08678
Applied Interval:        	0.08704
Subcycles averaged:      	35
Started:                 	Fri Nov 05 14:41:36 2004
Finished:                	Fri Nov 05 14:41:39 2004
Experiment Description:  	none







Contact us for sales or technical assistance
lawsnlab@lawsonlabs.com

on the web
www.lawsonlabs.com

© Lawson Labs Inc. All rights reserved
Last modified 1-13-05 Tim Van Dusen