Run BASIC
« serial I/O »

Welcome Guest. Please Login or Register.
Dec 8, 2009, 6:04pm



Run BASIC
Run BASIC Community Wiki
Easy Web Programming with Run BASIC

Run BASIC :: Run BASIC Programming :: Scripting :: serial I/O
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: serial I/O (Read 115 times)
kokenge
Full Member
***
member is offline





Joined: Jan 2009
Gender: Male
Posts: 153
Karma: 2
 serial I/O
« Thread Started on Sept 24, 2009, 9:13am »

How do you communicate with RS-232 serial using JavaScript.

Thanks for the help..

Link to Post - Back to Top  IP: Logged
Brent
Full Member
***
member is offline




[homepage]

Joined: Aug 2007
Posts: 118
Karma: 2
 Re: serial I/O
« Reply #1 on Sept 24, 2009, 12:28pm »

If it must be in JS, the following thread from another forum may have a workable solution.

http://stackoverflow.com/questions/59209....232-serial-port

Other solutions would be to use a different language with support for serial port I/O, such as LB. Carl has mentioned the possibility of such support in RB in the future. Maybe it will appear in the next release, an alpha of which is due to come out momentarily.
Link to Post - Back to Top  IP: Logged

Brent

SapientBoard 0.1.2 released 02 May 2009
kokenge
Full Member
***
member is offline





Joined: Jan 2009
Gender: Male
Posts: 153
Karma: 2
 Re: serial I/O
« Reply #2 on Sept 24, 2009, 1:02pm »

Thanks Brent,
But already been there and they say

I think the others are right - JS is isolated from machine specific stuff


I guess I'm coming to the same conclusion.
But thought I'd ask first before I do it using RB.

Problem I'm having is that RB's graphics does not have all the features I need. So decided to try the <CANVAS> tag. Canvas commands are in JS. I also need to read a Analog to Digital converter on the Serial COM port. It would be nice to do it all in JS. But I can do it with RB and use SPAN commands to get to the Serial port.

I already have this application in LB, but want to go to RB for some web features I need. It one of those projects that needs both Real time and Web.

Thanks for the help.

Link to Post - Back to Top  IP: Logged
mike_ukmid
Senior Member
****
member is offline





Joined: Sept 2007
Gender: Male
Posts: 277
Location: Staffordshire, England
Karma: 3
 Re: serial I/O
« Reply #3 on Sept 24, 2009, 2:10pm »


Sept 24, 2009, 1:02pm, kokenge wrote:
..... Problem I'm having is that RB's graphics does not have all the features I need. So decided to try the <CANVAS> tag. Canvas commands are in JS. I also need to read a Analog to Digital converter on the Serial COM port. It would be nice to do it all in JS. But I can do it with RB and use SPAN commands to get to the Serial port.

I already have this application in LB, but want to go to RB for some web features I need. It one of those projects that needs both Real time and Web.

Thanks for the help.



I use a digital I/O + ADC board on a com port too. My LB prog collects data from and controls the I/O board and RB gets the data via a ramdisk. Can I ask, please, how you use <span> to get RB 'see' the com port? And to send/receive on the com port?

Thanks,
Mike.
Link to Post - Back to Top  IP: Logged

The more I learn, the less I know! Mike.
kokenge
Full Member
***
member is offline





Joined: Jan 2009
Gender: Male
Posts: 153
Karma: 2
 Re: serial I/O
« Reply #4 on Sept 24, 2009, 2:22pm »

Sure Mike,
I'm using this.
http://www.starting-point-systems.com/index.html
It has software to make it look like a com port.
It also has commands you can use in batch - so span works.

Because the box can be used various ways, I've standardized on it.
I've even used it on a CNC I built and it works.

HTH...
Dan

Link to Post - Back to Top  IP: Logged
mike_ukmid
Senior Member
****
member is offline





Joined: Sept 2007
Gender: Male
Posts: 277
Location: Staffordshire, England
Karma: 3
 Re: serial I/O
« Reply #5 on Sept 24, 2009, 3:59pm »

Thanks Dan, I have a different I/O board (with no batch control) so looks like I'm stuck with existing code for now! But still looking for other methods :-[

Mike.
Link to Post - Back to Top  IP: Logged

The more I learn, the less I know! Mike.
mackrackit
Full Member
***
member is offline

[avatar]


[homepage]

Joined: Jan 2008
Gender: Male
Posts: 226
Location: Wellton, U.S.A.
Karma: 2
 Re: serial I/O
« Reply #6 on Sept 26, 2009, 5:41am »

I have been using Python. Seems to work well.
http://runbasic.proboards.com/index.cgi?board=code&action=display&thread=1135

I tried the LB method and was happy with it for awhile but had to run LB with WINE and all just was not the best way.
Link to Post - Back to Top  IP: Logged

Dave

http://www.mackrackit.com/mac/www/run_basic/run_basic.html
Core
Junior Member
**
member is offline

[avatar]



Joined: Nov 2008
Gender: Male
Posts: 54
Location: New York
Karma: 2
 Re: serial I/O
« Reply #7 on Sept 26, 2009, 6:58am »

Maybe not in the price range your looking for but there's a company called Control Solutions that makes some nice products.

http://csimn.com/CSI_pages/iboard2.html

I myself plan on using some of there web servers for a small HVAC project in the near future. I also plan on building an RB site that will pull temperature and alarms from there controllers into a RB website.
RunBasic would server as the front end.

Respectfully,

Core
Link to Post - Back to Top  IP: Logged
zoomkat
New Member
*
member is offline





Joined: Jan 2008
Posts: 31
Karma: 0
 Re: serial I/O
« Reply #8 on Oct 9, 2009, 12:11am »

Seems most cgi applications make use of stdin and stout to communicate between applications and web servers. One can use Apache and batch files to send info out a serial port via a web gui. To both send and receive serial port info I've made a simple program with freebasic that does the job.
Link to Post - Back to Top  IP: Logged
   [Search This Thread][Send Topic To Friend] [Print]

Google
Webrunbasic.proboards.com
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!