Note, in the following, that an "xdr_counted_string" is not part of the XDR standard, but a definition added on top of the standard. It consists of an xdr_short, containing the number of characters in the string, possibly followed by an xdr_string. Only if the xdr_short value is nonzero will an xdr_string follow it. Thus an empty string looks like this: and a nonempty string looks like this: ----------------------------------------------------------------------- scan file format FILE HEADER xdr_float: VERSION (1.3 == 3FA66666) xdr_long: scan number xdr_short data's rank xdr_vector(rank, xdr_int) dims; xdr_int isRegular (true=1, false=0) xdr_long: pointer to the extra pvs SCAN HEADER: xdr_short: this scan's rank xdr_long: number of requested points (NPTS) xdr_long: current point (CPT) if the scan rank is > 1 xdr_vector(NPTS, xdr_long) pointer to the lower scans INFO: xdr_counted_string: scan name xdr_counted_string: time stamp xdr_int: number of positioners xdr_int: number of detectors xdr_int: number of triggers for each positioner xdr_int: positioner number xdr_counted_string: positioner name xdr_counted_string: positioner desc xdr_counted_string: positioner step mode xdr_counted_string: positioner unit xdr_counted_string: readback name xdr_counted_string: readback description xdr_counted_string: readback unit for each detector xdr_int: detector number xdr_counted_string: detector name xdr_counted_string: detector desc xdr_counted_string: detector unit for each trigger xdr_int: trigger number xdr_counted_string: trigger name xdr_float: trigger command DATA: for each positioner xdr_vector(NPTS, xdr_double): readback array for each detector xdr_vector(NPTS, xdr_float): detector array [SCAN] ... ... ... [SCAN] EXTRA PVs xdr_int: number of extra pvs for each pv xdr_counted_string: name xdr_counted_string: desc xdr_int: type if type != DBR_STRING xdr_long: count xdr_counted_string: unit depending on the type: DBR_STRING: xdr_counted_string: value DBR_CTRL_CHAR: xdr_vector(count, xdr_char): value DBR_CTRL_SHORT: xdr_vector(count, xdr_short): value DBR_CTRL_LONG: xdr_vector(count, xdr_long): value DBR_CTRL_FLOAT: xdr_vector(count, xdr_float): value DBR_CTRL_DOUBLE: xdr_vector(count, xdr_double): value ----------------------------------------------------------------------- A 1D scan looks like this: header scan1 extra PV's A 2D scan looks like this header scan2 scan1 scan1 ... extra PV's A 3D scan looks like this header scan3 scan2 scan1 scan1 ... scan2 scan1 scan1 ... ... extra PV's A counted string looks like this: int number of characters # if number of characters>0: int number of characters char[number_of_characters]