Background information: I am using Visual Studio 2005 to write MFC/C++ on a dialog box. Please pardon me if I lack out any information or anything essential to answer my question. I will be checking this everyday from 9am - 5:30pm, so please don't hesitate to ask for any more background information.
I do know how to Open, Read, Write and Close a serial port using MFC/C++. The problem is I do not know what to send to the serial port. I have seen my colleagues sending Hexadecimal as such:
21 04 07 00 08 00 0F 22
My job is to display signal, noise and threshold onto the following graphs from the rx and tx board. The rx and tx boards are located at the bottom of things as such: (ttp://www.joyfay.com/images/fei833/POSsystem/SSS05.jpg)
- http://tinypic.com/view.php?pic=2qdbnf8&s=8#.U_7vU_mSxnQ
- http://tinypic.com/view.php?pic=29vxzmg&s=8#.U_7vi_mSxnQ
I am ready to learn and I am not asking for direct answers. I hope my fellow programming seniors in Stack Overflow can help me out here. Many thanks.
You will have to dig up the documentation for the device you are talking to. It should provide you with the protocol that's used to exchange data. Ask your colleagues about it, they surely know where that documentation is located.
I can only make rough guesses from
The 0x21 byte is likely to be the start byte that indicates the start of the frame. The device uses it to synchronize itself in order to detect the start of a frame. The 0x22 byte is likely to be the end byte, a confirmation that no more bytes are expected to follow. The device uses it to know that the frame was received in full so it can process the data. The 0x04 byte is likely to be a length byte, it encodes how many data bytes follow. Which appear to be 0x07, 0x00, 0x08, 0x00. Pretty unguessable what they encode, it might be two 16-bit values for example, 7 and 8. The 0x0f byte is probably the checksum of the data bytes, used to verify that the data bytes were not corrupted.
Very rough guesses, read the documentation to know for sure. And of course talk to your colleagues about it, little point in asking a completely stranger on the Internet when you have people that know the facts in the cubicle next to yours. Petzold's book "Code" is pretty good to help you stop talking about "hex".