Radio-SkyPipe Help

Radio-SkyPipe data file structure.

updated June 11. 2004

Radio-SkyPipe is written in Visual Basic 6. Data files use a special format which includes a header followed by the actual data.

You must understand Visual Basic data types before attempting to use another programming language to reproduce this file structure.

The header has a fixed structure, followed by a variable length string called the Note. The length of the Note may be found in the fixed header parameter Notelength and is the  number of bytes, that is, the number of  ASCII characters in the Note. The Note may 
contain additional parameters simply encrypted. Channel labels, for example, are encrypted in the Note. See below.

[Fixed Length Portion of Header]
[Variable Length Portion of Header = Note + embedded parameters]
[Data]


Type structure of the fixed length portion of the header.

Type SkyPipeHeader
    version As String * 10
    Start As Double 
    Finish As Double
    Lat As Double
    Lng As Double
    MaxY As Double
    MinY As Double
    TimeZone As Integer
    Source As String * 10
    Author As String * 20
    LocalName As String * 20
    Location As String * 40
    Channels As Integer
    NoteLength As Long
End Type


Start, and Finish are declared as Doubles even though they actually
contain Visual Basic dates. They represent the beginning and ending
date/times of the observation. Consult Visual Basic documentation
for an explanation of how a date can be represented by a Double.

Strings within this structure are fixed length strings. Their lengths
are denoted by * 10, * 20, etc.

The Note is the place where text information as seen on the Options
Identity page of the program is kept within the file. It was seen
early on that there needed to be a way to introduce new parameters
into the header information for these data files in a way which
could change over time but maintain backwards compatibility. Thus
it was decided to hide any new parameters into the Note and strip
them out before the Note text is displayed for its original
purpose.  Below is the code used
to embed these parameters into the Note:

Dim TNSx As String
Rem tMetaData(1,200) is a multi-dimensional string array
Rem TChannelOffset is a double type number array
Rem TempNotesString is the unmodified Note string
Rem NotesString is the final string
Rem TChannelLabel is a string array which holds the Channel Labels

TNSx = TempNotesString + "*[[*"

If FileLoggedUsingUT Then TNSx = TNSx + "Logged Using UT" + Chr(255)

Rem Pro Version option for no timestamps
If NoTimeStamps Then TNSx = TNSx + "No Time Stamps" + Chr(255)

Rem channel labels
For u = 0 To NumChannels - 1
TNSx = TNSx + "CHL" + Trim(Str$(u)) + TChannelLabel(u) + Chr(255)
Next u 

Rem channel offsets
For u = 0 To NumChannels - 1
TNSx = TNSx + "CHO" + Trim(Str$(u)) + Trim(Str$(TChannelOffset(u))) + Chr(255)
Next u

Rem Pro version option to save in Integer format
If SaveAsIntegers Then TNSx = TNSx + "Integer Save" + Chr(255)

Rem New X and Y chart label feature
If Trim(iStripChartX1.XAxisTitle) <> "" Then TNSx = TNSx + "XALABEL" + iStripChartX1.XAxisTitle + Chr(255)
If Trim(iStripChartX1.YAxisTitle) <> "" Then TNSx = TNSx + "YALABEL" + iStripChartX1.YAxisTitle + Chr(255)

Rem Up to 200 meta-data name/value pairs 
Rem  tMetaData(0, u) contains the name string and  tMetaData(1, u) contains the value string
For u = 0 To UBound(tMetaData, 2)
        TNSx = TNSx + "MetaData_" + tMetaData(0, u) + Chr(200) + tMetaData(1, u) + Chr(255)
Next u

NotesString = TNSx + "*]]*"

Rem End of code sample

The sample values are recorded in the data portion of the file. Timestamps are usually used however Pro version users have an option to not use timestamps. In that case the beginning and ending times in the header are used and timestamps are calculated under the assumption that the sample intervals are equal. Pro version users also have an option to use an integer format that reduces the file size considerably at the cost of dynamic range and precision.

Data - Default Format

The actual data is a series of groups of Date and Sample values.
A VB date (remember it is encoded as an 8 byte Double) is
followed by Double data type Sample values. If there are multiple
channels, then data for each of the channels follows the date. So
for a two channel file the structure would be:

[Date] (8 bytes)
[Channel 1 Data] (8 bytes)
[Channel 2 Data] (8 bytes)
[Date] (8 bytes)
[Channel 1 Data] (8 bytes)
[Channel 2 Data] (8 bytes)
[Date] (8 bytes)
[Channel 1 Data] (8 bytes)
[Channel 2 Data] (8 bytes)



Data - Integer Save Format
[Date] (8 bytes)
[Channel 1 Data] (2 bytes)
[Channel 2 Data] (2 bytes)
[Date] (8 bytes)
[Channel 1 Data] (2 bytes)
[Channel 2 Data] (2 bytes)
[Date] (8 bytes)
[Channel 1 Data] (2 bytes)
[Channel 2 Data] (2 bytes)

Data - No Timestamps Format (non-Integer)
[Channel 1 Data] (8 bytes)
[Channel 2 Data] (8 bytes)

Data - No Timestamps Format (Integer)
[Channel 1 Data] (2 bytes)
[Channel 2 Data] (2 bytes)


Help Index