By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,062 Members | 1,374 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,062 IT Pros & Developers. It's quick & easy.

reading & writing in serial port from server

P: n/a
Hello to everybody,

I've done an application that draws in a frame the trajectory of a
robot. The robot position is readed through the serial port, and
several commands are wrote through the same port to change the
direction of the robot.
The trajectory frame is managed by an applet, and the project works
good when the applet is called by a html document allocated in the
same local machine under W98 where the classes and the serial port
are.

But my intention is now that the serial port is going to be in a
server machine under Linux, and the users will connect with the frame
through internet. And these are the questions:
1.- If the same application that works in a local machine is called by
these users, will it operate with the serial port of the server or the
serial port of the user PC?
2.- With the traditional applets can the users see the trajectory in
the frame with the readed data from the server serial port and operate
through the hmtl document in order to write in the server serial port?

Thanks in advance, and I hope anybody could help me in this trouble.

Bye.
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
still waiting...
Hello to everybody,

I've done an application that draws in a frame the trajectory of a
robot. The robot position is readed through the serial port, and
several commands are wrote through the same port to change the
direction of the robot.
The trajectory frame is managed by an applet, and the project works
good when the applet is called by a html document allocated in the
same local machine under W98 where the classes and the serial port
are.

But my intention is now that the serial port is going to be in a
server machine under Linux, and the users will connect with the frame
through internet. And these are the questions:
1.- If the same application that works in a local machine is called by
these users, will it operate with the serial port of the server or the
serial port of the user PC?
2.- With the traditional applets can the users see the trajectory in
the frame with the readed data from the server serial port and operate
through the hmtl document in order to write in the server serial port?

Thanks in advance, and I hope anybody could help me in this trouble.

Bye.

Jul 17 '05 #2

P: n/a

"^CeFoS^" <se****@terra.es> wrote in message
news:74**************************@posting.google.c om...
still waiting...
Hello to everybody,

I've done an application that draws in a frame the trajectory
of a robot. The robot position is read through the serial port,
and several commands are written through the same port to
change the direction of the robot.

The trajectory frame is managed by an applet, and the
project works good when the applet is called by a html
document allocated in the same local machine under W98
where the classes and the serial port are.

Am I to understand that all the pertinent application logic:

* Robot Interface / Control [i.e. serial port access, generate
robot commands (?) etc]

* Trajectory Engine [i.e. trajectory data generation etc]

* User Interface [i.e. frame management, trajectory data
display, user command interpretation etc]

is located within the applet ? If so, I suggest a design change - see
response below.

But my intention is now that the serial port is going to
be in a server machine under Linux, and the users will
connect with the frame through internet. And these are the
questions:

1.- If the same application that works in a local machine is
called by these users, will it operate with the serial port of the
server or the serial port of the user PC?

If you are executing code on machine X which accesses the serial port [or
any other resource / device] it will be machine X's serial port / device it
will be accessing. Thus, in this case, the user PC's port. To put it quite
simply, it is not possible to *directly* access another machine's resource /
devices. Such functionality [i.e. access to remote resources] needs the aid
of an intermediary [i.e. URL, socket, RMI, etc], and code needs to be
altered to allow this.

Note:

* Applets [unsigned] loaded via URL cannot access local
resources - forget accessing local PC serial port [it's not
what you want anyway]

2.- With the traditional applets can the users see the trajectory
in the frame with the readed data from the server serial port and
operate through the hmtl document in order to write in the server
serial port?


If you redesign your project you will certainly have the functionality you
require via an URL-launched unsigned applet. One [of several possible]
redesign suggestion:

* Implement a server application, which will execute on
your Linux box, to perform the:

- Robot Interface / Control
- Trajectory Engine

duties. I recommend use of the 'javax.comm' package for
serial port access tasks

* Your applet could be redesigned to do what applets do
best - act as a user interface to a server application. The
applet would communicate with the server application:

- Sending user commands

- Receiving robot trajectory data and drawing it on
screen, etc

I hope this explanation sheds some light on your problem, and please note
that the suggested approach is only one of several. My aim is to offer
ideas, not a complete solution.

Cheers,

Anthony Borla

P.S.

You might care to post to:

comp.lang.java.help
comp.lang.java.programmer

in future. The current newsgroup was officially retired in 1996, which
partly explains why responses come very slowly, if at all.

I've also taken the liberty of forwarding this response to
'comp.lang.java.help' - you may well get additional feedback.
Jul 17 '05 #3

P: n/a
First of all thank you for your accurate advices. According to your
answer I have the application running in the server machine and using
the serial port. The other application that will be called in the html
document that it'll allocate the frame with the user interfaz and
it'll manage the events, I suppose it would be a simple applet like I
had in the local machine test.

But I have any questions. I suppose the server application will be
running using the java command (java MyServerApp.class), where can I
look for information about communication between a server application
and the user applet.

Thanks in advance.
Jul 17 '05 #4

P: n/a
still waiting ...

se****@terra.es (^CeFoS^) wrote in message news:<74**************************@posting.google. com>...
First of all thank you for your accurate advices. According to your
answer I have the application running in the server machine and using
the serial port. The other application that will be called in the html
document that it'll allocate the frame with the user interfaz and
it'll manage the events, I suppose it would be a simple applet like I
had in the local machine test.

But I have any questions. I suppose the server application will be
running using the java command (java MyServerApp.class), where can I
look for information about communication between a server application
and the user applet.

Thanks in advance.

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.