Accept data from serial port into an input box?

M

Martin

How can I get some data that comes in on a computer's serial port into
a text box on a web page? I assume I need to use Javascript in some
manner - or maybe not?

I have a situation where I'll be serving a page out to a computer that
is equipped with a barcode scanner attached to it's serial port. When
the user scans a barcode, I want it to appear in the text field. Then,
when the user hits the enter key, the page will submit to the server
for processing.

FWIW, this is all on a LAN - no internet usage involved.
 
E

Evertjan.

Martin wrote on 14 nov 2009 in comp.lang.javascript:
How can I get some data that comes in on a computer's serial port into
a text box on a web page? I assume I need to use Javascript in some
manner - or maybe not?

I have a situation where I'll be serving a page out to a computer that
is equipped with a barcode scanner attached to it's serial port. When
the user scans a barcode, I want it to appear in the text field. Then,
when the user hits the enter key, the page will submit to the server
for processing.

With a standard set browser you cannot, because of security concerns.
FWIW, this is all on a LAN - no internet usage involved.

Perhaps with IE and a local .hta file, but that would programme in VBS,
not javascript. Better ask in a vbs NG.
 
J

Jorge

How can I get some data that comes in on a computer's serial port into
a text box on a web page? I assume I need to use Javascript in some
manner - or maybe not?

I have a situation where I'll be serving a page out to a computer that
is equipped with a barcode scanner attached to it's serial port. When
the user scans a barcode, I want it to appear in the text field. Then,
when the user hits the enter key, the page will submit to the server
for processing.

FWIW, this is all on a LAN - no internet usage involved.

You'll need a plugin to do that. Maybe flash can do it, I don't know.
Or, if you can plug the serial device to an http bridge ("a serial
server"), like the axis 2490, you can query the (serial server) device
for serial input and post data for serial output.
 
T

Thomas 'PointedEars' Lahn

Martin said:
How can I get some data that comes in on a computer's serial port into
a text box on a web page?

If "web page" means (X)HTML document, you need an Web browser-compliant API
that supports reading from the computer's serial port, the browser's DOM,
and a programming language for which there are bindings provided by both
APIs so that you can use the former API to retrieve the data and the latter
API to display it.
I assume I need to use Javascript in some manner - or maybe not?

Yes.

<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://jibbering.com/faq/#posting>


PointedEars
 
M

Martin

We did this a couple of years ago, and there was no extra code required
(at least not for the front end):

1) connect barcode scanner and configure it as keyboard input device

2) load the page and focus the text field

3) scan the barcode --> decoded information appears in form element

4) (optional) depending on how the scanner is configured, the translated
codes can end with a newline character, which can be used to
automatically submit the form.


cheers,
stefan

Sherm / stefan: Thanks

For the scanner to work this way, I think it will need to be attached
to the computer via a keyboard wedge (as opposed to the serial port).
Although I would prefer to use the serial port, I probably use the
wedge - it would be the simplest thing to implement.
 
T

The Natural Philosopher

Jorge said:
You'll need a plugin to do that. Maybe flash can do it, I don't know.
Or, if you can plug the serial device to an http bridge ("a serial
server"), like the axis 2490, you can query the (serial server) device
for serial input and post data for serial output.
Now that's a thought. Ta for that. Ive been pondering whether I could
do this here.


Yes some ajax like call to a http serving device on the LAN would sort
of work I guess.
 
M

Michael Haufe (\TNO\)

Perhaps with IE and a local .hta file, but that would programme in VBS,
not javascript. Better ask in a vbs NG.

The ability to access a COM object is irrelevant to whether VBS or JS
is used.
There is no requirement to use VBScript for this task.
 
E

Evertjan.

Michael Haufe ("TNO") wrote on 14 nov 2009 in comp.lang.javascript:
The ability to access a COM object is irrelevant to whether VBS or JS
is used.

I was not talking about extra com-objects.

HTA can access msdos-scripts, .exe programmes and read files
without having security settings lifted.
There is no requirement to use VBScript for this task.

Whose requirement?
 
M

Michael Haufe (\TNO\)

I was not talking about extra com-objects.

HTA can access msdos-scripts, .exe programmes and read files
without having security settings lifted.

Irrelevant to my point.
Whose requirement?

You stated:
"...but that would programme in VBS, not javascript. Better ask in a
vbs NG."

Which I assume to mean: "...but that would require being programmed in
VBS, not javascript."
Which is a false claim.
 
E

Evertjan.

Michael Haufe ("TNO") wrote on 14 nov 2009 in comp.lang.javascript:
On Nov 14, 12:44 pm, "Evertjan." <[email protected]>
wrote:


Irrelevant to my point.

You made a point: the com relevancy.
You stated:
"...but that would programme in VBS, not javascript. Better ask in a
vbs NG."

Which I assume to mean: "...but that would require being programmed in
VBS, not javascript."
Which is a false claim.

You are right.
 
T

Terence

How can I get some data that comes in on a computer's serial port into
a text box on a web page? I assume I need to use Javascript in some
manner - or maybe not?

I have a situation where I'll be serving a page out to a computer that
is equipped with a barcode scanner attached to it's serial port. When
the user scans a barcode, I want it to appear in the text field. Then,
when the user hits the enter key, the page will submit to the server
for processing.

FWIW, this is all on a LAN - no internet usage involved.

I had this problem and spent a lot of time finding out why.
Windows NT and later (after W98) does not allow MSDOS (dos in windows)
to access the ports.
You have to turn off the inhibit bit in the port table.
Porttalk is one software that allows this to be done if run before
your program.
Some high-level languages supposedly allow handling the ports, but not
all seem to work properly.
And the use of SYSTEM calls only allows SOME port attributes to be set
and not others, and some combinations of frames and parity are also
not supported.
 
B

Bart Van der Donck

Martin said:
How can I get some data that comes in on a computer's serial port into
a text box on a web page? I assume I need to use Javascript in some
manner - or maybe not?

I have a situation where I'll be serving a page out to a computer that
is equipped with a barcode scanner attached to it's serial port. When
the user scans a barcode, I want it to appear in the text field. Then,
when the user hits the enter key, the page will submit to the server
for processing.

I had successfully used a barcode scanner that goes between the
keyboard and the PC, see:
http://images9.speurders.nl/images/49/4993/49934499_1.jpg

Usual setup: keyboard - wire - PC
With scanner: keyboard - wire - scanner - wire - PC

What you scan comes into the keyboard port as if you had typed it;
without any need for configurations or programs.
 
R

rf

Martin said:
How can I get some data that comes in on a computer's serial port into
a text box on a web page? I assume I need to use Javascript in some
manner - or maybe not?

I have a situation where I'll be serving a page out to a computer that
is equipped with a barcode scanner attached to it's serial port. When
the user scans a barcode, I want it to appear in the text field. Then,
when the user hits the enter key, the page will submit to the server
for processing.

Read The Fine Manual that came with your scanner to find how it really
works. The drivers supplied with your scanner should make it pretend to be a
keyboard. If they don't then buy a scanner whose drivers do.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>
Perhaps with IE and a local .hta file, but that would programme in VBS,
not javascript. Better ask in a vbs NG.

HTAs using JavaScript are a topic for which the FAQ should at least have
a reference. The best I've yet found is <http://msdn.microsoft.com/en-
us/library/ms536496(VS.85).aspx> and/or <http://social.msdn.microsoft.co
m/Search/en-US?query=jscript%20hta&ac=8>. And <http://en.wikipedia.org/
wiki/HTML_Application>.
 
T

Terence

I had successfully used a barcode scanner that goes between the
keyboard and the PC, see:http://images9.speurders.nl/images/49/4993/49934499_1.jpg

Usual setup: keyboard - wire - PC
With scanner: keyboard - wire - scanner - wire - PC

What you scan comes into the keyboard port as if you had typed it;
without any need for configurations or programs.

I respectfully point out that some continuous sheet (fast) page
scanners require a timed dialog, with re-transmit options. You don't
have time to type a trigger response. My searches and tests found that
Windows port inhibition was the obstacle to a direct Rs323c plug
connection, and a USB connection is horrendous to code oneself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top