It is necessary to receive data packets from the vehicle GPS tracker and send them to another server or further processing. The other server (other software) supports only one data format and it is impossible to connect other trackers to it directly. It means that GPS Tracker Data Logger will run as a converter in this case. The other server can receive information packets in the ASCII format and does not require authentication. Sample information packet:
IMEI,yyyymmddhhnnss,lon.llllll,lat.llllll,speed, dir,000alt,sat,RID,In,Out,A1.in,A2.in <CR><LF>
It is assumed that:
After you configure and test the parser with the help of DDE, you can get down to configuration.
1. It is necessary to generate a new data packet for redirecting. You can do it with the filtering "Script Execute" plug-in. This plug-in allows you to specify the script that will be called for every data packet the parser single out and processes. The parser for Teltonika trackers is used in this example. This parser has a set of variables it splits a data packet into. These variables will be used in the script.
2. Enable the "Data Redirecting" plug-in. The "Data Redirecting" plug-in must be below the "Script Execute" plug-in in the list (fig. 1).
Note: The program can redirect only that data from the GPS tracker that the parser supports and processes. For example, if the tracker sends several types of packets and the parser processes only one of them, you will be able to redirect only that one packet.
Fig.1. GPS tracker. "Data Redirecting" plug-in configuration.
The "Script Execute" plug-in allows you to write the script in several scripting languages. The script in the Pascal language will be used in this tutorial (fig. 2).
Fig.2. GPS tracker. Script.
Full script source:
This script uses the GetVariable variables to get the values of the variables prepared by the parser, formats them and generates a new data packet. The new data packet in the ASCII format ready to be redirected is added to existing parser variables with the help of the SetVariable function under the name ASCII_DATA_PACKET. Values absent in the parser variables are replaced with their default values. If there are no device ID or date values among the parser variables, this data packet is ignored.
It is easy to see that script variables of the sDate_Name:string = 'TIMESTAMP_UTC'; type are used to specify the name of a parser variable that will be later used in the script body.
To configure the "Data Redirecting" plug-in (fig.3), select it in the list and click the "Configure" button under the list.
Fig.3. GPS tracker. "Data Redirecting" plug-in configuration.
Now you have to save all the changes. To do it, close all dialog boxes by clicking the "OK" button.
After data is received from the GPS tracker, you will see information about the data being redirected in the message log of the program (fig. 3).
Fig.3. GPS tracker. Data redirection message.
If you switch to the TCP client configuration (fig. 4) in the main window of the program, you will be able to see the data being redirected.
Fig.4. GPS tracker. Data being redirected.