Can someone show me a quick way to receive text using the MSComm control. I can make the dialup connection but can not see any data being returned using outputfield.text=MSCommCtrl.input. Can anyone bail me out?
Printable View
Can someone show me a quick way to receive text using the MSComm control. I can make the dialup connection but can not see any data being returned using outputfield.text=MSCommCtrl.input. Can anyone bail me out?
If you are expecting to receive text, set the InputMode property to comInputModeText, else comInputModeBinary
Also, ensure that your RThreshold property is set to 1, do NOT set a higher number for this property
To check that you are indeed connected via Modem, check the CDHolding property with a Timer control.
If CDHolding = True then test for any received serial data by testing the InBufferCount property. If the InBufferCount > 0 (Rx Serial data) then assign a string variable to the Input property. eg. RxBuf = MSComm1.Input
If you are expecting binary data then you need to declare a binary array and assign the .Input data to that array.
You can also have event-driven rx serial using the comEvReceive event via the OnComm event.
HTH
Adrian