473,581 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

reading & writing in serial port from server

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
4 9076
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

"^CeFoS^" <se****@terra.e s> wrote in message
news:74******** *************** ***@posting.goo gle.com...
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
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.cla ss), where can I
look for information about communication between a server application
and the user applet.

Thanks in advance.
Jul 17 '05 #4
still waiting ...

se****@terra.es (^CeFoS^) wrote in message news:<74******* *************** ****@posting.go ogle.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.cla ss), where can I
look for information about communication between a server application
and the user applet.

Thanks in advance.

Jul 17 '05 #5

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

Similar topics

0
1643
by: per.bergstrom | last post by:
To whom it may concern, The serial port server 'cnhd38' has been terminated (on who's initiative, I don't know). It affects the users of the (at least) following nodes: cnhd36, cnhd44, cnhd45, cnhd46, cnhd47. The new terminal server to use is called 'msp-t01'. The port numbers that are of interest for the nodes mentioned above are as...
3
7822
by: Gayathri Subramaniam | last post by:
hai, im a student. i am assigned a task to instruct a robot. for this i want to write and read from com1. i do not know how to configure the port using DCB structure. i have a data rate of 9600bps, odd parity, 7 data bits, hardware flow control. i do not know how to do this in c#. thanks in advance.
8
16345
by: Vivek Menon | last post by:
Hi, I am using a C program to write/read from a serial port. The writing part is working perfectly fine. However, I am not able to read the values correctly and display them. To debug this issue I am also seeing the values on minicom. Now I have used fcntl() function and then read refp = fcntl(fd, F_SETFL, 0); res = read(fd,buf,1024); /*...
4
2641
by: Petr Jakes | last post by:
I am trying to save data it is comming from the serial port continually for some period. (expect reading from serial port is 100% not a problem) Following is an example of the code I am trying to write. It works, but it produce an empty gz file (0kB size) even I am sure I am getting data from the serial port. It looks like g.close() does not...
8
12257
by: glaskan | last post by:
This code is meant to take an input from the serial port and then save the input from the serial port as the name and as the data to a text file but all i am getting is an empty text file or a text file with only "," in it. It would be much appreciated if anyone could help with this problem. Thanks Private Sub Form_Unload(Cancel As Integer) ...
8
37206
by: Ringo | last post by:
I have a micro controller that sends a stream of 102 bytes to the pc. The values range from 0 to 255. I set up my serialport like this sp.BaudRate = 115200; sp.PortName = "COM53"; sp.DataBits = 8; sp.StopBits = System.IO.Ports.StopBits.One; sp.Parity = System.IO.Ports.Parity.None; sp.ReadTimeout = 0; sp.Open();
6
11896
by: John Wright | last post by:
I am trying to read the data from a device on a serial port. I connect just fine and can receive data fine in text mode but not in binary mode. In text mode the data from the device comes in like this: S~5BBBBBBBBBBBBBBB5BBBBBBBB5B31BB4BB2B5BB4BBBE S is the start of the line, ~ indicates a good read, B is a blank reading, and the...
2
7820
by: Nasif | last post by:
Currently I am writing a program which sends and receives messages through serial port to a device. I am using C# and Microsoft Visual studio 2005 for windows program. But my problem is when i try to write in serial port from my windows a Timeoutexception is thrown. I use SerialPort class in System.IO.Ports and for writing port i used write()...
6
8439
by: anu29dolly | last post by:
Hello everyone... I have written a program to write and read data from serial port.... I am able to write 80(in binary)..and is expecting 1B but i am uable to read it... My code goes as follows,,.... int main()
0
7886
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7809
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8159
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8312
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8183
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5685
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2312
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 we have to send another system

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.