Ethernet: Transferring variables to target memory

Hi all,
Networking question, I’m looking for any input or ideas here. Should I be
using C++ code, or Perl, or Python? My task is as follows:

We have 2 computers.

I have a C++ thread running on a dedicated computer. This computer’s
sole purpose is to get an interrupt, get analog input data, process it
(like, multiply it times 5), and write that value to analog output.

Now I would like to have this thread buzzing away on my dedicated computer,
and change that multiplication value of 5 to, say, 8, using the other
computer, and I really want to use the Ethernet port! I would also like the
dedicated computer to relay a message back to the supervisory computer, like
“ok, analog now reads 3.348” or something.

Thanks for any help you can offer!
-Charles

Hi all,
Networking question, I’m looking for any input or ideas here. Should I be
using C++ code, or Perl, or Python? My task is as follows:


Now I would like to have this thread buzzing away on my dedicated computer,
and change that multiplication value of 5 to, say, 8, using the other
computer, and I really want to use the Ethernet port! I would also like the

I’m not an embedded guy, but seems to depend how fast you want it.

Millisecs turnaround acceptable: anything will do
Microsecs: you shan’t be using Ethernet.


kabe

Charles wrote:

Hi all,
Networking question, I’m looking for any input or ideas here. Should I be
using C++ code, or Perl, or Python? My task is as follows:

We have 2 computers.

I have a C++ thread running on a dedicated computer. This computer’s
sole purpose is to get an interrupt, get analog input data, process it
(like, multiply it times 5), and write that value to analog output.

Now I would like to have this thread buzzing away on my dedicated computer,
and change that multiplication value of 5 to, say, 8, using the other
computer, and I really want to use the Ethernet port! I would also like the
dedicated computer to relay a message back to the supervisory computer, like
“ok, analog now reads 3.348” or something.

This is classical cluster computing … the software for it is available
at http://www.sf.net/projects/openqnx → PVM, the parallel virtual
machine.

The PVM API is based on UDP based message passing (after connection
setup) … so you can expect responses in millisecond timeframe.

Armin



Thanks for any help you can offer!
-Charles

These constants will be changing very slowly, so milliseconds or even half
seconds are fine. I think C/C++ would be one of the most simple methods for
me…does anyone know of some C or C++ code that I could build into my
application, as a thread?
I’m taking a look at PVM API and UDP based message passing, will this
integrate well/communicate with C code that I am currently running?

Thanks, for all your help, immensely appreciated…
-Charles

actually, wait. Let me be honest.
I’m a mechanical engineer. I like computers, but I’m a sad excuse for a
programmer.
All i really want in life is a client/ server application running in C, or
C++ whatever, is cool. The more simple/expandable, the better. the process
can take hundreds of milliseconds. I want to pass an array.

I will explore more exotic options later…
So, with THAT in mind…what do you think now?
-charles

Use QNX’s Send/Receive/Reply.

The server in this case would be the code that is reading/modifying/writing
this value.

The client would be the thing that sends new values to this thread.

The server would have two threads. A worker thread and a message handling
thread.

Client ‘sends’ a new value to the server. Server writes the new value in a
variable shared by the two threads and replies.

Kevin

“Charles” <caw2@po.cwru.edu> wrote in message
news:a8i40m$i52$1@inn.qnx.com

actually, wait. Let me be honest.
I’m a mechanical engineer. I like computers, but I’m a sad excuse for a
programmer.
All i really want in life is a client/ server application running in C, or
C++ whatever, is cool. The more simple/expandable, the better. the
process
can take hundreds of milliseconds. I want to pass an array.

I will explore more exotic options later…
So, with THAT in mind…what do you think now?
-charles

Charles wrote:

actually, wait. Let me be honest.
I’m a mechanical engineer. I like computers, but I’m a sad excuse for a
programmer.
All i really want in life is a client/ server application running in C, or
C++ whatever, is cool. The more simple/expandable, the better. the process
can take hundreds of milliseconds. I want to pass an array.

I will explore more exotic options later…
So, with THAT in mind…what do you think now?

Passing of arrays is day by day business with cluster computing :slight_smile:

PVM++ is available at sourceforge: http://pvm-plus-plus.sourceforge.net

Armin

You say “dedicated computer”. Desktop system? Embedded system? Does it
have a network card in it? Do you have TCP/IP or QNet or both configured?
Will your data acquisition program suffer if you shove a network card in and
start blasting data across it (missing interrupts and so on)? (By the way,
a “target” would seem to imply an embedded system)

If you have TCP/IP set up, you need to read up on how to use it (from within
C, we can suggest references). Then it’ll be obvious exactly what to do.

If you have QNet set up, you need to read up on QNX’s inter-process
communication or messaging (send/receive/reply, channels and so on,
specifically in the “across the network” environment - QNX can suggest
references). Then it’ll be obvious exactly what to do.

If you have neither set up, you need to set one or the other up.

Pardon me if I took too much of a rudimentary approach, just a wild guess
since I didn’t seem to find enough information to place your question in
context.

-Warren “Seek, and you shall find more questions” Peece




“Charles” <caw2@po.cwru.edu> wrote in message
news:a8fsbv$sth$1@inn.qnx.com

Hi all,
Networking question, I’m looking for any input or ideas here. Should I
be
using C++ code, or Perl, or Python? My task is as follows:

We have 2 computers.

I have a C++ thread running on a dedicated computer. This computer’s
sole purpose is to get an interrupt, get analog input data, process it
(like, multiply it times 5), and write that value to analog output.

Now I would like to have this thread buzzing away on my dedicated
computer,
and change that multiplication value of 5 to, say, 8, using the other
computer, and I really want to use the Ethernet port! I would also like
the
dedicated computer to relay a message back to the supervisory computer,
like
“ok, analog now reads 3.348” or something.

Thanks for any help you can offer!
-Charles

Charles

Are you running two qnx rtp systems or are they different.

If they are different you will need to use tcpip as a common protocol and
set you program up to use socket for data transfer.

If they are both qnxrtp the simplest way is to ditto to your process on the
other machine and just take nomal user input in your process. Outputting the
number to stdout will let you see the result. You can also set up message
passing (IPC) over qnet.

Rod

PS: I see that you say that you are not a programmer(mechanical engineer),
should you consider hiring one for this task.

“Charles” <caw2@po.cwru.edu> wrote in message
news:a8fsbv$sth$1@inn.qnx.com

Hi all,
Networking question, I’m looking for any input or ideas here. Should I
be
using C++ code, or Perl, or Python? My task is as follows:

We have 2 computers.

I have a C++ thread running on a dedicated computer. This computer’s
sole purpose is to get an interrupt, get analog input data, process it
(like, multiply it times 5), and write that value to analog output.

Now I would like to have this thread buzzing away on my dedicated
computer,
and change that multiplication value of 5 to, say, 8, using the other
computer, and I really want to use the Ethernet port! I would also like
the
dedicated computer to relay a message back to the supervisory computer,
like
“ok, analog now reads 3.348” or something.

Thanks for any help you can offer!
-Charles