I need to make 51 controller communicate with one device, which takes ASCII command. In the CD coming with that device, there are some VC files and one *.dll file. My question is can I make it in C language since I'm using 51 controller? I don't have any clue on how to do this. Can anyone help me out? Thanks a lot!
The communication is on RS232. Thanks!
Sorry for first unclear post. The device take ASCII command when I use its own communication software. I need to make my software in C to communicate with this device. But I don't know exactly what "word" the device takes.
"Sorry for first unclear post." I'm afraid it's still as clear as mud to me! What I understand so far is: 1. You are developing some sort of 8051-based "controller" 2. Your "controller" needs to communicate over an RS232 link with some sort of 3rd-party "device" 3. You want help with the RS232 communications, but you have given absolutely no information whatsoever about this 3rd-party "device" - what is it? what does it do? what make/model/version? etc? Note that this forum is for discussing Keil tools - for support on this 3rd-party "device", you need to contact the manufacturer/distributor/agent/whatever.
"2. Your 'controller' needs to communicate over an RS232 link..." One thing to note is that your 8051 neither knows nor cares what is on the other end of the RS232 link (nor does it need to). As far as your 8051 is concerned, it just sends bytes (characters) to its serial port, and receives bytes from its serial port - where those bytes ultimately go to or come from is entirely irrelevant to the 8051. Therefore you can consider this in two levels: 1. a low-level "driver" which simply handles the sending & receiving of bytes to/from the serial port. You can test this with a dumb terminal, or a terminal emulator (eg, Hypoterminal). 2. an upper-level handler for the specific "protocol" used by the 3rd-party "device" Note also that the uVision simulator can use the PC COM: port for its simulated serial input and output - so you can run your code in the simulator, while using a real RS232 connection (on the PC's COM port) to your real 3rd-party "device"