LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pass commands to R language

Hi,

I'm writing a control program and would like in pass values from sensors to a routine I have written in the R statistical language, then act on the response. Does anyone have experience exchanging data and commands between Labview and R?

 

thanks,

moose

 

0 Kudos
Message 1 of 6
(7,615 Views)

Hello moose,

 

   I haven't used the R statistical language, but I have heard that it has a COM interface. Through COM you can interface it in variety of languages and of course LabVIEW is not an exception.

 

I got an link for using R COM in .NET, it's not that much efficient but you can get some basic idea about interfacing R COM.

 

http://www.codeproject.com/KB/cs/RtoCSharp.aspx

 

AshwiN

0 Kudos
Message 2 of 6
(7,590 Views)

Hello,

I am working on writing a data processing package in LabView.  I would like to import R code into Labview to run principal component analysis.  Does anyone know of a way to do this?

 

Thanks - Mike

0 Kudos
Message 3 of 6
(7,329 Views)

I don't know about importing R code into labview, but I came across a couple of very useful webpages that got me going.

http://joachimvandenbogaert.wordpress.com/2009/03/26/r-and-c-on-windows/

http://absolute-antinomian.blogspot.com/search?q=lABVIEW+R

 

The first explains the nuts and bolts of installing the Rcom packages that you will need to use the vi's available on the second page... there you will find a couple of nice vi's that page it quite possible to pass variables and commands to R and get data back.

 

It takes some fun with strings to get your results back into numbers, but it saved me a lot of time to be able to use R functionality to perform some specialized calculations.

 

Hope this helps.

moose

 

 

0 Kudos
Message 4 of 6
(7,323 Views)

Mike,

I'm also interested in doing this.  Did you manage to make it work?  if so, how?

 

Thanks,

 

Jolyon

This is the droid you're looking for...
0 Kudos
Message 5 of 6
(6,790 Views)

The last time "Mike" was on the forums was almost 4 years ago. He might not see your post. But you could use his advice. Smiley Wink

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 6 of 6
(6,776 Views)