29 Jun 12 7:51
i am using VB6 to talk to an instrument via comportm port, using a portmonitor i can see the strings being sent all ok. I cannot however seem o get a response back to my request.
I am using the mscomm control and trying to receive the repsone, whioch should be an acknoloedgement via the
MSComm1_OnComm() event. But nothing is returned, i am wondering if i ned to wait a while to see if a response is genereated but connot find out if or how to do this.
here is how i am opening my port:
Private Sub CommOpen(PortID As Integer, Settings As String)
.Settings = Settings '(9600,N,8,1)
.CommPort = PortID '5
.InBufferSize = 1024
.RTSEnable = 1 'True 'set this to enable receing of information.
.EOFEnable = 1 'True
.InputLen = 0 'lenght of string being sent 0 - read everything
.InputMode = comInputModeText
'3rd party hardware uses XOnXOff handshaking
.Handshaking = comXOnXoff
.PortOpen = True
where is how i send the message:
strMessage = ":I:PR1/?/.."
'mscomm1.OutBufferSize = Len(strMessage)
MSComm1.Output = strMessage + Chr(13)
'try to get the response
sResponse = MSComm1.Input
msgbox sResponse 'comes back blank.
and here is the mscomm1_comm event code.
Private Sub mscomm1_OnComm()
I am asuming i must have missed a config setting soemwhere of have set it wrong, but after looking on the interweb for hours everything seesm to be as everyone suggests.
Can anyone help me or, if i can find them, do I have to call the A team