Where should I post this?
I have a simple project that controls devices via serial I/O. I'm new to VB, using VB Express. I design hardware and normally write assembler, C or BASIC for tiny processors and VB5 is sure full of surprises for someone with my background!
So I used this construction (and tried many variations that didn't work either):
I have seen this cited as an example on numerous VB help sites. It's even in the VB help files. It's simple and clean and I may need to read as well so it's appealing.
Result (from a serial monitor): the H00 is not sent, the HFE becomes H3F followed by H00, the rest are correct, but each byte is followed by H00
My conclusion is it's converting to 16-bit UNICODE. I have spent hours trying to find how to disable such conversion to no avail. I'm thinking that I want it to be UTF8, but that's just a guess at this point.
Using MSComm looks to be too advanced for me at this point. No VB programmer I've contacted has a clue about serial I/O and they won't take a contract to code it correctly for me.
Thanks in advance.
Gene James
I have a simple project that controls devices via serial I/O. I'm new to VB, using VB Express. I design hardware and normally write assembler, C or BASIC for tiny processors and VB5 is sure full of surprises for someone with my background!
So I used this construction (and tried many variations that didn't work either):
VB.NET:
'send DVK100 start keying commands (select cam1)
Using KeyerCom As IO.Ports.SerialPort = _
My.Computer.Ports.OpenSerialPort(KeyerPortName, 38400, IO.Ports.Parity.None, 8, IO.Ports.StopBits.One)
KeyerCom.DtrEnable = True
KeyerCom.Write(Chr(&H0) & Chr(&HFE) & Chr(&H40) & Chr(&H67) & Chr(&H31) & Chr(&H5F) & Chr(&H5D) & Chr(&HFF))
End Using
I have seen this cited as an example on numerous VB help sites. It's even in the VB help files. It's simple and clean and I may need to read as well so it's appealing.
Result (from a serial monitor): the H00 is not sent, the HFE becomes H3F followed by H00, the rest are correct, but each byte is followed by H00
My conclusion is it's converting to 16-bit UNICODE. I have spent hours trying to find how to disable such conversion to no avail. I'm thinking that I want it to be UTF8, but that's just a guess at this point.
Using MSComm looks to be too advanced for me at this point. No VB programmer I've contacted has a clue about serial I/O and they won't take a contract to code it correctly for me.
Thanks in advance.
Gene James
Last edited by a moderator: