We will then used some advanced Excel features to further customize the report, specifically, annotate the min and the max data points on the graph. During the process of report generation, several types of handles to various resources will be generated. It is important to identify how these resources will be dealt with in case of errors or failures.
One macro defined in cviauto. It is very important to discard these handles or any other handles generated during the report generation process to ensure no leaks occur. First we need to launch Excel and create a new workbook for this report using the following functions from the Excel Reports library. It will end up looking like the following in Excel:. Now that we have the handle to the worksheet, we can start writing some data to it:. Now that we have our headers, we can send all the raw and filtered data to Excel.
I used a 2D array and broke it down into multiple calls, but you can easily specify a 2D range in Excel and write the entire array in one call. Now Excel has all the data is needs and we can now start charting our data. This will generate the following type of chart:. See the function documentation for more information. You can then use the chart handle generated by this function and perform the same type of manipulations described here.
Microsoft Excel allows you to record your mouse-clicks and keystrokes as you manipulate the workbook and then play it back later. These commands are stored as macros in the workbook. Sometimes you might be manipulating an existing report template which already contains some code stored in the form of macros. When you run a macro, Excel plays back your actions as if you had just entered the commands yourself.
Initialize: This function initializes the instrument and sets it to a default configuration. Configuration Functions: Class This class of functions configures the instrument by setting acquisition and system configuration parameters. It also provides functions which allow the user to determine the current status of the instrument. Utility Functions: Class This class of functions provides lower level functions to communicate with the instrument, and change instrument parameters.
This content is not available in your preferred language. Environment shows products that are verified to work for the solution described in this article. This solution might also apply to other similar products or applications.
An instrument driver is a set of software routines that control a programmable instrument. Each routine corresponds to a programmatic operation such as configuring, reading from, writing to, and triggering the instrument.
Instrument drivers simplify instrument control and reduce test program development time by eliminating the need to learn the programming protocol for each instrument. If you find one, follow the procedure below to load it into CVI You can load and unload instrument drivers manually using the Instruments Folder in the Library Tree or using the Instrument menu.
Agilent Function Tree Layout For example, if you double-click on the Initialize function, that function panel will open. Performs an identification query on the instrument. Resets the instrument to a known state. Sends initialization commands to the instrument that set any necessary programmatic variables such as Headers Off, Short Command form, and Data Transfer Binary to the state necessary for the operation of the instrument driver.
Returns an Instrument Handle which is used to differentiate between different sessions of this instrument driver. Each time this function is invoked a Unique Session is opened. It is possible to have more than one session open for the same resource. This content is not available in your preferred language.
Environment shows products that are verified to work for the solution described in this article. This solution might also apply to other similar products or applications. Advanced Debugging in CVI with TestStand In addition to monitoring leaked objects after execution has completed, you can also see an up-to-date representation of resources in memory using breakpoints.
Open a service request. Purchase or renew support services. Was this information helpful?
0コメント