home *** CD-ROM | disk | FTP | other *** search
-
- LabWindows/CVI, Version 4.0.1
- Sample Programs
- Documentation File
- (c) Copyright 1994-1996 National Instruments Corporation.
- All rights reserved.
-
- Product and company names listed are trademarks
- or trade names of their respective companies.
-
-
- LabWindows/CVI comes with many sample programs to help you learn and
- understand key concepts of LabWindows/CVI. You can use these programs
- as starting points for your applications. The following brief description
- of the sample programs matches the directory structure of the samples
- sub-directory in the main CVI directory. If you are viewing this file
- with the Windows Notepad application, you can use the Search option to
- search for specific keywords or functions you want to learn about.
-
-
- ANALYSIS (Advanced Analysis Only)
- ---------------------------------
-
- convolve.prj - demonstrates the Convolve and Deconvolve functions in the
- Advanced Analysis library. Two sets of controls specify the number of
- points, cycles, wave type, and amount of noise of of each of the two
- input signals. The program displays the two signals on the upper two
- graphs and the convolve and deconvolve of the signals on the lower
- graphs.
-
- correlat.prj - demonstrates the Correlation function in the Advanced
- Analysis library. Two sets of controls specify the number of points,
- cycles, wave type, and amount of noise of of each of the two input
- signals. The program displays the two signals on the upper two graphs
- and the correlation on the lower graph.
-
- interp.prj - demonstrates the use of the PolyInterp, RatInterp and
- SpInterp functions in the Advanced Analysis Library. The user generates
- a series of points to use as the known values in the array. The points
- can be generated randomly or entered graphically with the graph cursor.
- The interpolated points and error range is graphically displayed over
- the series of points.
-
- mode.prj - illustrates using of the Histogram and Mode functions in the
- Analysis libraries. The mode value is defined as the value that most
- often occurs in a given set of samples.
-
- nonlnfit.prj - illustrates how to use the Nonlinear Fit function in the
- Advanced Analysis Library. The user specifies a particular data
- function to generate data from and a function to fit the data to.
- Gaussian noise can be added to the generated data to simulate actual
- acquired data. A nonlinear fit is then generated and plotted and the
- parameters of the best fit are also displayed.
-
- peak_est.prj - use the AutoPowerSpectrum and PowerFrequencyEstimate
- functions in the Advanced Analysis library. The top graph displays an
- input signal in the time domain and the bottom graph displays the power
- spectrum of the filtered input signal. Using the graph cursor the peak
- frequency and its power can be calculated at different displayed
- frequency peaks.
-
- phasedif.prj - demonstrate the calculatation of the phase difference
- between two sine waves. The number of points, cycles, and phase of two
- input sine waves are configurable.
-
- pulse.prj - demonstrates the PulseParam function in the Advanced
- Analysis library. The pulse waveform can be generated randomly or
- manually. Data returned from the Pulse function is displayed on the main
- panel.
-
- windowng.prj - illustrates the different windowing functions available
- in the Advanced Analysis library. Two combined sinusoidal waveforms, one
- of which has an amplitude greater by a factor of 1000, are displayed in
- the frequency domain on either a linear or log scale. Two different
- windowing functions can be applied in parallel to compare the different
- effects in the frequency domain.
-
- APPS
- ----
-
- atedemo.prj - illustrates how an automated test sequence can be
- implemented with LabWindows/CVI. This program will ask the user to
- input some test characteristics and then will run a test sequence while
- displaying a test log on the screen.
-
- freqresp.prj - generates a frequency response for a Butterworth bandpass
- digital filter and performs curve fitting on the plotted points. This
- example illustrates the use of basic CVI User Interface controls such as
- knobs, graphs and numeric displays. This program assumes that the CVI
- Advanced Analysis library is installed.
-
- iconedit.prj - illustrates how CVI can be used to create other
- applications not related to test and measurement. This particular
- program implements a simple bitmap editor which can be used to
- create Windows icons.
-
- life.prj - A simulation of life. Place cells on the canvas and see
- what evolves. Based on a simple set of rules, new cells will grow and
- old ones will die out. This program illustrates the use of batch drawing
- on the canvas control.
-
- lissa.prj - is an interesting and fun application program that shows how
- to use some basic controls in a Graphical User Interface built with
- LabWindows/CVI. This application displays various Lissajous
- figures obtained by plotting two different periodic functions opposite
- to each other on a graph. Important features presented here are the
- usage of signal generation functions and the ability to
- save and load the current control settings.
-
- lockout.prj - illustrates how a CVI panel window can be configured so it
- cannot be switched from or closed by a user. This application disables
- the Windows task switching feature (accessed with the Alt-Tab keys) by
- using the DisableTaskSwitching function, maximizes the panel and removes
- the minimize/maximize icons of the CVI window.
-
- mandel.prj - interactively displays Mandelbrot images (fractals) with
- the intensity plot function. New and interesting fractal regions can be
- explored by changing the plotting coordinates with the graph cursors.
- It allows users to experiment with the different interpolation options
- and save favorite plot settings.
-
- marquee.prj - is a sample program that prints a moving banner on the
- screen. The GUI for this application is built programmatically with
- functions such as NewCtrl and NewMenu. The speed of the
- moving banner is modified by changing the rate at which the periodic
- idle events occur.
-
- scopedem.prj - is a sample program that simulates an oscilloscope with two
- channels and variable settings for gain and timebase. A waveform can be
- saved to disk and then viewed with the notepad application. An instrument
- driver provides additional functions needed by this program. The instrument
- driver is located in the instr directory and is named scope.fp.
-
- sigproc.prj - is an application program that generates a signal and then
- conditions it with various filters. This program uses the CVI Advanced
- Analysis library.
-
- spectrum.prj - is a frequency analysis program designed to perform
- fourier analysis on either a simulated analog signal or an analog signal
- acquired through a DAQ board. The sampled signal is continuously
- displayed in an upper graph while the simulation or data acquisition is
- enabled. The user may view either the power spectrum of the signal or
- the windowed and filtered time waveform on a lower graph. The signal
- may be filtered with either FIR or IIR lowpass, highpass, bandpass, or
- bandstop filters. The filter and data aquisition features can also be
- customized. This program assumes that the CVI Advanced Analysis library
- is installed.
-
- tempsys.prj - is a simple temperature monitor program. This application
- generates random temperature readings and displays them on a strip chart
- in continuous mode. Statistical processing is
- done on the random samples and a histogram is then displayed in a graph
- control with vertical bar display.
-
- update.prj - is an application program that simulates an oscilloscope
- display to illustrate how the update rate of a plot function is related
- to the length of the buffer being displayed and the type of chart used.
- The waveforms can be displayed on a graph control with or without smooth
- update and on a strip chart control with sweep, continuous or block
- updating.
-
- workshop.prj - is an application that allows the user to modify an image
- in PCX format with the Windows Paintbrush application and then re-
- display it on a CVI panel. The program makes use of the
- LaunchExecutable function to run the Paintbrush application. The
- program also demonstrates the usage of SystemHelp function to display
- Windows-type help for a CVI application.
-
- uirview\uirview.prj - is an application that allows the user to display
- and snapshot UIR file panels. The user can change some panel attributes
- dynamically, copy an image of the panel to the clipboard or save the
- bitmap image to a BMP file. UIR callbacks are not necessary to load a
- user UIR file.
-
-
- CUSTCTRL
- --------
-
- A set of sample programs is provided to demonstrate the use of the ECHO
- control instrument drivers in the toolslib directory, such as the
- password control and the DAQ controls. See toolslib.doc for the
- location of these sample programs and for a description of each
- instrument driver.
-
-
- DAQ
- ---
-
- Note: The following programs are not part of the LabWindows/CVI
- software distribution. These programs will be installed with the latest
- NI-DAQ software for PC compatibles. If you do not have a daq sub-
- directory in the samples directory then you must install the NI-DAQ
- software first to access these
- programs. The NI-DAQ software is available free of charge from National
- Instruments.
-
- aiaoxmpl.prj - shows how single channel analog input/output is done. It
- uses the AI_Read and AI_Write functions.
-
- daq_op.prj - illustrates a single channel synchronous data acquisition.
- It uses the DAQ_Op function to acquire the binary data and the
- DAQ_VScale function to scale the binary data to voltage units.
-
- daqstart.prj - shows how a single channel asynchronous data acquisition
- is done. It uses the DAQ_Start function to start the acquisition and
- then monitors the acquisition progress from a main callback routine with
- the DAQ_Check function.
-
- dblbuffer.prj - demonstrates a double buffered data acquisition. A pop-
- up panel is used to configure settings for the DAQ board.
-
- digital.prj - is a simple digital I/O example. It uses the DIG_In_Line,
- DIG_Out_Line and also the port write & read functions to turn on or off
- LED controls on the user interface. The ports are configured as output
- or input with the DIG_Prt_Config function.
-
- dqdbxmpl.prj - shows a double buffered data acquisition to disk.
- This project does not have a user interface file and it builds the GUI
- programmatically.
-
- eventcnt.prj - is a counter and timer example. This example uses the
- counters on a data acquisition board to count signal edges. A main
- callback routine is used to read the accumulated events periodically
- with the CTR_EvRead function.
-
- freqmeas.prj - demonstrates how the frequency of an input analog signal
- can be measured with the CTR_ functions. This example makes use of most
- of the CTR_ functions available in the Data Acquisition library.
-
- ictr.prj - shows how to use the interval counter functions (ICTR_
- calls).
-
- scan_op.prj - is an example of a two channel synchronous data
- acquisition. It uses the Scan_Op function to read data from two
- channels and then the Scan_Demux function to re-order the data for
- graphical presentation.
-
- scxiread.prj - performs a single SCXI channel analog input. This
- example shows the usage of basic SCXI functions.
-
- scxiscan.prj - illustrates SCXI channel scanning in multiplexed or
- parallel mode. This can be used with multiple modules and multiple
- channel gains.
-
- scxitemp.prj - reads an analog input signal from a thermocouple,
- converts the voltage to temperature using an instrument driver and
- displays the running temperature on a strip chart.
-
- wfmout.prj - is an example of how to use the WFM_Op function to generate
- a waveform asynchronously.
-
- Note: The following data acquisition programs will be available in the
- NI-DAQ version 4.6.1 and later releases. To find out what version of
- NI-DAQ you have you can run the Get_NI_DAQ_Version function in the Data
- Acquisition library.
-
- bufgpctr.c - illustrates the use of dual dma channels to acquire data
- using buffered GPCTR functions on E Series boards.
-
- eqvtimsm.c - illustrates the Equivalent Time Sampling technique, which
- allows you to sample a repetitive input signal at an effective rate of
- 20MHz.
-
- rtchgfly.c - illustrates a method for acquiring an array of voltage data
- asynchronously, using general purpose counters for timing.
-
- scxi_vrd.prj - uses the SCXI Analog Input Instrument driver to acquire a
- single analog input voltage from an SCXI module. It also uses the
- channel string input to define the chassis, module, and
- channels used.
-
- scxichrt.prj - uses the SCXI Analog Input Instrument driver to acquire a
- voltage from multiple SCXI channels. It uses the channel string input
- to define the chassis, module, and channels used.
-
- scxicont.prj - uses the SCXI Analog Input Instrument driver to acquire a
- continuous voltage from multiple SCXI channels. It uses the channel
- string input to define the chassis, module, and channels used. This
- example illustrates double buffering in conjunction with SCXI functions.
-
- scxi_op.prj - uses the SCXI Analog Input Instrument driver to acquire a
- voltage waveform from multiple SCXI channels. It uses the channel
- string input to define the chassis, module, and channels used.
-
- scxi_tc.prj- uses the SCXI Analog Input Instrument driver to acquire a
- temperature reading from multiple SCXI channels. It uses the channel
- string input to define the chassis, module, and channels and a
- temperature conversion instrument driver to convert voltages to the
- correct temperature values.
-
- scxitrig.prj - is identical to scxi_op.prj with the option of digital
- triggering enabled.
-
- use3dma.prj - illustrates the use of the DAQ double buffered analog
- input functions for acquiring voltage data continuously.
-
-
- DDE
- ---
-
- EXCEL
-
- ddedemo.prj - is an example of how to use the Dynamic Data Exchange
- (DDE) library functions to communicate with another Windows application.
- The program passes data between Microsoft Excel and LabWindows/CVI via a
- warm DDE link. If you have Excel, launch it before you run this example
- and load in the LWCVI.XLS file found in the same directory as the
- project.
-
- ddeexcel.prj - uses the DDE functions to execute commands in a Microsoft
- Excel application. The commands illustrated are: OPEN sheet, CLOSE
- sheet, RUN macro, and QUIT Excel. These commands are executed from
- LabWindows/CVI with the ClientDDEExecute function.
-
-
- MISC
-
- prgmndde.prj - is an example of a DDE connection with the Windows
- Program Manager application. The program acts as a DDE client and, once
- connected to the Program Manager which acts as a server, it allows the
- user to create a new program group and items directly from
- LabWindows/CVI. This program uses the ClientDDEExecute function to send
- commands to the Windows Program Manager.
-
- srvclt.prj - illustrates client/server communication with the DDE
- functions. The program spawns two other programs, a server and a
- client, that communicate via a hot DDE link. The server, in this case,
- generates some waveform data which is then passed to the client to be
- plotted on a graph. The client can read data and execute various
- commands from the server. An important note about the Windows DDE
- limitation is included as a comment at the top of the server.c file.
-
- VBASIC
-
- cvidde.prj - demonstrates the use of DDE functions to communicate with
- a program written in Visual Basic. This CVI program implements both a
- client and a server which communicate with a Visual Basic server and
- client, respectively. This program requires that a Visual Basic
- application is running in the background. The necessary Visual Basic
- files are included in the same directory with the CVI program.
-
-
- DLL (Windows 95 and Windows NT Only)
- ------------------------------------
-
- CVITEXT
-
- cvitext.prj - creates a simple dll that draws text on a CVI panel using
- SDK functions.
-
- useit.prj - demonstrates the calling of the cvitext.dll by using an
- import library. You must create the dll and import library first by
- opening cvitext.prj and selecting "Create Dynamic Link Library" in
- the Build menu.
-
- SIMPLE
-
- In each of five subdirectories are the files necessary to build a dll
- in cvi or one of the four external compilers (msvc, borland, watcom, and
- symantec), and a cvi project (simple.prj) which uses the dll as described
- below.
-
- mydll.prj - creates a dll and import library which has three different
- exported functions. One function illustrates how a dll can be called to
- display and operate a UIR file independent of the calling program. Two
- other functions illustrate the ability to export a function as either
- stdcall or cdecl.
-
- simple.prj - demonstrates the calling of mydllÆs exported functions.
- You must create the dll and import library first by opening mydll.prj
- and selecting "Create Dynamic Link Library" in the Build menu.
-
-
- DLL (Windows 3.1 Only)
- ----------------------
-
- 32BITDLL
-
- tstdll32.prj - shows how a 32-bit DLL can be imported in LabWindows/CVI.
- The glue code necessary for this DLL differs from the glue code for a
- 16-bit DLL and the differences are pointed out in the glue code file
- (dll32glu.c). The DLL was created with the Watcom C 32-bit compiler.
- At this time, the only 32-bit DLLs supported in LabWindows/CVI are the
- ones created with the Watcom compiler.
-
-
- CALLBACK
-
- useit.prj - This sample illustrates:
- 1. Calling CVI functions from a DLL (callbacks)
- 2. Converting pointers received from the DLL
- - pointers that point to CVI data
- - pointers that point to DLL data
- 3. Use of a pth file because the DLL filename is not the same as the
- glue code filename.
-
-
- CVITEXT
-
- useit.prj - This dll is an example of how to draw text onto a CVI panel
- from a DLL.
-
-
- DPMILOCK
-
- dpmilock.prj - illustrates the use of DPMI to lock a buffer in memory.
- One of the restrictions for a 16-bit DLL to work with LabWindows/CVI
- is that a buffer should not be locked in memory with the GlobalPageLock
- function available in the Windows SDK library. The function will fail
- on buffers already allocated with the malloc function in LW/CVI. Any
- DLL using GlobalPageLock function should be modified to use DPMI calls.
- The usage of DPMILock and DPMIUnlock functions is shown in this sample
- program. The source code for these functions is included in the DLL
- (dpmilock.dll) which is not shown in the project list, but is loaded
- through its associated glue code (dpmiglue.obj) and the dpmiglue.pth
- file. You can use these functions and the glue code to replace the
- GlobalPageLock function in your own DLL.
-
-
- FLOATDLL
-
- fltstapp.prj - shows the modifications needed to be made to a DLL that
- performs floating-point operations. If a DLL is compiled with the /Fpi
- or /Fpc switches, then the DLL uses the WIN87EM.DLL floating-point
- emulator. LabWindows/CVI does not use this emulator so the status of
- the co-processor registers are lost when the DLL performs floating-point
- operations. This example shows how the DLL should perform the floating-
- point operations in order to be able to work in CVI. The DLL is loaded
- directly by being listed in the project list. The source code for the
- DLL is located in the same directory as the other project files.
-
- INTRPTR
-
- intrptr.prj is an example of how to modify a 32 bit memory buffer
- allocated by a CVI program from an interrupt routine in a 16 bit dll.
- The program uses the Alloc16BitAlias() function to allocate a selector
- which can access CVI's 32 bit memory area during an interrupt service
- routine.
-
-
- SIMPLE
-
- simple.prj - This dll is an example of how to create a simple DLL which
- will popup a Windows Message Box.
-
-
- WINMSG
-
- winmsg.prj - is an example of communication between LabWindows/CVI and
- an interrupt routine in a 16-bit DLL. The program installs a callback
- routine, with the RegisterWinMsgCallback function, which will be entered
- when a Windows message is passed back to CVI from the DLL. The DLL will
- trap a keyboard interrupt and then post the message to LabWindows/CVI.
-
-
- EASYIO
- ------
-
- This directory contains sample programs that use the Easy I/O for DAQ
- Library.
-
- ai_acq.prj - performs a timed analog acquisition using
- AIAcquireWaveforms() and plot the results to a graph.
-
- ai_async.prj - performs an asynchronous timed analog acquisition using
- AIStartAcquisition(), AICheckAcquisition(), AIReadAcquisition(), and
- AIClearAcquisition(). If you configure a trigger mode using the
- "Triggering" button on the user interface, AIAcquireTriggeredWaveforms()
- is called
- repetitively.
-
- ai_cmd.prj - allows you to embed commands into the channel string to set
- the upper and lower limits on individual channels as well as the inter-
- channel sample rate. See the function panel help for the Channel String
- parameter of AISampleChannels() for details.
-
- ai_ets.prj - demonstrates an acquisition using the Equivalent Time
- Sampling technique. ETS can be used on an E-Series DAQ device to
- achieve an effective acquisition rate of up to 20 MHz. See the
- functiona panel help for the Trigger Type parameter of
- AIAcquireTriggeredWaveforms() for details. The graph shows both the ETS
- waveform and the "internal" waveform that was sampled using internal
- timing so that you can compare them.
-
- ai_samp.prj - reads analog input channels using AISampleChannels() and
- plots the results to a strip chart.
-
- ao_wave.prj - performs an asynchronous timed analog waveform generation
- using OGenerateWaveforms() and AOClearWaveforms(). A waveform editor is
- provided on the panel for customizing the waveform. This program also
- incorporates the functionality of ai_async.prj. You can tie the analog
- output channel to the analog input channel in order to acquire and view
- the waveform that is generated.
-
- ctr_evt.prj - uses a DAQ-STC or Am9513 counter to count TTL edges of the
- signal on the specified counter's SOURCE pin or the number of cycles of
- a specified internal timebase signal. When the internal timebase is
- used, CounterEventOrTimeConfig() in conjunction with CounterStart() and
- CounterRead() can be used to make more precise timing measurements than
- with the Timer() function. If you select "Use Counter Source" from the
- Source/Timebase control, you must supply a TTL signal to the SOURCE pin
- of this counter.
-
- ai_log.prj - logs data to disk while asynchronously acquiring data.
- Data can be stored in ASCII format for importing into a spreadsheet or
- stored as binary to optimize for speed.
-
- ctr_freq.prj - uses a DAQ-STC or Am9513 counter to measure the frequency
- of a TTL signal on the specified counter's SOURCE pin by counting rising
- edges of the signal during a specified period of time.
-
- ctr_perd.prj - configures a DAQ-STC or Am9513 counter to measure the
- pulse width or period of a TTL signal connected to its GATE pin. The
- measurement is done by counting the number of cycles of the specified
- timebase between the appropriate starting and ending events. The higher
- the timebase frequency, the greater the measurement accuracy will be.
- This example incorporates the functionality of ctr_puls.c as a pulse
- generator so you can tie the OUT pin of the counter that is generating
- pulses to the GATE of the counter performing pulse measurement.
-
- ctr_puls.prj - configures a DAQ-STC or Am9513 counter to generate a
- continuous TTL pulse train or a delayed TTL pulse on its OUT pin. This
- project also incorporates ai_async.c and ai_async.uir so that you can
- monitor the pulses on an analog input channel.
-
- ctri_pls.prj - This module shows you how to use an 8253 counter on the
- Lab boards, SCXI-1200, DAQPad-1200, PC-LPM-16, or the DAQCard-700 to
- generate square waves and single pulses. There are some external
- connections that need to be made on your DAQ device for proper operation
- of this example. The connections are detailed in the Instructions
- section of ctri_pls.uir.
-
- SIMPLE
-
- This directory contains simple sample programs that use the Easy I/O for
- DAQ Library. The goal of these projects is to introduce DAQ
- concepts using a minimal amount of source code.
-
- ai^acq.prj - performs a timed analog acquisition using
- AIAcquireWaveforms() and plot the results to a graph.
-
- ai^async.prj - performs an asynchronous timed analog acquisition using
- AIStartAcquisition(), AICheckAcquisition(), AIReadAcquisition(), and
- AIClearAcquisition().
-
- ai^log.prj - logs data to disk while asynchronously acquiring data. Data
- can be stored in ASCII format for importing into a spreadsheet or stored
- as binary to optimize for speed.
-
- ai^samp.prj - reads analog input channels using AISampleChannels() and
- plots the results to a strip chart.
-
- ai^trig.prj - calls AIAcquireTriggeredWaveforms() repetitively and
- displays triggered data on a graph.
-
-
- EXTCOMP (Windows 95 and Windows NT Only)
- --------------------------------------
-
- UIRCBCKS
-
- In each of four directories are the files necessary to build an
- executable in one of the supported external compilers which makes
- use of the cvi run-time dll and a .uir file.
-
-
- FILEIO
- ------
-
- fileio.prj - demonstrates a basic file I/O operation. This sample
- program generates a waveform and stores the data to a file in either
- ASCII or binary format. Another subroutine reads the file and re-
- displays the waveform. The program makes use of the ArrayToFile and
- FileToArray functions to write and read from the file.
-
- Note: The usage of the FmtFile and ScanFile functions along with other
- format and scan functions is documented with numerous examples in the
- "Formatting and I/O Library" section of the Standard Libraries Reference
- Manual.
-
-
- GPIB
- ----
-
- gpibrw.prj - implements a simple GPIB application. This program will
- send commands to a selected GPIB address and receive data from the
- device at that address. If no GPIB device is connected you can select
- to send commands to the GPIB controller board to verify its operation.
- This program makes use of GPIB device functions such as ibwrt and ibrd
- and board functions such as ibic.
-
-
- PRINTING
- --------
-
- hires.prj - is a sample program that makes use of the PrintGraphHiRes
- function to print a strip chart in high resolution format. The program
- will print two graphs on the default printer showing how the printout
- looks before and after using the PrintGraphHiRes function. This program
- uses the High Resolution Printing instrument driver which is provided in
- the toolslib\printing directory.
-
-
- RS232
- -----
-
- serial.prj - illustrates a typical communication with a RS-232 device.
- This program will send commands to a serial device and receive data
- through the serial port. The port to be used in communication can be
- configured for speed, handshake and other parameters. Some of the
- functions used are OpenComConfig, ComWrtByte and ComRdByte to open the
- serial port, write and read from it, respectively.
-
-
- SOUND
- -----
-
- sndplay.prj - a demonstration of how to play .WAV files in MS Windows.
- The program displays a listing of .WAV files in a directory and allows
- you to play them using your sound card or PC speaker (it is assumed that
- you have the proper drivers installed). In Windows 3.1, this program
- uses the playsnd.fp instrument from the cvi\toolslib\sound directory. In
- Windows 95 and Windows NT, this program uses the Windows SDK multimedia
- library directly to achieve the same result.
-
-
- TCP
- ---
-
- tcpserv.prj - demonstrates how to use functions in the TCP library to
- set up TCP server to which a client can connect via TCP protocol. The
- program implements a talk application which allows two users connected
- via TCP to communicate back and forth. The server program can both
- receive and send data to the client. The program makes use of the
- RegisterTCPServer function to activate the TCP server and ServerTCPWrite
- to write data to the client.
-
- tcpclnt.prj - demonstrates a TCP client implementation. The client
- connects to the server started by the tcpserv.prj program, accepts
- commands from the user interface and sends them to the server via TCP.
- The client will also receive any data coming from the server. This
- example makes use of functions such as ConnectToTCPServer,
- ClientTCPWrite and ClientTCPRead to communicate with the server.
-
-
- USERINT
- -------
-
- 2yaxis.prj - shows how to use left and right Y axes on the same
- graph and how graph cursors can be assigned to the two axes.
-
- autostrp.prj - demonstrates how you can autoscale the Y-axis on a
- strip chart. The UI library supports autoscaling only on graphs,
- not on strip charts. This program simulates autoscaling by storing
- the data before sending it to the chart, and then using SetAxisRange
- to modify the Y-axis as needed.
-
- build.prj - is a simple program that generates a random number and
- displays it on a numeric indicator. The GUI for this application is
- created programmatically.
-
- callback.prj - shows the use of the callback programming model in CVI as
- opposed to the event-loop model. This program generates a set of random
- numbers and plots them on a graph control with the PlotY function. The
- user interface events are processed by callback functions associated
- with a control.
-
- canvas.prj - demonstrates drawing on a Canvas control, including objects
- such as arcs, rectangles, polygons, lines, ovals and bitmaps.
-
- canvsbmk.prj - shows the increase in speed you can achieve by using
- a canvas control control instead of a graph control for drawing objects
- such as arcs, rectangles, polygons, lines, ovals and bitmaps.
-
- chart.prj - demonstrates the use of a strip chart control. The program
- plots three randomly generated traces on the same chart which is
- continuously updated by the callback function of a timer control.
-
- clipbord.prj - demonstrates how to use the clipboard functions to transfer
- images and text to and from the system clipboard.
-
- cursors.prj - demonstrates the use of cursors on a graph. This program
- allows the user to move a set of different style cursors, obtain their
- x-y coordinates and zoom in on a region delimited by the cursors.
- Functions such as GetGraphCursor, SetGraphCursor and SetAxisRange are
- used.
-
- drawpad.prj - shows how to use a canvas control as a drawing port or
- scratch pad for the mouse.
-
- events.prj - shows how to recognize many of the low-level events and
- event-related information that LabWindows/CVI passes from the user
- interface to the user program. This program uses control and panel
- functions to process the events as they pass through the hierarchy of
- callback functions. Event specific information such as the x-y
- coordinate of a mouse click is displayed in a text box control.
-
- getusrev.prj - shows the event loop programming model. Although the
- callback function model is much more flexible and easy to use, the event
- loop model can be used to advantage in certain applications (such as
- modal dialog boxes). LabWindows for DOS programs use the event loop
- model exclusively. Thus, programs translated from LW/DOS use the event
- loop model unless you restructure them to use the callback model.
-
- graphs.prj - is an application program that makes use of most of the
- plot functions, such as PlotY, PlotLine and PlotWaveform, to display
- various lines and shapes on a graph control. Colors can be
- interactively changed with the use of a color numeric control.
-
- imagedit.prj - this is a very simple program which modifies the colors
- of an existing image. It loads an image loading them into a picture ring
- and then makes use of the GetImageBits and SetImageBits functions.
-
- intgraph.prj - this shows the different ways in which intensity plots
- can be used in a graph. It allows you to experiment with the different
- interpolation options as you plot a semi-random block of data.
-
- io.prj - is a very simple program that makes use of the standard I/O
- window through C calls such as printf and scanf.
-
- keyfiltr.prj - demonstrates how to alter a control's behavior by
- responding to keypress events. The program displays a string control
- and modifies how it handles keyboard input according to options selected
- using checkboxes.
-
- listbox.prj - demonstrates how to add and delete items from a list box
- control with functions such as InsertListItem and DeleteListItem.
-
- listdelx.prj - shows how to add items of different colors to a list box
- control. Appropriate escape characters in a string can control its
- background and foreground colors as well as the positioning in the list
- box. A list of the available escape sequences can be found in the help
- for the Item Label parameter in the InsertListItem function panel.
-
- menus.prj - shows how menu bars can be created and used in a CVI
- application. The pull-down menus have cascade options and hot keys
- associated with them. Menu callback functions are used to process the
- menu selections. A text box control is used to display a help note.
-
- moustate.prj - show how to use the GetGlobalMouseState and
- GetRelativeMouseState functions. These functions can be used to
- determine the current position of the mouse or the current state of the
- mouse buttons or SHIFT and CTRL keys on the keyboard.
-
- panels.prj - demonstrates how to load multiple panels and sub-panels. The
- sub-panels are windows owned by another panel.
-
- picture.prj - demonstrates how picture controls can be used to enhance a
- user interface. The user interface displays two PCX images imported
- into two picture controls. The two images are placed on top of each
- other and, when a left click event occurs on the picture control, a
- callback function is called to hide the current image and display the
- other.
-
- piedemo.prj - demonstrates the use of a canvas control to draw a pie
- chart using an instrument driver.
-
- popups.prj - shows most of the popup panels that can be used in
- LabWindows/CVI. Functions such as FileSelectPopup and MessagePopup are
- used in a short user tutorial.
-
- textbox.prj - demonstrates how a text box control can be used in CVI to
- display help and status information. Various actions that could be
- performed on a text box are shown, such as how to add a new line of
- text, how to insert and how to delete text.
-
- timeaxis.prj - demonstrates the use of arbitrary axis labels for a graph.
- Notice that X-axis labels are labeled as time increments instead of integer
- values. For this example, each point on the graph represents 1 second.
- Moving the graph cursor on the graph with the mouse will update the time
- value displayed in the Graph Details area of the panel.
-
- timerctl.prj - demonstrates how a timer control can be used to
- continuously update a strip chart. The strip chart is updated even when
- other controls are operated or when the strip chart is obscured by a
- popup panel.
-
-
- UTILITY
- -------
-
- physdemo.prj - is a sample program which shows how to access physical
- memory from LabWindows/CVI. This program makes use of the
- ReadFromPhysicalMemory and WriteToPhysicalMemory functions, found in the
- Utility library, to read and write to an absolute address in memory (in
- this case the monochrome display memory).
-
-
- WIN32 (Windows 95 and Windows NT Only)
- --------------------------------------
-
- oneinst.prj - demonstrates how to use a new function available in
- the Windows 95 and NT versions of CVI to insure that only one instance
- of your application will be running on your computer at a time.
-