| I have a 3 inch thick manual with all the possible commands in Qbasic. Each command is sent over to the device via com port.
Here is the code for initializing the port:
OPEN "COM1:2400,N,8,1,CD500,DS0,LF" FOR RANDOM AS #1
That sets the COM1 port to 2400bps,noparity,databits:8bit,stopbits:1bit,Terminator:linefeed. I don't know what the other commands (CD500,DS0) do, unfortunately.
All commands are sent to the device as follows:
PRINT #1, "COMMANDNAMEHERE"
Any device queries are of the following form:
PRINT #1, "QUERYCOMMANDHERE?"
Any inputs from the device immediately follow a query, and are of the form:
INPUT #1, DATAVARIABLENAMEHERE
The entire list of commands takes several pages, but are always used the same way, with the PRINT #1 command sending to the device. I need a way to do the same thing using C++. I'd have to initialize the port, then send the data over, and wait for a reply on the queries. Any ideas?
|