[R-SIG-Mac] USB I/O via R

Charly charles.hebert at gmail.com
Mon Jan 26 11:22:36 CET 2009


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 <atul.sha... at mcgill.ca> 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?



More information about the R-SIG-Mac mailing list