The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Programming Question by LeiraHoward2002-07-24 11:14:58
  i might be able to help... by cybergeek2002-07-24 11:40:32
    Manual by LeiraHoward 2002-07-24 11:54:21
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?

[ Reply ]
      i don't know if i'm up to it... by cybergeek2002-07-24 12:00:17
        Heh... by LeiraHoward2002-07-24 12:27:36
          Well it's been a long time since... by Apfel2002-07-24 12:32:14
            Beats me... by LeiraHoward2002-07-24 12:41:57
              Got a... by Apfel2002-07-24 12:47:46
                Manual? by LeiraHoward2002-07-24 13:10:09
            try "fprintf ( STDAUX, "your command here" ); by i_am_pi2002-07-24 12:51:29
              Ha, I knew there was something like that! by Apfel2002-07-24 12:57:02
              Okay, I'll try that. by LeiraHoward2002-07-24 13:08:40
      have you tried... by ToLazyToThink2002-07-24 16:18:01

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)