Download WINWEDGE USERS MANUAL
Transcript
A More Complex Example This example explores some of the less obvious features of the Software Wedge and how to apply them to a more complex situation. In this example we will assume that you have already gone through the first four steps for setting up the Software wedge outlined in the previous example and have discovered that the data transmitted by your instrument is structured as follows with four lines of data and each line terminated by a carriage return: Data Widget Coordinates<Cr> x = 100.7, x deviation = .50<Cr> y = -170.25, y deviation = .38<Cr> z = 110, z deviation = -.5<Cr> For our particular application, we are interested in capturing only the x, y and z values to a spreadsheet such that the three values appear next to each other on the same row but in separate columns. i.e. with one column of “x” values, one column of “y” values and one column of “z” values. We also want to ignore the first line of text and also each of the three “deviation” values. If you think of the entire output from the device as a single data “Record” containing a group of data fields, the first thing we must do is to figure out a way to isolate the three x, y and z fields from the rest of the data using the parsing and filtering capabilities of the Software Wedge. There are actually several ways to achieve the results that we want using different features in the Software Wedge. One approach is to first use the “Pre Input Translation Table” to translate all commas to carriage returns so that our data appears to the Software Wedge as follows with the same delimiter character separating each individual data field: Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Data Widget Coordinates<Cr> x = 100.7<Cr> x deviation = .50<Cr> y = -170.25<Cr> y deviation = .38<Cr> z = 110<Cr> z deviation = -.5<Cr> To perform this translation, select “Pre Input Translation Table” from the DEFINE menu and when the translation table appears, scroll down in the table until the “comma” character is hi-lighted and then click the button marked “Translate...”. In the ASCII chart that appears, scroll down to the carriage return character (ASCII 13) and click on the “OK” button in the ASCII chart dialog box. After you perform the translation, you can exit from the translation table by clicking the “OK” button in the translation table dialog box. Looking at the data now, we can identify seven distinct data “fields”, each of which is delimited from the next by a carriage return. 119