>> "...those two are properties of the the COMSTAT structure,..."
That's what I figured, but my knowledge is too limited to take it further. Someone else suggested I look in MSDNâ¦never went there before...hope it isn't too far over my head.
>> Did the original module you were adapting from actually work? Just wondering if he may have been using a dll to get around the problem (my usual route when problems arise between
vb and vba).
Yes it was and is working w/my enhancements (seems fairly robust, but more testing planned). I found ways to circumvent serial port reading problems without resorting to port status checking. This mostly uses knowing what the remote unit (a ham radio) is going to reply/send and rigorously parsing all bytes. The original programmer only looked for key bytes. If there is nothing in the buffer I will get a read error if I try to read, so I don't try if I previously got a valid [EOM] byte...things like that. If you try to open an open port you must close that numbered port or else exit Excel and restart. I started to add code to allow closing on error, but the complexity of the code makes it hard to catch the port handle for this. [[I really need to flow chart it out to correctly solve this.]] I have LOTS of Debug.Print statements and can also manually close the port by reading the handle in the Immediate window and calling the close port sub manually also
If he is using a dll, I wouldn't know it. Beyond my capability, don't know what they are.
... Guy who thinks he can do anything (actually I developed my own laser light show software) sees this spreadsheet on a Yahoo group doing some serial I/O. The code is pretty crude by any standard, but works. Wants to add. Never played with
VB except for a few Excel macros. Diggs in. Scans the web and VBA help. Slowly catches on...sorta'...
I see this "CommModule" in VBA and up in the CommModule Declarations section there are some "Defined Functions" that go where I don't know. They look like this, the one in question:
Declare Function ClearCommError Lib "kernel32" (ByVal hFile As Long, _
lpErrors As Long, lpStat As COMSTAT) As Long
He used it as shown in the original post (I am reading on the web (so it is above) but get the emails on Yahoo.
73 (Best Regards), K9DCI, Steve
========================================
Wrox P2P Forum Subscriptions <
[email protected]> wrote:
Hello NoskoSteve,
Forum member shattered has posted a reply to the topic "Serial I/O with Excel" in the Excel_VBA forum.
Topic: Serial I/O with Excel
Message:
------------------------------------------------------
will look into it closer but in answer to part of your question..
Quote:
|
quote:***cbInQue and cbOutCue are not defined anywhere in the project
|
those two are properties of the the COMSTAT structure, not seen it used in VBA before though (usually
VB).
No single raindrop believes it is responsible for the flood.