Hi!
Even though I consider myself being an experienced programmer for several years, I’ve hit a brick wall after starting to use VB8.0. And I have never been working on communication devices before, so now I’m stuck and need help!
What I'm working on is this: I'm writing a program to remote control advanced deepwater Sony-cameras. To send a control command to the camera you first need to send the address, H8x (x: camera number, which can be 1 to 7, and 8=all connected cameras). Then a series of bytes with the appropriate command, and finally a termination command HFF.
So far so good. But when I test the program, by connecting a device which lists data coming through the COM-port, all characters sent are correct up to ASCII 127, which probably means that my program is sending only 7 bits and not 8th bit.
As I said, I'm new to communication devices, but as far as I understand the COM-port communicates string data. So I have tried to send data as arrays defined both as string and byte arrays. And the code-to-string conversion I've tried both CHR(data) and CHRW(data).
The code sequence I used for testing was this:
[code]
For data = 1 To 255
Using ComPort As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort("COM5", 9600, IO.Ports.Parity.None, 8, IO.Ports.StopBits.One)
ComPort.Write(ChrW(data))
End Using
Next
[CODE/]
Whatever I do all data read by the connected terminal reads the appropriate hex values and characters up to 127, but from 128 on it reads H3F (question mark).
Can anybody out there give this VB8 newcomber and amateur some help!
Stein/Norway