WR300 Binary Data File Format Specification Sheet 1. Applicable Range Product name: WR300, WR310 Firmware: Main Ver 1.00 or later/Sub Ver 1.00 or later File format: Measurement data files with the ".GBD" file extension Compatible data: Analog measurement data, logic data This specification sheet is applicable to measurement data files in binary format with the ".GBD" file extension. Files are created in this format by using the settings and operations described below. Saving data captured to memory These are files saved using the setting "Data Type = Binary" for saving measurement data captured to data memory. This includes files saved using the Auto Save function. Resaving from data that was captured directly to an HDD Replay the measurement data that was saved to the HDD using the setting "Capture Destination = Disk". Specify the range in the "Execute Menu" and then save the data once again using the setting "Data Type = Binary". Data that is outside the applicable range Measurement data files captured directly to the HDD (files with the ".GDT" file extension) fall outside the applicable range of this specification sheet. 1 Format Outline A WR300 "Binary Data File (.GBD file extension)" is divided into two regions: the "Header region" where the measurement data capture conditions are written, and the "Data region" where the measurement data is recorded. To enable the measurement values to be obtained from a binary data file using a PC or other device, not only the measurement data values themselves, but also measurement conditions such as the "measurement range", "data storage sequence", the "number of data points" and other necessary measurement conditions must be read from the Header region. Header region Unused region Data region The capacity varies according to conditions such as the number of channels. 4096 to 16384 bytes (in multiples of 2048) ASCII data Filled with blank space characters (0 x 20) (Number of data points x 2 x the number of channels) bytes 16-bit binary data 1.1 Header region The data capture conditions and so forth for the measurement data are written as ASCII text (CR+LF for the line feed character). The size of the Header region varies according to the number of channels on which data was captured and the data capture conditions. However, adjustment is made in multiples of 2048 so that the head of the Data region that follows the Header region matches the sector head position no matter what recording device was used. The number of bytes in the Header region is written to the Header region. Moreover, the unused section from the end of the Header region (up to $E ndHea der <CR><L F > ) to the start position of the Data region is filled up with blank space characters (ASCII code 0 x 20). 1.2 Data region The measurement data is written using 16-bit signed binary integers. The start position is the position written into the Header region (it must be a multiple of 2048), and the end position is the end of the file. The number of bytes in the Data region varies according to the number of measurement points (the number of data points for each channel), the number of channels used for data capture, and whether or not logic data is present. The following method can be used for calculation. Name Description Value N Number of measurement data channels The number of channels on which data is captured L Logic data L = 1 when logic is enabled, L = 0 when logic is disabled [Number of bytes in the Data region] = (N + L) x 2 x [Number of captured data points] 1.2.1 Measurement value data Each measurement value is a 2-byte signed integer (signed short), but unlike the format used with Windows or DOS PCs, the high-order byte comes first in the sequence, followed by the low-order byte (Big Endian). Accordingly, when using a PC to load measurement values from a file, an operation to reverse the order of the high-order byte and the low-order byte in order to change the values for storage is required. Even-numbered address High-order byte data Odd-numbered address Low-order byte data 2 1.2.2 Converting the binary data in the Data region to voltage values The measurement values written to the Data region are relative voltage values with a measurement range of +20000 of full scale. Use the following calculation methods to change these values to actual voltage values. 1. Conversion to Voltage Values Voltage range When the range has a "1" base When the range has a "2" base When the range has a "4" base When the range has a "5" base Example of actual voltage ranges 10 mV/100mV/1V/10V/100V, etc. 20 mV/200mV/2V/20V/200V, etc. 40 mV/400mV/4V/40V/400V, etc. 50 mV/500mV/5V/50V/500V, etc. Calculation used for conversion Calculate the measurement value / 2 Calculate the measurement value / 1 Calculate the measurement value / 5 Calculate the measurement value / 4 2. Adjustment of the Decimal Point Position Voltage range 10mV/20mV 50mV/100mV/200mV 500mV/1V/2V 5V/10V/20V 50V/100V/200V 500V/1000V When the voltage unit is "V" Calculate the calculated results of 1. Calculate the calculated results of 1. Calculate the calculated results of 1. Calculate the calculated results of 1. Calculate the calculated results of 1. Calculate the calculated results of 1. / 1000000 / 100000 / 10000 / 1000 / 100 / 10 When the voltage unit is "mV" Calculate the calculated results of 1. / 1000 Calculate the calculated results of 1. / 100 Calculate the calculated results of 1. / 10 Calculate the calculated results of 1. / 1 Calculate the calculated results of 1. x 10 Calculate the calculated results of 1. x 100 Calculation example Input range: 5V Measurement data file value: + 12528 Voltage value = +12528 / 4 / 1000 = 3.132[V] Measurement data file value: -9654 Voltage value = - 9654 / 4 / 1000 = - 2.414 [V] Handling voltage overflow data Inputs that exceed 110% of FS of the measurement range are converted to the following data values. Input that exceeds 110% of +FS Input that exceeds 110% of ÐFS +32765 = (+7FFD)16 - 32767 = (- 7FFF)16 1.2.3 Converting temperature data When the measurement data is temperature, a value that is 10 times the temperature value (the unit is °C) is written as a 16-bit signed integer in the same way as for voltage data (the byte sequence is the same sequence where the high-order byte is followed by the low-order byte). Accordingly, with respect to the temperature data written in the file, the temperature can be calculated as follows. [Temperature] = [Temperature Data] / 10 [°C] In the case of temperature data, regardless of the type of thermocouple used, the relationship between the temperature data written in the file and the actual temperature is constant. 3 1.2.4 Logic data The relationship between the logic input and the logic data in the file is as follows. Logic data is also written to the file in the sequence of high-order byte followed by low-order byte when looking at the data corresponding to the bits for the 16-bit data. Logic data Logic input Logic Group Number Data Position Bit Position 4 Bit 15 3 Bit 14 D 2 Bit 13 High-order byte 1 Bit 12 (even-numbered address) 4 Bit 11 3 Bit 10 C 2 Bit 9 1 Bit 8 4 Bit 7 3 Bit 6 B 2 Bit 5 Low-order byte 1 Bit 4 (odd-numbered address) 4 Bit 3 3 Bit 2 A 2 Bit 1 1 Bit 0 4 2. Details on the Header Region 2.1 Characters and codes used The header is written in ASCII text with a line feed (CR + LF) used as the delimiter. The basic configuration is as follows. $<s ec t i on na me><CR><L F > $$<s ec t i on na me><CR><L F > $$$<s ec t i on na me><CR><L F > <S et t i ng na me> = <S et t i ng v a l ue>, <S et t i ng v a l ue>, . . . <CR><L F > 2.1.1 Line configuration The end of the line is a line feed (CR LF). Blank space characters (0 x 20) and tab characters (0 x 09) are ignored unless they are enclosed in double quotation marks within the "text string". Only alphanumerics (a differentiation is made between uppercase and lowercase text) and symbols (+, -, _, %, $, :) can be used for keywords such as the setting name and setting value. Lines starting with the "#" symbol are considered to be comment lines and are ignored. Moreover, blank lines are also ignored. Settings that are saved as text strings are enclosed in double quotation marks. 2.2 Sections The Header region is divided into "sections" according to the type of function. Sections may be further divided into subsections, and again into sub-subsections. Sections must start with the "$" symbol. Subsections start with the "$$" symbols, and sub-subsections with the"$$$" symbols. To convert the measurement data into actual voltage values, refer to the setting values in the $Common section and the $Amp section in the Header region in the following table. Section $Common 2nd Level 3rd Level $$Data $$Time $Comment $Amp $Measure $Math $Trigger $$Span $$Scale $$Start $$$Condition $$$Logic $$$Slope $$$Trig Count $$Stop $$$Condition $$$Logic $$$Slope $$$Trig Count $Annotation $$Title $$Channel $$$String $End Header 5 Description General information such as the model name and version Setting values for the captured data, etc. Date and time information for the captured data Comments added when the data was saved Range settings, etc. for the captured data Span settings Scaling (EU) settings Calculation settings General trigger start condition settings Trigger level settings for each channel, etc. Logic trigger settings Slope trigger settings Trigger counter/filter settings General trigger stop condition settings Trigger level settings for each channel, etc. Logic trigger settings Slope trigger settings Trigger counter/filter settings Title annotation settings CH annotation settings Text strings for CH annotation settings End of Header 2.3 $Common Section Setting example $Common ID = 3E 0512D6 Vol ume = 1, 1 Hea der S i z = 6144 Vendor = " GRAPHT E C Cor por a t i on" Model = " WR300" S uf f i x = " CH = 16CH Opt i on = L ogi c F or ma t = " Ver 1. 00" Ha r dwa r e = " Ver 1. 00" " F i r mwa r e = " Ver 1. 11 OS = " Ver 3. 02" , " Ver 1. 00" " , " Ver 1. 10 " , " Ver 1. 00 " $$Da t a Mode = Rec or der F or ma t = Bi na r y Da t a T y pe = Bi gE ndi a n, S hor t , S et up Or der = CH1 , CH3 , CH4 , CH5 , CH6 , CH7 , CH8 S a mpl e = 100us MemE x pa nd = x 1 Count = 1002 T r i gger = …499 Cur s or A = - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 Cur s or B = - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 St at = Of f $$T i me St ar t = 1999- 11- 05, 11: 07: 26 S t op = 1999- 11- 05, 11: 07: 27 T r i gger = 1999- 11- 05, 11: 07: 27 * For details on the settings, please refer to sections 2.3.1 through 2.3.3. 2.3.1 General Settings ID Form Setting example Function Explanation I D = <8- di gi t hex a dec i ma l number > I D = 3E 0512D6 ID number generated from the date and time the file was created In the current version, the ID is only written to this field. It is not used. Volume Form Setting example Function Explanation Vol ume = <Vol ume number >, <Gener a l number of Vol umes > Vol ume = 1, 1 Consecutive numbers for the devices used to configure the data files and the number of devices Since the capacity of the data file is smaller than the capacity of the device, "Volume = 1, 1" is always written to this field. 6 HeaderSiz Form Setting example Function Explanation Hea der S i z = <Number of by t es i n t he hea der > Hea der S i z = 6144 Number of bytes in the header (the start point of the measurement data) The number of bytes in the header is written as a decimal number. So that the start point of the measurement data is the same as the head of the sector regardless of the recording device, the header size is rounded up to a multiple of 2048. The number of bytes in the Header region varies according to the number of channels used to capture data and the settings that were made. Actually, when referring to the measurement data, read the data in this field to detect the start point of the measurement data. Vendor Form Setting example Function Explanation Vendor = " t ex t s t r i ng def i ned i n t he Hea der " Vendor = " GRAPHT E C Cor por a t i on" This is a text string that indicates the manufacturer of the device. Fixed to "GRAPHTEC Corporation" Model Form Setting example Function Explanation Model = " pr oduc t model " Model = " WR300" This is a text string that indicates the model name of the device. Fixed to "WR300" Suffix Form Setting example Function Explanation S uf f i x = " t ex t s t r i ng" S uf f i x = " " This is a text string used to identify the device when it is not the standard model. Six blank space characters are always written to this field for the standard model. CH Form Setting example Function Explanation CH = <number of c ha nnel s f or t he dev i c e> CH = 16CH Indicates the maximum of number of channels (8CH or 16CH) that can be installed in the WR300 device. The maximum number of channels that can be installed in the device that was used to create the measurement data file is written to this field. Either 8CH or 16CH is written for a WR300 device. The number of channels written to this field is the maximum number of channels that can be installed in the WR300 device according the device specifications, and may not necessarily be the same number as the number of channels actually installed. Since the amp settings up to the maximum number of channels that are written to this line are written to the $Amp section, the settings values in this line will always match the number of lines in the $Amp section. Option Form Setting example Function Opt i on = <opt i on>, . . . , <opt i on> Opt i on = L ogi c Indicates the options such as the logic amp and the HDD that are actually installed. Explanation 7 2.3.2 $$Data subsection The settings that are related to the captured data as a whole are written to the $$Data subsection. Mode Form Setting example Function Explanation Mode = Rec or der / L ogger Mode = Rec or der The measurement mode used for data capture is written to this field. The measurement mode used when data was captured is recorded. Variations will not occur in the interpretation of the measurement data because of the measurement mode used. Format Form Setting example Function Explanation F or ma t = Bi na r y Da t a F or ma t = Bi na r y Da t a Indicates the format used for the measurement data. The format of measurement data files with the ".GBD" extension is always "BinaryData". Type Form Setting example Function Explanation T y pe = Bi gE ndi a n, S hor t , S et up T y pe = Bi gE ndi a n, S hor t , S et up Indicates the data type used for the measurement data. The setting given above is also written for measurement data files with the ".GBD" file extension. Order Form Setting example Function Explanation Or der = <1 s t Da t a >, <2 nd Da t a >, . . . , <L a s t Da t a > Or der = CH1, CH2, CH8, CH9, L ogi c Indicates the order of the measurement data. The order of the binary measurement data is written to this line. Since the order of the measurement data actually written to the data file varies according to the capture time settings and the amp configuration, use this field as a reference and check the measurement data storage sequence Notes on the Storage Sequence of Measurement Data ¥ Analog measurement values are stored in order from CH 1. However, if Input = OFF was specified for a channel when data was being captured, or if the "Memory Expansion" function was used, or if the "Number of Data Capture Channels" setting limited the number of data capture channels, only the measurement data from valid channels is written to the file, regardless of the actual input settings. ¥ Data from channels where the Input = GND or Input = CAL setting has been specified will also be written to this field. However, the data for these channels will be fixed to certain values (0 for GND and +10000 for CAL). ¥ If there is any logic data, it is stored after the analog data. Sample Form Setting example Function Explanation S a mpl e = <s a mpl i ng i nt er v a l > S a mpl e = 100us The sampling interval used when measurement data was captured is written to this field. The sampling interval used when measurement data was captured is written to this field. Refer to this field if you need to check the relationship between the time and the data position. The time units used are as follows: us = us, ms = ms, s = s 8 Counts Form Setting example Function Explanation Counts = <number of data points> Counts = 1000 The number of measurement data points is written to this line. The number of measurement data points is written to this line. With data that is normally captured to memory, the number of data points written to this line is the same as the size of the data memory (2000, 4000, ...word/CH), but depending on the settings and the range specified for data replay, the number of data points will change in the end. Notes on the number of bytes in the Data region The number of bytes in the Data region of a binary data file can be obtained from the measurement data order written to the Order = line described earlier. Use the following calculation to calculate the number of bytes from the number of data capture channels, including logic channels, and the number of data points in this line. Number of Data region bytes] = [Number of data capture channels] x [Number of data points] x 2 Trigger Form Setting example Function Explanation Trigger = <trigger point> Trigger = 234 The position of the trigger point is written to this field. The position of the trigger point, with the first data position in the data as 0, is written to this field. The trigger point varies according to factors such as whether the pre-trigger function was used when data was captured, or whether a save operation was specified by using cursors to define the range. Moreover, if a save operation was specified for a range that did not include the trigger point, the trigger point will become a negative value. If information on the trigger point is required, refer to this field. 2.3.3 $$Time subsection The trigger start time, trigger stop time and the time that the trigger was activated are written to this subsection. Start Form Setting example Function Explanation Start = <date>,<time> Start = 2005-3-10,14:15:12 The start time of measurement is written to this field. The start time of measurement is written to this field. The time that is usually written is the time that the [Start] key was pressed. Stop Form Setting example Function Explanation Stop = <date>,<time> Start = 2005-3-10,14:15:18 The stop time of measurement is written to this field. The stop time of measurement is written to this field. The time that is usually written is the time that the [Stop] key was pressed, or else the time when memory recording ended. Trigger Form Setting example Function Explanation Trigger = <date>,<time> Trigger = 2005-3-10,14:15:12 The time that the specified trigger was activated is written to this field. The trigger activation time is a time between the measurement start time and the measurement stop time. 9 2.4 $Comment section The text string that was added as a comment when the measurement data was saved is written to this section. Setting example $Common " WR300 Da t a No. 0001" 2.5 $Amp section The amp type, and input, range and filter settings are written to this section. Setting example $Amp CH1 = M CH2 = NC , DC , 2V, Of f , T C_ K CH3 CH4 = M , DC = M , DC , 20V, Of f , T C_ K , 500V, Of f , T C_ K CH5 = V CH6 = V , DC , 200V, Of f , DC , 200V, Of f CH7 CH8 = V , DC , 200V, Of f = V , DC , 100V, Of f CH9 = NC CH10 = NC CH11 = NC CH12 = NC CH13 = NC CH14 = NC CH15 = NC CH16 = NC *Be sure to refer to the explanation for the Range setting * For details on the settings, please refer to sections 2.5.1. 2.5.1 Explanation of the fields Field 1: CH number The channel numbers are written here. The settings for the maximum number of channels for the device (either 8CH or 16CH) are written to the $Amp section. Field 2: Amplifier type The amplifier types are written here. "NC" is written to this field for channels for which amplifiers are not installed, and for channels to which data was not captured. Field 3: Input setting The input settings that were specified at the time of data capture are written to this field. Data is not captured to channels for which "Off" was selected, and so "Off" is never displayed in this field. The setting values that are displayed in this field are shown in the following table. V-AMP AC DC GND CAL M-AMP "AC" "DC" "GND" "CAL" AC DC TEMP GND CAL Remarks "AC" "DC" "TEMP" "GND" "CAL" 10 Field 4: Range setting The voltage range settings that were specified at the time of data capture are written to this field. If "Temp" was specified for the M-AMP input setting, the setting value for this field is ignored. To convert the measurement data into actual voltage data, refer to the voltage range written to this field and then make the conversion. Field 5: Filter setting The low-pass filter setting that was specified at the time of data capture is written to this field. Field 6: Thermocouple type setting This field is only added if the amplifier is an M-type amplifier. Refer to this field if the captured data is temperature data, and you need to know the type of thermocouple used. The settings in this field are ignored for all other input types. 2.6 $Measure section The span settings and the scaling (EU) settings are written to the $Measure section. 2.6.1 $$Span subsection The span settings that were specified at the time of data capture are written to this subsection. Please note that only the channels for which measurement data exists are written to this subsection. 2.6.2 $$Scale subsection The scaling (EU) settings that were specified at the time of data capture are written to this subsection. Please note that only the channels for which measurement data exists are written to this subsection. 2.7 $Math section The settings related to calculation (Function On/Off, format, span) are written to the $Math section. 2.8 $Trigger section The trigger settings (both the Start and Stop conditions) that were specified at the time of data capture are written to this section. 2.9 $Annotation section The annotation settings are written to this section. 2.10 $EndHeader The $EndHeader line ends the Header region (the line is actually "$EndHeader<CR><LF>". Blank character spaces (ASCII code 0x20) are inserted in the region that is not used between the end of the $EndHeader line and the start position (a multiple of 2048) of the Data region. 11 3. Points to Note When Referring to the Binary Data File When creating a data reference program for a binary file, please note the following points. Variable length text data The text data used in the Header region is basically variable length data. Even within one line, there is no set provision for the position of the start of the text string with respect to the head in the setting field. To obtain the setting value, take into account the delimiter characters and the blank space characters to enable you to detect the text string. Variable line positions In the same way, the order of the settings in the Header region can vary depending on the setting conditions and function extensions. As a rule, write the program so that the section name and the setting name can be detected for each setting. Changing the Header Do not change the contents of the header. Since the position of the measurement data determines the size of the header, you will not be able to access the measurement data correctly if you change its position in the file. Moreover, if you change the setting contents problems may occur when replaying data on the WR300. 12