Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comm Control Question

Status
Not open for further replies.

shannanl

IS-IT--Management
Apr 24, 2003
1,071
US
I am trying to write an interface to a lab machine. The machine sends test results automatically when they are finished. I can not get the results to display in my VB app. I can use hyper terminal and it will dump the results just fine but it will not in my app. I am using a null modem on serial that I know is good because I can hook it up between two computers and it works fine. We also did a 2 way port test with the lab machine and it sent and received the test data but it will not recieve the actual data. I am using the oncom event to get the input like this:

Private Sub MSComm1_OnComm()

Select Case MSComm1.CommEvent
' Event messages.
Case comEvReceive
Text2.Text = Text2.Text & MSComm1.Input
End Select

End Sub

The machine can also take limited input. The input is supposed to be in a certain format and if the machine receives incorrectly formatted imput it is supposed to generate an error message. I never get the error message when I send data to the machine but the machine just seems to ignore the data as if it was generating errors. All the settings are mirrored from my app to the lab machine, ie 9600,N,8,1, etc. Any ideas of what to check?

Thanks,

Shannan

 
What's the Rthreashold setting for your com port? Is the data always the same length? You probably want a value of 0 to get each individual transmission.

Put a breakpoint on the "Select Case" in your OnComm event and make sure it is firing when the machine spits out it's data, and that the event matches what your select case statement is looking for.

Robert
 
I have the rt and st set at '1'. I did place a msgbox that would signal the oncomm event being fired and it never was fired.

Shannan
 
Shannan,

Did the fact that we got your comm port communicating in thread222-856370 take care of this problem?

-Sean
 
Yes, that was the fix for the problem. I appreciate it.

Thanks,

Shannan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top