The PlotXvsY method requires the x and y data in separate parameters. Use the PlotXvsY or PlotXY method to associate x data with y data rather than letting the graph automatically create an x value based on an increment. Note: Use the Measurement Studio Reference, which is available from your Windows Start menu, to get complete reference information on the CWGraph control and setting properties, calling methods, passing parameters, and defining events.įigure 2 shows the x-axis correctly representing time in secondsįigure 2. Use the third parameter ( xInc) on the PlotY method to specify the correct increment along the x-axis between each y value. The Plot and Chart methods have optional parameters that you can use to exactly specify how you want data to be visualized. The x-axis data does not correctly reflect the actual relative time the data was collected because the actual time period between each sample is 0.01 seconds (100 Hz). The temperature data shown in Figure 1 is plotted on the y-axis while the x-axis is automatically incremented by one unit for each y value plotted. In your program, replace simulation with actual data acquisition. Throughout this application note, several similar functions are used to simulate different types of measurements. Note: The GenerateTemperatureData function generates a one-dimensional array of values to simulate acquisition of temperature measurements. 'Generate random data to simulate 800 temperatureĭata = GenerateTemperatureData(800, 230#) The following example plots the engine temperature data when a user presses the Display Data button in the program shown in Figure 1: For example, imagine that you are collecting a single set of engine temperatures at a rate of 100 Hz. The Plot methods display real-time data acquired at relatively fast speeds or with a single acquisition. New data is appended to an existing plot, and you can preserve historical data in the graph. See the following section on Plotting Data. Download the Visualizing Data in Visual Basic example and read this application note at your computer so you can test the concepts and example. Note: This application note is designed to teach you how to visualize two-dimensional data with the CWGraph control through interactive discussion and examples. Customize the graph to look exactly the way you want it to look. Plot acquired signals and chart historical data.By the end of the application note, you will be able to: This application note describes how to work with the CWGraph control interactively in its property pages and programmatically using Visual Basic code. The Measurement Studio Visual Basic tools were formerly known as ComponentWorks. Note: Measurement Studio includes tools to build measurement applications in ANSI C, Visual C++, and Visual Basic. The Measurement Studio Graph (CWGraph) ActiveX control is a flexible tool that you can use in any ActiveX control container to visualize and interact with two-dimensional data in the way that is most meaningful to you. Real-time charting of engine temperatures during a test, plotting dynamic signals measured on a circuit board, and plotting historical yearly rainfall and average temperatures for a particular city are examples of data sets that you might visualize to examine the quality of a part, inconsistencies in signals, or trends in statistics. VBA can be used to prompt a user in a way that makes this input unavoidably mandatory.Visualizing data is an indispensable tool for quickly gaining a better understanding of what data represents and for communicating results to others. For example, you may need a user's input for their first and last name to put on a form. You can perform very normal tasks but perform them in an easier, automated manner. VBA can be used to copy and paste values, adjust cell styles for an entire workbook, and strike accelerator keys. You also may use VBA to produce lists of customers’ names or any other content create invoices, forms, and charts analyze scientific data, and manage data display for budgets and forecasting. This includes filtering through different situations that may impact outcomes differently. With Visual Basic for Applications, you can create various portfolio-management and investment scenarios. You can use VBA in Excel to create and maintain complex trading, pricing, and risk-management models, forecast sales and earnings, and to generate financial ratios. Macros allow financial professionals-whether accountants, commercial bankers, investment bankers, research analysts, salesmen, traders, portfolio managers, clerks, or administrators-to analyze and adjust huge amounts of data quickly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |