I have a piece of equipment connected to my PC by USB port. This is showing up as COM7.
Using VB I can open the port, but any data sent to it does not get there. This I can tell because the command should switch a light on, amongst other things. I have tried changing COM7 to COM19 and port does not open.
I can open port and send data from HyperTerminal and from Docklight. I can connect my PC to another PC running Docklight or HyperTerminal and the data gets there. So I am fairly confident about my code, shown below.
I have read an article published a few years ago, talking about serial ports and saying that there were problems with Net 3.5. The problems were such that you couldn't use it to address serial ports.
Sub SendSerialData(ByVal data As String)
Dim J As Integer
Dim jl As Integer
jl = Len(data)
For J = 1 To jl
SerialPort1.Write(Mid(data, J, 1))
MsgBox(Mid(data, J, 1))
MsgBox("Sent - " & data )
What I have tried:
I have tried various options, two of which you can see in my code above, the remmed out lines being the alternative option.
I have tried sending string, one character at a time and the whole line at a time, nether works.
I have also tried setting port parameters, such as baud rate in device manager.
I have tried have SerialPort on the form, and not having it.
Firstly anyone know if the problems in Net 3.5 have been fixed ? Does 4.6 work ?
Any suggestions please to sort this ? I think I have tried most of write options .
Once this works then I'll need it to read the responses....
Thanks for reading.