Raw Data Exporters

Exporters trigger the sending of data to a new location upon arrival of new chip reads. The data sent is normally raw timing data but any data from RACE RESULT 12 can be sent in this way. 

This may be used by users of third party timing / scoring software to receive data from race result systems, hence a quick initial event setup guide is included below.

You will need some basic knowledge of how to setup Timing Points in RACE RESULT 12, times must be assigned to a timing point and then pushed to the location. If you are identifying the detection simply by the device ID you could send all data to a single timing point and export the data with device ID. 

Raw Data Exporters Setup

Exporter Setup

Navigate to the Timing window through the top navigation bar, here is where you will connect to and control your timing systems and exporters. If you are working online and you are exporting to a local destination (e.g. local network IP address, Serial or File) then ensure to start the RACE RESULT Web Server on your computer. 

Navigate to Exporters+Tracking through the left navigation pane, here you will setup the different exporters you require and how they will function. The settings available are:

Name: A name for the exporter
Timing Point: Which Timing Point will trigger the export of data / will be sent
Filter: A filter to be applied, for example only a specific bib range.
Export Data: The format of text which will be sent, there are some pre-defined formats or you can write a custom set of data.
Destination: The Export Type (TCPIP / SERIAL / FILE / SQL) & additional fields required depending on the format.
LE: The Line ending expected by your software to read the data.

If you wish to write a custom output data format there are a number of custom fields which should be used, you can view these in the sub-menu below, you can also use any of the standard RACE RESULT fields if you have these setup in the event file. 

If using FILE export then the file name should be the full destination address and file type for example: C:\Users\Timer\Documents\Export.csv 

 

Connecting to Devices and Starting Exporters.

Your exporters are listed on the Timing Module Systems menu in the same way as your systems and can be started in the same way, the Status will show Connected if successful. 

You can re-send all the data to an exporter via the blue rewind arrow, and clicking the red stop icon will close the connection. 

Markers return a transponder code of -1 regardless of the decoder settings. 

Database Insert

Raw Data Exporters currently supports below mentioned SQL Database Types and ODBC Drivers for Access databases and similar, if you require additional database types then let us know and we can look in to the implementation. If using a database which requires ODBC drivers then first ensure these are installed on your computer and that ODBC can create a connection to your database.

When setting up your exporter you will need to enter the server settings for your database, these accept different strings depending on the database type.

MySQL: USERNAME:PASS@tcp(HOSTNAME:PORT)/DATABASE
MS-SQL:  server=HOSTNAME; user id=USERNAME; password=PASS; database=DATABASE; port=PORT;
PostgreSQL: postgresql://USERNAME:PASS@HOSTNAME:PORT/DATABASE?sslmode=disable
ODBC Drivers (e.g. Microsoft Access): Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\Database.accdb

For ODBC driver connections you will need to reference the correct connection string for your installed drivers.

Some database types may require additional security settings for username and password, a good resource for this is available at: https://www.connectionstrings.com/ 

You need to format the Export Data using the Custom entry to formulate an Insert Statement as an Expression

For example for MS-SQL:

"INSERT INTO RawData (Chip, Time, TimingPoint) VALUES ('" & if([RD_Transponder]<>"";[RD_Transponder];[RD_IDBib]) & "', '" & format([RD_Time];"hh:mm:ss.kkk") &"', '" & [RD_TimingPoint] &"')"

 

This will insert to a table called "RawData", to the fields Chip, Time and TimingPoint the fields Transponder Code or Chip Code, raw data time formatted as hh:mm:ss.kkk and the timing point respectively. For Microsoft Access databases the field names should be enclosed in square brackets. 

Default raw data exporters

This article lists all the available exporters within RACE RESULT 12. Below shows the data format of each exporter as well as an example of its output.

Raw Data Record JSON

The Raw Data Record JSON mimics a Passing Record. It is a JSON struct with all relevant data, where the first part refers to information from RACE RESULT 12, and the last object refers to the actual passing raw data. 

Example output

{
    "ID":1,
    "Bib":50001,
    "TimingPoint":"STARTFINISH",
    "Result":-10,
    "Time":32795.944,
    "Invalid":false,
    "Passing":{
        "Transponder":"ZICAD30",
        "Position":{
            "Latitude":0,
            "Longitude":0,
            "Altitude":0,
            "Flag":""
            },
        "Hits":75,
        "RSSI":-75,
        "Battery":3,
        "Temperature":17,
        "WUC":6233,
        "LoopID":8,
        "Channel":8,
        "InternalData":"",
        "StatusFlags":128,
        "DeviceID":"D-50432",
        "DeviceName":"Support Decoder",
        "OrderID":0,
        "Port":0,
        "IsMarker":false,
        "FileNo":177,
        "PassingNo":1,
        "Customer":12345,
        "Received":"2024-01-12T09:07:43.15+01:00",
        "UTCTime":"2024-01-12T09:06:35.944Z"
        }
    }

 

Raw Data Record V2

The Raw Data Record V2 mimics a Passing Record from a RACE RESULT System. It does not include values for [<LoopOnly>] and [<InternalData>], however the structure is correct.

<PassingNo>;<Bib/TranspCode>;<Date>;<Time>;[<EventID>];<Hits>;<MaxRSSI>;
<InternalData>;<IsActive>;[<Channel>];[<LoopID>];[<LoopOnly>];[<WakeupCounter>];
[<Battery>];[<Temperature>];[<InternalActiveData>];<BoxName>;<FileNumber>;[<MaxRSSIAntenna>];<BoxId><CrLf>

Example output

7750;ZCMBG52;;10:50:00.477;0;72;127;;1;1;1;;16731;2,9;17;0;D-5662;;0;D-5662

 

Raw Data Record V1

The Raw Data Record V1 is a legacy version of a Passing Record. It does not write a data and it does not include [<LoopOnly>] (see |Decoder Communication Protocol) and hence moves all columns thereafter to the left by one column when compared to a full passing record. This format has been maintained to ensure backwards compatability for existing implementations (2023 and earlier).

<PassingNo>;<Bib/TranspCode>;<Date>;<Time>;[<EventID>];<Hits>;<MaxRSSI>;
<InternalData>;<IsActive>;[<Channel>];[<LoopID>];[<WakeupCounter>];
[<Battery>];[<Temperature>];[<InternalActiveData>];<BoxName>;<FileNumber>;[<MaxRSSIAntenna>];<BoxId><CrLf>

Example output

7750;ZCMBG52;;10:50:00.477;0;72;127;;1;1;1;16731;2,9;17;0;D-5662;;0;D-5662

 

Raw Data Record with Position

The Raw Data Record V1 with Position mimics the legacy version of a Passing Record but also adds in GPS position.

<PassingNo>;<Bib/TranspCode>;<Date>;<Time>;[<EventID>];<Hits>;<MaxRSSI>;
<InternalData>;<IsActive>;[<Channel>];[<LoopID>];[<WakeupCounter>];
[<Battery>];[<Temperature>];[<InternalActiveData>];<BoxName>;<FileNumber>;[<MaxRSSIAntenna>];<BoxId>;[RD_Latitude];[RD_Longitude]<CrLf>

Example output

7750;ZCMBG52;;10:50:00.477;0;72;127;;1;1;1;16731;2,9;17;0;D-5662;;0;D-5662;33.57663;-117.2486

 

Custom

See Custom Destination Data Fields for more information on setting up a custom exporter.

 

Raw Data Time

This exporter only exports the raw time of the passings in seconds.

<Time>

Example output

39000.477

 

RunScore RSBCI

"RSBCI," & if([RD_Transponder]<>"";[RD_Transponder];[RD_IDBib]) & "," & format([RD_Time];"hh:mm:ss.kkk") & "," & [RD_TimingPoint]
  • RSBCI - Text string "RSBCI"
  • [RD_Transponder] or [RD_IDBib] - Exports transponder if one is entered, otherwise exports bib
  • [RD_Time] - Exports raw time of the passing formatted to "hh:mm:ss.kkk"
  • [RD_TimingPoint] - Exports the TimingPoint name in RACE RESULT 12

Example output

RSBCI,ZCMBG52,10:50:00.477,START+FINISH

Custom Destination Data Fields

You can create any combination of data for the destination according to your requirements. You can use any of the standard data fields from RACE RESULT 12 or the custom fields below which are related directly to the passing which triggered the exporter. Data fields should be enclosed in square brackets, to join data fields you should use '&', for example to join just Transponder and Time separated by a semi-colon you would enter - [RD_Transponder] & ";" & [RD_Time] .

  • [RD_ID] - A Unique ID for that passing
  • [RD_IDBib] - If using standard passive tags then this is the chip code of the tag. 
  • [RD_Transponder] - If using non-standard passive tags or active transponders then this will return the transponder code.
  • [RD_Time] - The raw time of the passing in seconds. You can use the Time Format function to display this in the required format. 
  • [RD_OrderID] - The OrderID of the chip. (Passive Only)
  • [RD_Hits] - The number of hits on the transponder for the passing. (Number of times the transponder was seen).
  • [RD_RSSI] - The max RSSI (strength) of the signal received from the transponder.
  • [RD_ChannelID] - The active Channel ID from the timing point (Active Only)
  • [RD_LoopID] - The active Loop ID from the timing point. (Active Only)
  • [RD_WakeupCounter] - The wake-up count from the transponder. (Active Only)
  • [RD_Battery] - The battery voltage of the transponder. (Active Only)
  • [RD_Temperature] - Internal temperature of the transponder. (Active Only)
  • [RD_StatusFlags] - The status flag indicates if the passing was a stored passing on the transponder.
  • [RD_TimingPoint] - The TimingPoint name in RACE RESULT 12.
  • [RD_DecoderName] - The name of the decoder if it has been assigned.
  • [RD_DecoderID] - The device ID
  • [RD_Port] - The antenna port with max. RSSI during a passing (Passive Only)
  • [RD_Latitude] / [RD_Longitude] - The coordinates of the detection, provided the device it comes from delivers GPS coordinates.
  • [RD_IsMarker] - whether or not this passing is treated as a Marker
  • [RD_FileNo] - indicates the file number from a Ubidium or decoder
  • [RD_PassingNo] - the passing number as saved in a passings file
  • [RD_Customer] - the customer ID to which the passing has been uploaded
  • [RD_Received] - the timestamp with timezone when the passing has been received by RACE RESULT 12
  • [RD_UTCTime] - the timestamp of the passing converted to UTC time

Exporter Commands

This is a new version that includes answering to exporter commands. It is currently for TCP only. Once a connection is established, the receiver can send commands.

 

Getting Info

To get info about the exporter send the following command:

GETINFO\n

The response looks like this:

{
  "Command": "GETINFO",
  "Exporter": {
    "ID": 8,
    "Name": "PacketSender Home",
    "Filter": "",
    "TriggerTimingPoint": "",
    "TriggerResultID": 0,
    "DestinationType": "TCPIP",
    "Destination": "192.168.178.25:54696",
    "Data": "[RD_ID] \u0026 \";\" \u0026 if([RD_Transponder]\u003c\u003e\"\";[RD_Transponder];[RD_IDBib]) \u0026 \";;\" \u0026 format([RD_Time];\"hh:mm:ss.kkk\") \u0026 \";\" \u0026 [RD_OrderID] \u0026 \";\" \u0026 [RD_Hits] \u0026 \";\" \u0026 [RD_RSSI] \u0026 \";;\" \u0026 if([RD_LoopID]\u003e0;1;0) \u0026 \";\" \u0026 [RD_ChannelID] \u0026 \";\" \u0026 [RD_LoopID] \u0026 \";;\" \u0026 [RD_WakeupCounter] \u0026 \";\" \u0026 ([RD_Battery]/10) \u0026 \";\" \u0026 ([RD_Temperature]-100) \u0026 \";\" \u0026 [RD_StatusFlags] \u0026 \";\" \u0026 [RD_DecoderName]",
    "MTB": 0,
    "MQL": 0,
    "LineEnding": "LF",
    "OrderPos": 7000
  },
  "Paused": false,
}

Stop Command

This command stops the exporter at any time.

STOP\n

Normal response:

{
  "Command": "STOP",
}

Error response:

{
  "Command": "STOP",
  "Error": "Some error message"
}

Pause Command

This command pauses the exporter at any time.

Command

PAUSE\n

Responds with:

{
  "Command": "PAUSE",
  "Paused": true
}

Resume Command

This command resumes the exporter at any time.

Command:

RESUME\n

Responds with:

{
  "Command": "RESUME",
  "Paused": false
}

Note: if the connection breaks while in "paused" mode it will not be reopened unless there is new data to write. If you want to resume you need to wait for the connection to re-establish.

Replay Command

This command allows you to replay the exporter at any time.

Command:

REPLAY\n

Normal response:

{
  "Command": "REPLAY",
}

Error response:

{
  "Command": "REPLAY",
  "Error": "Some error message"
}

Exporting Date & Time

Some platforms may require you to send the passing date and time, however currently RACE RESULT 12 does not store the passing date when the passing is saved to the database. To send dates and times correctly you will need to set the Timing Module to handle the times correctly according to Multi-Day Race settings.

To export date and time you can use the following formulas in your expression.

Date: ([EventDate]+int([RD_Time]/86400)) 
This requires the EventDate to be set in your files basic settings, it calculates how many days after the start date the passing was from and sends the corresponding date.

Time: format(([RD_Time]%86400);"hh:mm:ss.kkk")
This is the remainder of time after the time has been divided by 86400, the number of seconds in 24 hours, and so will always send the Time of Day. As the modal does not return milliseconds we must then append the milliseconds with a separate format. 

It is on our wishlist to save and use the passing date in the event file, however this solution should work for most cases so long as you setup the file correctly.