Support Forums
Interrogating serial output

I am trying to use a dataTaker (DT80) to interrogate a device with a serial comms output (RS232). I am wondering is it possible to use a dataTaker to ask a device for a status check and then save the data from the interrogation?

For example if I wanted to gain the status of a modem via a hyperterminal session, I would use the code AT&V. I would then get the following output:

ACTIVE PROFILE: B0 E1 L1 M1 N0 Q0 T V0 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 &Y0 S00:000 
S01:000 S02:043 S03:013 S04:010 S05:008 S06:003 S07:050 S08:002 S09:006 S10:014 S11:085 S12:050 S18:000 S25:005 S26:001 S36:007 S38:020 S46:138 S48:007 S95:000 
STORED PROFILE 0: B0 E1 L1 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 
S00:000 S02:043 S06:003 S07:050 S08:002 S09:006 S10:014 S11:085 S12:050 S18:000 S36:007 S40:104 S41:195 S46:138 S95:000 
STORED PROFILE 1: B0 E1 L1 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 
S00:000 S02:043 S06:003 S07:050 S08:002 S09:006 S10:014 S11:085 S12:050 S18:000 S36:007 S40:104 S41:195 S46:138 S95:000 
TELEPHONE NUMBERS: 0= 1= 2= 3=

I would like to be able to perform a similar query say once a minute and store that data on the dataTaker and then download it at some stage.

David Blom

I am trying to use a dataTaker (DT80) to interrogate a device with a serial comms output (RS232). I am wondering is it possible to use a dataTaker to ask a device for a status check and then save the data from the interrogation? For example if I wanted to gain the status of a modem via a hyperterminal session, I would use the code AT&V. I would then get the following output: ```` ACTIVE PROFILE: B0 E1 L1 M1 N0 Q0 T V0 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 &Y0 S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:003 S07:050 S08:002 S09:006 S10:014 S11:085 S12:050 S18:000 S25:005 S26:001 S36:007 S38:020 S46:138 S48:007 S95:000 STORED PROFILE 0: B0 E1 L1 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 S00:000 S02:043 S06:003 S07:050 S08:002 S09:006 S10:014 S11:085 S12:050 S18:000 S36:007 S40:104 S41:195 S46:138 S95:000 STORED PROFILE 1: B0 E1 L1 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 S00:000 S02:043 S06:003 S07:050 S08:002 S09:006 S10:014 S11:085 S12:050 S18:000 S36:007 S40:104 S41:195 S46:138 S95:000 TELEPHONE NUMBERS: 0= 1= 2= 3= ```` I would like to be able to perform a similar query say once a minute and store that data on the dataTaker and then download it at some stage. David Blom

Good morning David,

I'm assuming you are doing some modem testing and not trying to use the modem to communicate with DT80? If you are doing modem testing then
this is relatively simple. If you are swapping the modem in and out of command mode and swapping DT80 between serial and command mode then things get a lot harder.

To make things simple I'll assume the modem is in command mode and we are simply cycling the power and checking the settings don't change.

The simplest way would be to send the AT&V the parse out the result into string variables and log those. This will work if you line length doesn't exceed 80 characters. (Your maximum line length in your sample data is 80 characters). If the lines do go over 80 chars then you will need to split the longer lines by using two reads for each line. (Not hard)

Make sure you use the 7.08 firmware as we have just increased the number of string variables from 10 to 50.

Your process will be:

  • Clear the input buffer.
  • Send the AT&V
  • Match to the message "ACTIVE PROFILE:"
  • Read in the string until end of line marker and save to string variable %s[n$] (Where n is the number of the sting variable 1 to 50)
  • Repeat 3 more times.
  • Match to the message "STORED PROFILE 0:"
  • Read in the string until end of line marker and save to string variable %s[n$]
  • Repeat 3 more times.
  • Match to the message "STORED PROFILE 1:"
  • Read in the string until end of line marker and save to string variable %s[n$]
  • Repeat 3 more times.

  • Read in the phone numbers. These could be stored as either a string or an integer, that will depend on what you want to do with the data latter.

Cheers,
Roger

Good morning David, I'm assuming you are doing some modem testing and not trying to use the modem to communicate with DT80? If you are doing modem testing then this is relatively simple. If you are swapping the modem in and out of command mode and swapping DT80 between serial and command mode then things get a lot harder. To make things simple I'll assume the modem is in command mode and we are simply cycling the power and checking the settings don't change. The simplest way would be to send the AT&V the parse out the result into string variables and log those. This will work if you line length doesn't exceed 80 characters. (Your maximum line length in your sample data is 80 characters). If the lines do go over 80 chars then you will need to split the longer lines by using two reads for each line. (Not hard) Make sure you use the 7.08 firmware as we have just increased the number of string variables from 10 to 50. Your process will be: - Clear the input buffer. - Send the AT&V - Match to the message "ACTIVE PROFILE:" - Read in the string until end of line marker and save to string variable %s[n$] (Where n is the number of the sting variable 1 to 50) - Repeat 3 more times. - Match to the message "STORED PROFILE 0:" - Read in the string until end of line marker and save to string variable %s[n$] - Repeat 3 more times. - Match to the message "STORED PROFILE 1:" - Read in the string until end of line marker and save to string variable %s[n$] - Repeat 3 more times. - Read in the phone numbers. These could be stored as either a string or an integer, that will depend on what you want to do with the data latter. Cheers, Roger

It's actually interrogating a radio system that communicates via a serial port. On this type of radio, there are no analogue ports to monitor. If I can achieve the example with the modem (which is sitting on my desk, then the radio should be a doddle).

Firstly with the wiring, can I use a serial cable (straight through 9 pin to 9 pin) and connect it to the serial port on the dataTaker or do I have to extract wires 2, 3 and 5 and plug them into one of the digital ports and if so how would I wire those?

I believe we are going to be using either the USB or Ethernet ports to communicate with DT80 when it's placed out in the field.

It's actually interrogating a radio system that communicates via a serial port. On this type of radio, there are no analogue ports to monitor. If I can achieve the example with the modem (which is sitting on my desk, then the radio should be a doddle). Firstly with the wiring, can I use a serial cable (straight through 9 pin to 9 pin) and connect it to the serial port on the dataTaker or do I have to extract wires 2, 3 and 5 and plug them into one of the digital ports and if so how would I wire those? I believe we are going to be using either the USB or Ethernet ports to communicate with DT80 when it's placed out in the field.

Good afternoon David,

There certainly is some good data to play with. The comms port on the DT80 is pinned the same as a PC, so the cable you you use to connect to the PC will be the one you use.

You will need to change the profile setting for the host port to serial mode so you can parse the data. Profile "Host_Port" "Function"="Serial" if you are using DeTransfer.

The whole point of the serial sensor work is to know exactly what the incoming data format is so you can parse it out.

Feel free to ask questions.

Cheers,
Roger

Good afternoon David, There certainly is some good data to play with. The comms port on the DT80 is pinned the same as a PC, so the cable you you use to connect to the PC will be the one you use. You will need to change the profile setting for the host port to serial mode so you can parse the data. Profile "Host_Port" "Function"="Serial" if you are using DeTransfer. The whole point of the serial sensor work is to know exactly what the incoming data format is so you can parse it out. Feel free to ask questions. Cheers, Roger
33
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