Support Forums
Host port parsing

I have been trying to connect a serial sensor(Gill 3D ultrasonic anemometer) in the host port. I changed the profile settings in the host port: BPS-57600; Data bits-8; Flow-None; Function-Serial; Parity-None;Stop Bits-1

Have following values in the SERSEN Port: BPS-57600 (changed from default); Data bits-8; Flow-None; Function-Serial; Mode-RS232; Parity-None; Stop Bits-1. Pressed OK the data taker went to reset.

This is the program I fed into DT80

'JOB=JOB1 
'COMPILED=2009/02/11 13:20:43 
'TYPE=dt80 
DT=\d 
BEGIN"JOB13" 
CATTN 
'Spans and polynomial declarations 
'Thermistor declarations 
'Switches declarations 
'Parameter declarations 
'Global declarations 
RS100T 
'schedule definition 
RA("B:",ALARMS:OV:100KB,DATA:OV:1MB)2serial"^B" 
2SERIAL("^B,Q,%f[1CV],%f[2CV],%f[3CV],M,%f[4CV],%f[5CV]") 
1CV("U~m/s") 
2CV("V~m/s") 
3CV("W~m/s") 
4CV("SOS~m/s") 
5CV("ST~deg C") 
END 
'end of program file

I did not get any error and can see that the program has been loaded into the DT80, but there is no activity. Maybe it is not responding to the signal sent in by the sensor. I have tested my sensor connection in PC and it is working fine. What did I do wrong?

avishekmalla

I have been trying to connect a serial sensor(Gill 3D ultrasonic anemometer) in the host port. I changed the profile settings in the host port: BPS-57600; Data bits-8; Flow-None; Function-Serial; Parity-None;Stop Bits-1 Have following values in the SERSEN Port: BPS-57600 (changed from default); Data bits-8; Flow-None; Function-Serial; Mode-RS232; Parity-None; Stop Bits-1. Pressed OK the data taker went to reset. This is the program I fed into DT80 ```` 'JOB=JOB1 'COMPILED=2009/02/11 13:20:43 'TYPE=dt80 DT=\d BEGIN"JOB13" CATTN 'Spans and polynomial declarations 'Thermistor declarations 'Switches declarations 'Parameter declarations 'Global declarations RS100T 'schedule definition RA("B:",ALARMS:OV:100KB,DATA:OV:1MB)2serial"^B" 2SERIAL("^B,Q,%f[1CV],%f[2CV],%f[3CV],M,%f[4CV],%f[5CV]") 1CV("U~m/s") 2CV("V~m/s") 3CV("W~m/s") 4CV("SOS~m/s") 5CV("ST~deg C") END 'end of program file ```` I did not get any error and can see that the program has been loaded into the DT80, but there is no activity. Maybe it is not responding to the signal sent in by the sensor. I have tested my sensor connection in PC and it is working fine. What did I do wrong? avishekmalla

I added \e to get rid of irrelevant data if present and a carriage return \13.
now it is working.

RA("B:",ALARMS:OV:100KB,DATA:OV:1MB)2SERIAL"^B" LOGONA GA
2SERIAL("\e{\013}^B,Q,%f[50CV],%f[51CV],%f[53CV],M,%f[54CV],%f[55CV]")

but still want to know why the previous program didn't function.

avishekmalla

I added \e to get rid of irrelevant data if present and a carriage return \13. now it is working. ```` RA("B:",ALARMS:OV:100KB,DATA:OV:1MB)2SERIAL"^B" LOGONA GA 2SERIAL("\e{\013}^B,Q,%f[50CV],%f[51CV],%f[53CV],M,%f[54CV],%f[55CV]") ```` but still want to know why the previous program didn't function. avishekmalla

Good morning Avishek,

I would have expected you to see a serial sensor port time out error and a message that shows the failure point. Was there a message in the error window of DeLogger?

The simplest way to workout what is happening is to run your code in DeTransfer and then set P56=1. This turns on the serial sensor port debug mode you will see an output dump of all the data in the input and output buffers and see each data item being read into the parsing string.

You will either need to read in all the data in the string or clear the buffer after reading in what you need.

Cheers,
Roger

Good morning Avishek, I would have expected you to see a serial sensor port time out error and a message that shows the failure point. Was there a message in the error window of DeLogger? The simplest way to workout what is happening is to run your code in DeTransfer and then set P56=1. This turns on the serial sensor port debug mode you will see an output dump of all the data in the input and output buffers and see each data item being read into the parsing string. You will either need to read in all the data in the string or clear the buffer after reading in what you need. Cheers, Roger

Thank you Roger,

I did not get any error or sensor timed out state when i ran the program.

RA("B:",ALARMS:OV:100KB,DATA:OV:1MB)2serial"^B"
2SERIAL("^B,Q,%f[1CV],%f[2CV],%f[3CV],M,%f[4CV],%f[5CV]")

The display would show channel names and---- .what could possibly have happened?. I will give it a try in Detransfer. thanks for the tip.

Cheers,
avishekmalla

Thank you Roger, I did not get any error or sensor timed out state when i ran the program. ```` RA("B:",ALARMS:OV:100KB,DATA:OV:1MB)2serial"^B" 2SERIAL("^B,Q,%f[1CV],%f[2CV],%f[3CV],M,%f[4CV],%f[5CV]") ```` The display would show channel names and---- .what could possibly have happened?. I will give it a try in Detransfer. thanks for the tip. Cheers, avishekmalla

Good afternoon Aveshek,

Your code will only return the status of the parsing:

  • If the incoming data matches that required by the input action then the DT80 will move on to the next input action in the string. If the end of the control string is reached then the SERIAL channel will return and set its status code to 0 (success).
  • If the timeout expires while the DT80 is waiting for more data then evaluation of the SERIAL channel will be terminated and its status code set to 20 (receive timeout).
  • If the timeout expires while the DT80 is waiting for a particular CTS state (i.e. \c0 or \c1 input action (P225)) then evaluation of the SERIAL channel will be terminated and its status code set to 5 (CTS timeout).
  • If data is received which violates the input action specification then evaluation of the SERIAL channel will be terminated and its status code set to 29 (Scan Error).

To see the actual output you will have to list the CV's in the schedule, for example:

RA("B:",ALARMS:OV:100KB,DATA:OV:1MB)2serial"^B"
2SERIAL("^B,Q,%f[1CV],%f[2CV],%f[3CV],M,%f[4CV],%f[5CV]")
1CV
2CV
3CV
4CV
5CV

Cheers,
Roger

Good afternoon Aveshek, Your code will only return the status of the parsing: - If the incoming data matches that required by the input action then the DT80 will move on to the next input action in the string. If the end of the control string is reached then the SERIAL channel will return and set its status code to 0 (success). - If the timeout expires while the DT80 is waiting for more data then evaluation of the SERIAL channel will be terminated and its status code set to 20 (receive timeout). - If the timeout expires while the DT80 is waiting for a particular CTS state (i.e. \c0 or \c1 input action (P225)) then evaluation of the SERIAL channel will be terminated and its status code set to 5 (CTS timeout). - If data is received which violates the input action specification then evaluation of the SERIAL channel will be terminated and its status code set to 29 (Scan Error). To see the actual output you will have to list the CV's in the schedule, for example: ```` RA("B:",ALARMS:OV:100KB,DATA:OV:1MB)2serial"^B" 2SERIAL("^B,Q,%f[1CV],%f[2CV],%f[3CV],M,%f[4CV],%f[5CV]") 1CV 2CV 3CV 4CV 5CV ```` Cheers, Roger
24
4
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