There's a whole lot of open-source hobby gen on communicating via a TTY port with most of the popular software at http://www.arduino.cc/playground/Main/InterfacingWithSoftware and its associated site: http://www.processing.org/
The Arduino interface board, costing just a few dollars, is the kalashnikov of hobbyists and it has an on-board serial I/O port working through its USB. There is literally nothing clever about it, except the design. It sounds to me like the general techniques are adaptable to a GPS device. As you'll see a number of people have published their fave recipes for linking an Arduino via TTY with a variety of commercial software & languages. J is not in there yet... but when I've a spare weekend I'm going to play some more. Primarily the Arduino is programmed by a (freeware) host IDE (with versions for Win, Mac & such) via its serial IO port. Clearly the TTY facility is just a sub-function of this, but it's a challenge to identify it without plunging into C source. I've had some success communicating with the Arduino from my Mac via a BASH script. Since these scripts are typically small, you could always write a BASH script to disk from your J code and execute it, while you look for a better way. Not that I've tried doing this under Windows. But Win will still execute .BAT files, which can redirect IO to just about any port. Not sure what the equivalent technique is under Windows Mobile. I note the existence of "~help/user/stdin_stdout.htm" which suggests that the J way to go is to redirect stdin and stdout, the crude old C way. I've not got this to work, but I haven't tried very hard. When I succeed I'll put a wiki page up. Ian On Fri, Nov 5, 2010 at 8:12 AM, Alex Gian <[email protected]> wrote: > Thanks for the clarifications/suggestions Bill, Alex. > > Alex you say: > "The data from there is fed to J but the polling application is in VB6." > > Was that in real time or for subsequent processing? If in real time, > what mechanism did you use for the feed? I did consider writing a > serial-to-socket bridge, but I'm trying to avoid too much low-level > stuff distracting me from the main task. > > I think I'll try for opening the port as a file for now and see how that > goes. I actually managed to find some likely looking code on this site, > ( http://www.jsoftware.com/svn/base/trunk/packages/misc/telecom.ijs ) > but it claims to work for W95 only and I do not not enough of CE's > quirks (or J's for that matter) to know what problem to anticipate. > > Perhaps just opening a DLL might be a better idea. > > Thanks anyway gents! > I'm trying to avoid using Java or C++, especially since processing GPS > position data would be a brilliant job for J, but sometimes it just > ain't easy (to avoid, that is ;) ) > > On Fri, 2010-11-05 at 13:25 +0800, Alex Rufon wrote: > >> J can actually call an OCX/ActiveX control directly but I don't know how it >> would work out for you on WinCE. >> >> I guess googling for "file open COM1" would help out. :) >> >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf Of bill lam >> Sent: Friday, November 05, 2010 10:36 AM >> To: [email protected] >> Subject: Re: [Jprogramming] Accessing the serial port >> >> There is no inbuilt support for serial port in J. However I guess you can >> open a file handle for the serial port, and perform some read or write. >> This need admin rights, not sure those api will also work in vista or win7. >> >> untested. >> >> Чтв, 04 Ноя 2010, Alex Gian писал(а): >> > Hi, >> > Could anyone point me at any documentation on the foreign functions I >> > need to read directly from the serial port? >> > >> > I have a GPS application in mind, to which J may be very well suited. >> > At the moment I am working with j602 on Windows Mobile 5, (which also >> > has a simplified GPS dll, so any info on foreign functions for dll >> > access would also be good) but I do intend this to be as generic as >> > possible, so I'll probably go for direct interpretation of the NMEA >> > data, without dll "stablizers". >> > >> > TIA >> > >> > >> > ---------------------------------------------------------------------- >> > For information about J forums see http://www.jsoftware.com/forums.htm >> >> -- >> regards, >> ==================================================== >> GPG key 1024D/4434BAB3 2008-08-24 >> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
