|
-
Mar 20th, 2000, 08:40 PM
#1
Thread Starter
New Member
As a new user to Visual Basic, I am trying to use MSComm to communicate serially with a datlogger which i am trying to poll every second for data. I am getting VB 6.0 Pro tomorrow and should have no problems with the control itself as i do now with VB 5.0 However, do need help with setting the time intervals for polling the logger using MSComm and also if i can open both port on the same form if i wish to communicate with another piece of serailly linked equipment. Anyone?
-
Mar 20th, 2000, 09:09 PM
#2
Member
If you're looking to send a "command" to your data logger every second to get data, just plop down a timer and set the interval. If the data logger is active and you want to check the data that it has sent to the PC, the MSComm control will toss the incomming data into a buffer... You can read the contents of the incomming buffer after a specified time or you can let the oncomm event handle it:
Public Sub MSComm_OnComm()
Dim TempBuf As Variant
If MSComm.CommEvent = comEvReceive And MSComm.InBufferCount > 0 Then
TempBuf = MSComm.Input
Call HandleTheData(TempBuf)
end if
end sub
I don't see any reason why you can't just plop down two instances of the MSComm control (MSComm1 and MSComm2) -- as long as you open a different physical port for each control you shouldn't run into any problems.
Hope this helps!
[Edited by Andrew Herrmann on 03-21-2000 at 09:10 AM]
-
Mar 20th, 2000, 09:40 PM
#3
Thread Starter
New Member
thanks
Thanks a million. That should get me strsted anyway!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|