comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Help with COM1 programming!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Help with COM1 programming! [message #1479] Mon, 27 September 1993 08:46
penzes is currently offline  penzes
Messages: 2
Registered: September 1993
Junior Member
The purpose of this posting is to try to clear up a problem
I am having with programming the COM1 port of my PC.
I am using IDL V3.1 for windows. I have written a widget based
program to control a Sony Hi8 VCR which is attached to the serial port.
This package has the capability to write to the port through a shrink
wrap of the C commands (inp, inpw, outp, and outpw). Using these
commands I can send the commands to the VCR to control it. My problem
comes about when I try to get information back from the VCR. If I send
for example, the command to return the time code on a tape, all that is
returned is garbage. In all this there is a way to make it work. If I
turn on the windows terminal emulation package, change the baud rate to
9600, and iconify the program, my IDL program works as expected. The
same holds true if I start up PROCOMM Plus for Windows with a direct
connection set up for COM1. As an aside, I had to program in a wait
state even at 9600 baud. I would prefer to not have my end users have
to go through a series of steps external to the IDL program to have the
VCR controller function properly.
I have come to the conclusion (possibly wrong) that my problem
comes from the fact that I am providing no port initialization commands.
In an effort to remedy this I have attempted the following:

1) I talked to the MS technical programmers to check out what
terminal.exe does on startup. The person I talked to didn't have source
so the best thing he could tell me was that terminal probably enters
some SetCommState info but he wasn't sure. While talking to him I
checked all the control panel settings and they appear to be correct.
2) I talked to the IDL tech reps but their emphasis had been on the
shrink wrapping and not on the port programming.
3) I tried spawning commands from within IDL that allowed me to use
the DOS "Mode COM1" command to set the port characteristics. This
didn't work but I think it should have since this would set the port
hardware characteristics which I assume would be active until I turned
off the PC.
4) I verified that it is a com problem by checking with a QBasic
program. If I use the open command with the RS option (suppress
detection of RTS) the Qbasic program will receive the requested info
properly.
5) I spent some time with the tech reps on the PC hardware (Dell)
trying to find out if they had done anything out of the ordinary
regarding the serial port addressing. The answer was no (uses 3F8 for
com1).
6) The last possibility which I have not yet explored is the use
of a C program to change the port. IDL allows declarations to external
(C or Fortran) routines. My problem is that I am pretty weak in C
programming so I have left this as a last alternative.

I am now trying to use the actual UART programming to change the
port characteristics. It is my understanding that this would allow me
to use the "outp" commands to write directly from my program to change
the registers which affect the baud rate of the port. My problem is
that I don't know the proper way to do this, nor can I find anybody
locally who can help me, nor can I locate a good reference source which
I can purchase that would help. If any of you who have gotten this far
can help I would appreciate some pointers to good UART programming help
or for that matter on any other leads that could lead to a solution of
this problem.
Either E-mail or postings to the followup newsgroup are
acceptable.


Thanks, Steve
------------------------------------------------------------ ------------
Steven Penzes Internet: penzes@dres.dnd.ca
D.R.E.S. Voice: (403) 544-4761
Box 4000, Medicine Hat, Alberta FAX: (403) 544-3761
Canada T1A-8K6
------------------------------------------------------------ ------------
[Message index]
 
Read Message
Previous Topic: Re: Faster movies in wave
Next Topic: RSI response to CONTOUR problems/questions.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:32:36 PDT 2025

Total time taken to generate the page: 0.00454 seconds