Home/Support/Support Forum/Anybody monitoring Watchport Sensors With Visual Studio 2005
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Anybody monitoring Watchport Sensors With Visual Studio 2005

0 votes
I am seeing different types of text encoding from my Watchport sensors when I try to read data from them using the serial port object in VS 2005. The response to the "I" command seems to be unicode but the temperature report or distance report (Watchport/T and Watchport/D) seems to be ASCII encoding. I can set it up to display the temperature or distance report but I only get one character when I try and get an identification (I get "W"). I can look at the bytes in the string and every other byte spells out "Watchport/x" but I don't see this type of string from the temperature or distance report. Those reports seem to be ascii strings.
asked Nov 10, 2006 in USB Serial by RideABike New to the Community (5 points)

Please log in or register to answer this question.

5 Answers

0 votes
Hello,

The different encoding is by design and the easiest thing to do is to convert the "I" responses from unicode to an ASCII string in software.

What programming language are you using? We may be able to provide sample code.
answered Nov 10, 2006 by jeremym Veteran of the Digi Community (1,687 points)
0 votes
Really? What's the reason for the multiple character encodings? What's good about that?

I have a single string from the System.IO.Ports.SerialPort DataReceived event that has characters with two different encodings.

I am using Visual Studio 2005 and programming in Visual Basic.
answered Nov 10, 2006 by RideABike New to the Community (5 points)
0 votes
The other thread has sample data from a DataReceived event. I am very interested in seeing some sample code that would parse that single string that contains two different encodings.

Here's the other thread:
http://www.digi.com/support/forum/viewthread_thread,4935#15620
answered Nov 10, 2006 by RideABike New to the Community (5 points)
0 votes
I am also seeing that I am not getting the correct number of characters read from the serial port. I can set my encoding to System.Text.Encoding.Unicode to match the "I" command but when I get the response, it says that there are more than 11 characters. I end up with a string like the following:

"Watchport/P䤍癮污摩䌠浯慭摮"
answered Nov 13, 2006 by RideABike New to the Community (5 points)
0 votes
Please e-mail me: jmcbane (at) digi.com

I'll reply with the code, which should be available for me within the next 24 hours.

Best regards.
answered Nov 13, 2006 by jeremym Veteran of the Digi Community (1,687 points)
...