I appreciate your suggestion. By pure co-incidence, I originally wrote  
this laboratory data aquisition routine in Python, so as to use Python  
regexp processing to parse the incoming text stream. To be honest, it  
was only through client preference for R that I came to learn that I  
could call regexp functions directly from R via 'grep' etc, and the  
program was rewritten to eliminate the Python component and allow lab  
staff to work in a more familiar R environment. At the time (hoping to  
avoid the rewrite :), I dabbled briefly with and was impressed by Rpy,  
which I found a both simpler to work with and more robust than  
RSPython. Unfortunately, RPy allowed only unidirectional calls from  
Python to R, and I had been tasked to create a control application in  
R. My brief attempt to evaluate the bidirectional facilities in  
RSPython was less successful (unstable), although I admittedly didn't  
explore very far before deciding to rewrite the routines.

I don't know if you have any thoughts on the "robustness" of latter  
package under Mac OS X, in comparison with RPy.  Since I was using it  
in conjunction with pySerial, I also wondered whether switching serial  
port libraries to Isaac Barron's USPP (Universal Serial Port Python)  
Library might work better with RSPython.  I have not been able to find  
very much Mac specific hardware interface advice, so any experience or  
suggestions are appreciated. My other thought was to use AppleScript,  
and I was able to pass data to R with the add on SerialPort X library  
(a very nice package by Blake Ward), but it was last updated in 2006  
and (on my OS 10.5.6 machine) failed to make the transition from OS  
10.4. Although the library is freeware, it is not open source, so I  
can't say how big a problem this is.

Thanks again.

Atul

A. Sharma
Montreal, QC

On 26-Jan-09, at 6:00 AM, <[email protected]> wrote:

> Send R-SIG-Mac mailing list submissions to
>       [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> or, via email, send a message with subject or body 'help' to
>       [email protected]
>
> You can reach the person managing the list at
>       [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-SIG-Mac digest..."
>
>
> Today's Topics:
>
>   1. Re:  USB I/O via R (Charly)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 26 Jan 2009 02:22:36 -0800 (PST)
> From: Charly <[email protected]>
> Subject: Re: [R-SIG-Mac] USB I/O via R
> To: [email protected]
> Message-ID:
>       <89216cf2-830b-4bc4-86ce-743d3720c...@u18g2000pro.googlegroups.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello,
>
> Do you know Python programming language ? If yes, you can consider
> these packages :
>
> RS232 / USB acquisition python library : http://pyvisa.sourceforge.net
> And the robust Python interface to the R programming language : Rpy ,
> http://rpy.sourceforge.net
>
> You can acquire data and regularly send vector to R using Rpy.
>
> My two cents,
>
> Bests regards, C.
>
> On 24 jan, 03:01, Atul Sharma <[email protected]> wrote:
>> I have an ongoing need to read a real-time data stream via the USB ?
>> port on a MacBook Pro (OS 10.5.6). I have several different  
>> hardware ?
>> sources, including commercial rs-232 instruments and a number of ?
>> microcontrollers, such as the Atmega168 ?or Hitachi H8, but my ?
>> question is generic to any serial I/O device, I think. To date, I  
>> have ?
>> been content to interact with the microcontroller via terminal.app, ?
>> where the 'screen' function allows me to exchange data with the  
>> card ?
>> and to capture the incoming ASCII text stream to disk. From within  
>> R, ?
>> this ASCII data file is then read and processed.
>>
>> Since it is independent of the R read.table() command, ?I'm sure it ?
>> has to do with the details of the 'screen' implementatation or OS  
>> time-
>> sharing. The problem is that the data appears to be written to disk  
>> at ?
>> irregular ?intervals, and it lags what is actually being received/
>> displayed by 2-3 seconds. While this has not been a problem to  
>> date, I ?
>> will soon need more "real time" access to the serial port, and I  
>> was ?
>> wondering if there was a way to access it directly from within R  
>> i.e. ?
>> a serial port communications library for R. Simple ASCII text read-
>> write is all I require. ?I have not had any luck with attempts to ?
>> search this group and google for ?"serial", "rs-232", "usb"," i/o" ?
>> etc, but ?I was wondering if any one has any experience they'd be ?
>> willing to share with inputting serial port data directly into R on ?
>> the Mac?
>
>
>
> ------------------------------
>
> _______________________________________________
> R-SIG-Mac mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>
> End of R-SIG-Mac Digest, Vol 71, Issue 31
> *****************************************


        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to