473,466 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to commnicate correct data through COM-port

1 New Member
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
Oct 24 '10 #1
0 990

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Martin | last post by:
This is probably a very easy one but I just can't put my finger on the communicating events name:- I have a MDIform with a couple of child forms. The child forms scroll vertically at run time...
2
by: Eric Brunel | last post by:
Hi all, We're trying to communicate with Microsoft Visual C++ 6.0 via COM to make it perform a few operations. Our main need is to set a breakpoint on a given line in a given file. We ended up...
3
by: Michael Sparks | last post by:
Hi, I'm posting a link to this since I hope it's of interest to people here :) I've written up the talk I gave at ACCU Python UK on the Kamaelia Framework, and it's been published as a BBC...
1
by: valere | last post by:
I look for information for communicating between JavaScript and a native plugin. I noticed that LiveConnect is oriented to communicate as a "bridge" between Java and JS. But how to process with a...
3
by: Stan | last post by:
Hallo, I have developed an application in MS Access 2000 (Polish version) under MS Windows XP prof (also Polish). Now I would like to run this code on MS Windows XP EN and MS Access XP EN. I have...
0
by: Filips Benoit | last post by:
A particular form - always the same - sometimes becomes corrupt after saving. Error msg = The expression On Open you entered as the event property settings produced the following error: A...
0
by: DD | last post by:
I am trying to place a Word document into a form. I get the following error A problem occured while Microsoft Access was Communicating with the OLE or Activex Control the name of the ole is...
2
by: Matthew Playne | last post by:
Hi, I am having a problem communicating between to classes. I have an MDI application. The parent window contains a mainMenu and a toolbar and toolbuttons, and the child form contains a...
10
by: Marcin Zmyslowski | last post by:
Hello all! I have a database created in MS Access 2003 which works fine in Win2000. This database shows me the following message in WinXP: "The expression On Load you entered as the event...
4
by: Mikael Olofsson | last post by:
I am interested in peoples experience with communicating with DLLs under Linux. Situation: I'm an electrical engineer that finds pleasure in using my soldering iron from time to time. I also...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.