473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Packets

I am trying to write a vb.net app that talks to a device
over the network. This device has a specific structure
for the packet. The C code is:
struct Packet
{
WORD wToken1;
WORD wToken2;
UINT uID;
WORD WaveformSel;
BYTE bSize;
BYTE bReserved[5];
union dataHeader
{
BYTE data[32];
unsigned short int
shortIntVal[16];
unsigned long int longIntVal[8];
float
floatVal[8];
} headerData;

I have tried to do a structure but can't seem to figure
it out and our C programer doesn't do VB. Any help would
be apreciated.
Nov 20 '05 #1
1 880
David,
By "packet" do you mean a TCP/IP packet?

If this is TCP/IP based I would recommend custom
serialization/deserialization routines based on the BinaryReader &
BinaryWriter classes in the System.IO namespace.

The following article gives a C# example of how do this.

http://msdn.microsoft.com/library/de...rp09182003.asp

The example should be easily converted to VB.NET, post if you need help.

Hope this helps
Jay

"David Hognkamp" <da***************@office.xerox.com> wrote in message
news:02****************************@phx.gbl...
I am trying to write a vb.net app that talks to a device
over the network. This device has a specific structure
for the packet. The C code is:
struct Packet
{
WORD wToken1;
WORD wToken2;
UINT uID;
WORD WaveformSel;
BYTE bSize;
BYTE bReserved[5];
union dataHeader
{
BYTE data[32];
unsigned short int
shortIntVal[16];
unsigned long int longIntVal[8];
float
floatVal[8];
} headerData;

I have tried to do a structure but can't seem to figure
it out and our C programer doesn't do VB. Any help would
be apreciated.

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: yawnmoth | last post by:
so... i'm trying to send some FTP packets, via PHP, and... i'm not really sure how to construct 'em. HTTP 1.0 packets have the following structure: GET http://whatever.com/ HTTP/1.0 Accept:...
3
by: MikeH | last post by:
I have the weirdest problem with an Access 97 database... The application comprises the usual front-back split database. It's built around Access 97 and had been running without serious problems...
4
by: Brian Rice | last post by:
I have a socket application that is sending and receiving packets asynchronously. It works great except, when I receive packets that are larger than my receive buffer which then generate several...
1
by: HL | last post by:
How can I watched the outgoing packets. for exampled, when I send an email, how can I catch the whole outgoing packets? I've looked for some snifer-like tools, most of them "just" watch the...
3
by: Hiroyuki Tanaka | last post by:
Dear Readers, I am trying to learn C# network programming and I have discovered that Windows TCPIP often joins small packets and send them as one to the remote server. This appears to be a...
1
by: ygy | last post by:
When I receive the UDP packets,and then Set the image pixel using Image::Setpixel(),but When I invalidate the interface to show the image,the UDP packets missed.How to solve the problem? thank you...
0
by: Fraser Dickson | last post by:
I am building a web based system using ASP.NET and VB.NET which has to interact with a web service which uses XML WDDX packets. I have been given the XML Packet Specification by the Web Service...
6
by: Ryan | last post by:
Hi, I am confused with how NetworkStream works. My application needs to handle heavy requests sent through TCP socket connection. I use NetworkStream.Read method to get the stream...
12
by: Janto Dreijer | last post by:
This is probably more of a networking question than a Python one, but it would be nice to know if someone has done this with Python's socket module. And besides one usually gets more information...
5
by: jaco.versfeld | last post by:
Hi There, I have a basic TCP client and TCP server in C++. The TCP client connects to the server, and after a setup phase starts to transmit a file to the TCP server using multiple packets...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.