Steven Rightnar wrote: > Hello all: > I am having a problem with a receiving on the serial port (transmitting is > fine). I have a visual C++ program that will send and receive over the > serial port and I have a box (with unknown contents at the other end which > controls dc motors). So to make these motor go to a position you send a > ASCII char like p. there are a series of characters that do different > things. So if I send the @ char it is suppose to return the current > coordinates. When I send @ I get something back ( symbols) but it is not the > numbers. The paperwork that came with this box states that if you send p > it returns the coordinates in 0.1mm units and the values are two bytes > binary form. This is where I am uneducated ...it seems that since my program > is not seeing the data the right way. Does anybody have any knowledge on > this or can tell me of a resource ( I have been through most VC++ books).Any > help would be greatly appreciated. I would guess you need to treat the characters as binary bytes... (Like it says) So 2 bytes of 8 bits each gets you values up to 65,535. Convert the characters into binary bytes, align them and decode them to decimal. MS byte * 256 + LS byte. > > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu -- * | __O Thomas C. Sefranek tcs@cmcorp.com |_-\<,_ Amateur Radio Operator: WA1RHP (*)/ (*) Bicycle mobile on 145.41, 448.625 MHz ARRL Instructor, Technical Specialist, VE Contact. http://hamradio.cmcorp.com/inventory/Inventory.html http://www.harvardrepeater.org -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu