hi,
i need to develop the protocol for the communication between the two devices which have inbuilt software ,called as event handlers.
i need to activate those event handlers in the first device, by writing the code in C language,the first device is connected at the serial port of the pc.first device can able to send signals to the second device over the powerline.
overall task is how to send a message format from pc to a device connected at the serial port.the message is understandable by the device by means of the inbuilt software of the device.message contains some hex data(8 bytes or 24 bytes of data contains the first device,second device addresses and commands to perform).can u help me by giving some tips.
3 4849
sounds an interesting project - what operating system/compiler are you using?
as you say you need a protocol to communicate between the two devices. I find the simplest way is to have a header file which contains a typedef which specifies the commands which is included by all the programs on the different devices (assuming they all use C/C++).
e.g. this is one I use to communicats between three seperate programs Matlab (using MEX) via TCP/IP to/from C++ on a host PC which communicates with a SBC6711 DSP target board via USB. -
/*!
-
\file commands.h
-
\brief define commands for MATLAB /PC / DSP communication
-
*/
-
/*! \mainpage define commands for MATLAB /PC / DSP communication
-
*/
-
-
#ifndef _Commands_h_
-
#define _Commands_h_
-
-
typedef enum {CONNECT=1, /**< open connectionfrom Matlab to DSP */
-
CLOSECONNECTION, /**< Close connection */
-
DEFAULTS, /**< set defaut parameters for acquisition */
-
FREQUENCIES, /**< send frequency data from Matlab to DSP */
-
ELECTRODES, /**< send electrode data from Matlab to DSP */
-
STARTACQUISITION, /**< tell DSP to start data acquisition */
-
GETRESULT, /**< return acquisition results from DSP to Matlab */
-
SIGNAL, /**< set test signal frequency from Matlab */
-
PRINTF, /**< printf data from DSP to PC to be displayed on PC screen */
-
DIO_READ, /**< DigitalI/O > Read DIO port */
-
DIO_WRITE, /**< DigitalI/O > Write DIO port */
-
DIO_SET_BIT, /**< DigitalI/O > Set a DIO bit */
-
DIO_RESET_BIT, /**< igitalI/O > Reset a DIO bit */
-
DIO_PULSE_BIT, /**< DigitalI/O > Pulse a DIO bit */
-
DIO_COUNTER, /**< DigitalI/O > Counter counter */
-
DIO_HANDSHAKE, /**< DigitalI/O > Handshake test */
-
DIO_WRITECHAR, /**< DigitalI/O > Writeint test */
-
RESULTS, /**< Results data structure PC to/from DSP */
-
USER_TEST, /**< Tests > User function */
-
VERSION=100 /**< version of this software */
-
} COMMANDS;
-
-
#endif
-
the host PC can send a command -
transmit(STARTACQUISITION);
-
the DSP uses a switch() statement to determine which command has been received, e.g. -
switch (cmd)
-
{
-
case FREQUENCIES: // frequency data received
-
{
-
// check maximum size of array and copy values to frequencyData structure
-
.....
-
break;
-
}
-
case ELECTRODES: // electrode data received
-
{
-
.....
-
break;
-
}
-
case STARTACQUISITION:
-
{
-
.....
-
etc
-
hope this gives you some ideas!
hi,
i am using the windows os and turbo c. compiler
Sign in to post your reply or Sign up for a free account.
Similar topics
by: jblazi |
last post by:
Let us assume I have a list like
and would like to transoform it into the string
'{1,2},{7,8},{12,13}'
Which is the simplest way of achiebing this? (The list is in fact much
longer and...
|
by: DaveC |
last post by:
I know this is the wrong group but I need a little pointing in a direction
please.
I need to write an implementation of a yet to be published protocol. It is
transported over the internet via...
|
by: brewhaha |
last post by:
Greetings from the fifty-second parallel, My Sirs and Madams of
Edmonton Public Library, the World Wide Web Consortium situated
primarily at Michigan I.T., and Edmonton Community Network. To
fail...
|
by: shoorik |
last post by:
Folks,
SiteID is an exciting new protocol that I've been planning and
designing during the past couple of months. It's currently in early
release, but I've been hoping to make somewhat of a...
|
by: Laszlo Zsolt Nagy |
last post by:
Hello,
I would like to develop a new network protocol, where the server and the
clients are Python programs.
I think to be effective, I need to use TCP_NODELAY, and manually
buffered transfers....
|
by: admin |
last post by:
TCP/IP UDP Protocol Development Library and Resources
Free VC++ 6.0 (ws2_32.lib) Winsock 2 TCP/IP Library complete with
project source implements TCP/IP Header construction, Checksum...
|
by: yawnmoth |
last post by:
I've seen a few webpages that use the javascript pseudo-protocol with
event handlers. eg.
<input onkeyup="javascript: ..." />
Correct me if I'm wrong, but isn't onkeyup always supposed to be...
|
by: luca.moreschi |
last post by:
Dear all,
I'd like to learn more about Dicom communication protocol.
Taking a look in internet seems that I need the document "PS 3.9-1993
Point to point communication" from Nema or something...
|
by: Nick |
last post by:
Hi there,
I would like to perform something like the following from my vb.net web
service, being invoked via HTTP Post
Call HttpContext.Current.Response.Redirect("myprotocol://myurl")
...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |