how to issue ascii commond to serial port

Status
Not open for further replies.

Neyolight

Full Member level 5
Joined
Aug 29, 2011
Messages
306
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
World
Activity points
3,624
Hello everybody

I have been playing around with a sensor for the past 1 week and realised it has an additional feature. The sensor captures an additional physical quantity but it does not transmit this quantity on to its control software running on the computer. So, I contacted the manufacturer about how can i possibly access that physical quantity.

The manufactures told me to upgrade my firmware on the sensor ( which I did) and then implement "ASCII" command to read the data. The command is something like " GET BLA". For example, to read the physical quantity #1 you will issue the following ascii command on the serial port to the sensor.

get1 2

Now, being a somewhat noob at programming (though I really want to be good at it one day) , I am unsure how to implement this code. I don’t know what program I can use to send " get : P1 2 " on the serial port of the sensor. The sensor is currently connected to my laptop via a serial to USB converter. Also the physical quantity Im trying to capture is stored as a volatile variable in the sensor.

It would be very helpful if I could use Excel to capture this data. Also I have to continually gather this data. It’s not a one off transmission.

Please Help ....I’m kind of lost :-?
 


You can perform easy test using HYPERTERMINAL (or 232Analyzer), both free-software for PCs.
Just set the right Baud Rate, COM port Nr and type from the keyboard:
get1 2
Hyperterminal will convert these letters to ASCII and send them via opened serial port.

:wink:
IanP
 

Hmm thanks. I just gave it a shot and as soon as I connect hyperterminal to my sensor and starts to type "get" , the hyperterminal feezes. Infact Im unable to type anything in the terminal once it gets connected to the sensor.

- - - Updated - - -

Ohh just realised, even before any connection with the sensor I am unable to type in the hyperterminal. Guess I need to install it again.

- - - Updated - - -

Just tried the same with 232Analyzer as I just could not type in hyperterminal. I dont seem to get any data back from sensor.
 
Last edited:

1. Is the device RS232 compliant? You might need to add an interface between the PC serial port and the data output on your sensor.
2. Unless you have the PC handshaking lines connected, turn off "hardware handshaking" in Hyperterminal.

Brian.
 

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…