Questions? Search our site or call us at 1-800-722-6004

Defining More Data Fields than Are Actually Received

When you define the "Input Data Record Structure" in WinWedge, you first define the events that determine the start and the end of each data record. You then define how you want WinWedge to parse each data record by selecting a "Record Structure". You can have it parse your data records based on either the positions of delimiter characters within each record or by byte position in the record. WinWedge always stops reading in data when it encounters the specific "End Of Record Event" that you specify. If you define more data fields than are actually present in the data record then the remaining fields will be left empty. You could take advantage of additional empty data fields by using them to perform calculations on previous data fields using a "Math Expression" in the empty fields. For example suppose that you had a device that transmitted a pair of numbers, X1 and X2, in the following comma delimited format with a carriage return at the end of the data record:

X1,X2<Cr>

Suppose also that you wanted to pass these two numbers to another program along with the difference between the two numbers. To do this, you could define the input data record structure by specifying the End Of Record Event as "Carriage Return or CrLf Received" and then specifying the "Record Structure" as "Multiple Delimited Data Fields" with a comma as the delimiter and specifying three for the maximum number of data fields. The actual data has only two data fields before the carriage return so by specifying three for the maximum number of fields, you will end up with a third empty data field in WinWedge. For each field that you define in WinWedge, you can also define a Math Expression to be applied to the field. Math expressions in WinWedge can contain references to previous data fields by using the "Field(n)" expression. If you specified "Field(2) - Field(1)" for the math expression for Field(3) (the empty field), then you would end up with the difference between the two numbers X1 and X2 in Field(3) in WinWedge.


Categories: Tutorial / How-To, WinWedge

Last Updated: 2011.07.08

Need more help?

Don't hesitate to call or email us with your questions

Our office is open 9AM - 5PM Monday Through Friday (E.S.T.)

Technical Support: 215-496-0202

Toll-Free: 1 (800) 722-6004
Skype: taltech1 (Voice only)
Email: support@TALtech.com