Field and Parsing Issues With MeasurePrimary Software: Other NI Software>>MeasurePrimary Software Version: 2.0 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I receive many data points as one string from my GPIB (or Serial) instrument. All of the data points are quickly stored into one cell. Is it possible to read all of my data points into a column instead of a single cell? Solution: Parsing strings received from Serial or GPIB communication is covered in Chapter 2 of both the Measure GPIB User Manual and the Measure Serial Control User Manual. This information is also available by clicking the Help button on the Measure dialog boxes. Below is a summary of the information contained in these resources. In order to place received data into a range of cells such as A1:A400 (for 400 data points), you must select the desired range by clicking in the "Store the result in this range" field while editing your task. Then you can highlight the cells that the data should be placed in. Next you should check the checkbox that says "Store data in columns". After you have done that you must click the "Define fields" button so you can specify the number of "fields" that will be represented in the received data, for example: Data --> HEADER 123.56, 132.98, 134.90 This data has two fields: HEADER, and the numbers following it. When defining the first field you would select its delimiter to be a space (since there is a space after HEADER), and the second one would be a comma (since all the numbers after the header are separated by commas). Remember that this information is available in the Help that comes with Measure and can be accessed by clicking the Help button at the bottom of each dialog box when creating a task. As for the example above, this will work only if all of the data is sent from the instrument as one long string. If you are receiving multiple strings from your instrument you will need to set up a task for each type of acquisition that you want to get from the instrument and then write a macro in Excel that allows you to run each task as many times as you want and specifies where the data will be placed. This is described somewhat in the Help for Measure, but as far as doing it exactly the way you want, you must use Visual Basic for Applications (VBA) to write your own macros in Excel. Measure itself is a way for you to directly interact with your Serial, NI GPIB, and NI DAQ devices through an easily-learned user interface that provides common functionality. As far as application-specific use of Measure is concerned you would benefit from a working knowledge of VBA and macro usage in Excel. Remember that National Instruments does not provide support for VBA coding or writing macros in Excel. For more information on these topics, please check out the Microsoft Developer's Network. Related Links: Measure Support Attachments:
Report Date: 12/06/2000 Last Updated: 12/02/2004 Document ID: 245AM6DM |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
