Legacy Hardware and Apps
Serial port logging

I'm trying to log all data coming in on the serial input. The data occurs asynchronously in the form of '/n' terminated printable strings. Is this possible and how do I go about it?

Cheers TW

I'm trying to log all data coming in on the serial input. The data occurs asynchronously in the form of '/n' terminated printable strings. Is this possible and how do I go about it? Cheers TW

Good morning Ted,

It should be possible if the data is ASCII text or high endian binary and the data is transmitted by RS232, RS422, RS485 or SDI12 standards.

This is my SOP for serial sensor port work.

  1. RTM. Read the manual for the device.
    You will need to take note of things like; default configurations, special transfer modes that may make your life easier, Communication type (RS232, RS485?), Comms settings (baud rate parity, Xon/Xoff etc). Look for header characters, parsing characters and end of line markers. Do you have to send commands to get data or does it just spit it out?

  2. Get hold of a sample of data from the device (or construct some test data yourself). What I do is use a terminal program to send this data to the datataker and using the P56 parameter to look at the data coming in and how the DT800 is parsing it. (P56=1 will show the incoming string, P56=8 will show the parsing, etc) Use this to construct and check you parsing is correct.

  3. Then hook up the device and check that works as expected.

For example the following DeTransfer program will read a GPS string.

'The 2 line NMEA0183B output is:
'
' $GPRMC,051151,A,3655.85,S,14458.99,E,21.7,215.1,290301,11.,E*54\13\10
' $GPRMB,A,0.00,R,0000,0001,3656.54,S,14500.00,E,001.5,00..,021.7,V*1B\13\10
'
'where in line 1 the 3655.85,S is the latitude and 14458.99,E is the longitude

PS=4800,N,8
BEGIN
1SERIAL(RS232,"\\e",W) 'Clean out receive buffer
RA1SERIAL"$GPRMC" 'Trigger on header
DELAY(W)=500    'Wait for all of string to come in
1SERIAL(RS232,"%16s[1$]",2,W) 1$("Header:")
1SERIAL(RS232,"%f[1CV],",2,W) 1CV("Latitude =",FF4)=1CV/100
1SERIAL(RS232,"%1s[2$],",2,W) 2$("")
1SERIAL(RS232,"%f[2CV],",2,W) 2CV("Longitude =",FF4)=2CV/100
1SERIAL(RS232,"%1s[3$]",2,W) 3$("")
1SERIAL(RS232,"\\e",2,W)
END
Good morning Ted, It should be possible if the data is ASCII text or high endian binary and the data is transmitted by RS232, RS422, RS485 or SDI12 standards. This is my SOP for serial sensor port work. 1. RTM. Read the manual for the device. You will need to take note of things like; default configurations, special transfer modes that may make your life easier, Communication type (RS232, RS485?), Comms settings (baud rate parity, Xon/Xoff etc). Look for header characters, parsing characters and end of line markers. Do you have to send commands to get data or does it just spit it out? 2. Get hold of a sample of data from the device (or construct some test data yourself). What I do is use a terminal program to send this data to the datataker and using the P56 parameter to look at the data coming in and how the DT800 is parsing it. (P56=1 will show the incoming string, P56=8 will show the parsing, etc) Use this to construct and check you parsing is correct. 3. Then hook up the device and check that works as expected. For example the following DeTransfer program will read a GPS string. ```` 'The 2 line NMEA0183B output is: ' ' $GPRMC,051151,A,3655.85,S,14458.99,E,21.7,215.1,290301,11.,E*54\13\10 ' $GPRMB,A,0.00,R,0000,0001,3656.54,S,14500.00,E,001.5,00..,021.7,V*1B\13\10 ' 'where in line 1 the 3655.85,S is the latitude and 14458.99,E is the longitude PS=4800,N,8 BEGIN 1SERIAL(RS232,"\\e",W) 'Clean out receive buffer RA1SERIAL"$GPRMC" 'Trigger on header DELAY(W)=500 'Wait for all of string to come in 1SERIAL(RS232,"%16s[1$]",2,W) 1$("Header:") 1SERIAL(RS232,"%f[1CV],",2,W) 1CV("Latitude =",FF4)=1CV/100 1SERIAL(RS232,"%1s[2$],",2,W) 2$("") 1SERIAL(RS232,"%f[2CV],",2,W) 2CV("Longitude =",FF4)=2CV/100 1SERIAL(RS232,"%1s[3$]",2,W) 3$("") 1SERIAL(RS232,"\\e",2,W) END ````

Roger,

A number of GPS devices transmit their info every second. The Garmin 17N which I am using, send several sentences. It is also possible to tell the GPS device to send only the sentences that you wish to receive(eg on your DT800). Given (as in yor example here) the DT800 can trigger on the arrival of a particular serial sting eg $GPRMC, is it an advantage to the DT800, performance wise, to do this?

regards
Ian

Roger, A number of GPS devices transmit their info every second. The Garmin 17N which I am using, send several sentences. It is also possible to tell the GPS device to send only the sentences that you wish to receive(eg on your DT800). Given (as in yor example here) the DT800 can trigger on the arrival of a particular serial sting eg $GPRMC, is it an advantage to the DT800, performance wise, to do this? regards Ian

Good afternoon Ian,

Well if you can spend a specific string or better still a custom string with exactly what you want then I would use the feature.

The less resources the logger uses to monitor the incoming serial string the more available to do other things.

Cheers,
Roger

Good afternoon Ian, Well if you can spend a specific string or better still a custom string with exactly what you want then I would use the feature. The less resources the logger uses to monitor the incoming serial string the more available to do other things. Cheers, Roger
28
3
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft