LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview + arduino + real-time

I have an Arduino mega 2560 board and i want to make a controller using labview. So i have written a code for injection control in labview which is hopefully running without errors but i am not sure that it is real-time or not since i think it is running on my system itself not on the board and that is what i want, because if it is not running on the board then i think it is not real-time.

Can anyone guide me to make my code run in real-time on the board not in my system ?

0 Kudos
Message 1 of 12
(4,017 Views)

@oathkeeper wrote:

 

Can anyone guide me to make my code run in real-time on the board not in my system ?


No, this isn't possible.  LabVIEW code cannot run on an Arduino.  The LIFA toolkit supports sending and recieveing serial data commanding the Arduino to do things.  If you want code to run on the Arduino you need to code for it, using the Arduino IDE.

 

There are other embedded LabVIEW solutions but none for $20.  There is the myRIO which is many (many) more times powerful than an Arduino.  It has a built in reprogrammable FPGA, and is running Linux Real Time.  Both of these have deterministic real-time features.  There is also student pricing for $250, non-accademic for $1,000.  It also has USB host capability so on board logging to USB drives, and support for USB cameras, and built in Wifi, and some on board memory.

 

Things generally only go up from there.  The cRIO platform has their cheapest controller and 8 slot chassis around $1,700, the new SOM device I don't think is ready to be purchased but is something like $500 each in quantitiies of 100.

 

There was also a way to turn a normal PC into a PC running LabVIEW Real-Time. 

 

Out of curiosity what are you trying to do detministicly?  If it is something related to taking samples at a fast rate, dedicated hardware can do that with a non-real time OS like Windows.  Communications can be buffered on devices like CAN, LIN, or serial so again no data is lost on non-real time OSs.

0 Kudos
Message 2 of 12
(4,008 Views)

okay..i understood what you said.

What i want to do is, i have an engine which needs a controller for controlling the fuel injection and ignition at particular crank angle. So for that puprpose, there are three sensors which continuously keeps sending signals at 0, 180, 360, etc. degrees which needs to be checked for equality with another signal. As soon as both signals becomes on, it has to inject. So for that i need a real-time controller which can take up each value of both the signals, compare them and respond accordingly. 

And so in my case the Arduino board is working just as an interface between the engine and the system, receiving transmittimg signals, thats it. right?

0 Kudos
Message 3 of 12
(4,002 Views)

Well your application does need a real-time aspect.  How much time is allowed between both signals turning on, and the command to inject?  I'm guessing it is small on the order of 10s of microseconds.  If you write code to run on the Arduino and just poll these inputs, and then when both are on turn on the injector, you may get the response you need.  

 

The Arduino runs at 16MHz but has plenty of over head from reading inputs and writing outputs.  An AND function is pretty simple to impliment in any language so I might suggest trying to write code for this embedded device to just perform that task.  Is there other things you wanted the Arduino to do?  The LIFA toolkit is open to modifications so you can take it and add your own AND function for controlling the injectors, but I'm not sure how much doing the other LIFA stuff will affect your speed to respond.

0 Kudos
Message 4 of 12
(3,999 Views)

well sure i knew that i have an option to write it in Arduino but i chose Labview as it was looking simple in that context. So now can i convert the labview code into c code using c generator toolkit in labview and build it into the board ? will it work like that or i need to separately code in Arduino ?

0 Kudos
Message 5 of 12
(3,996 Views)

@oathkeeper wrote:

well sure i knew that i have an option to write it in Arduino but i chose Labview as it was looking simple in that context. So now can i convert the labview code into c code using c generator toolkit in labview and build it into the board ? will it work like that or i need to separately code in Arduino ?


I've never had experience doing this, but I have heard of companies having some success in doing this.

0 Kudos
Message 6 of 12
(3,994 Views)

okay..i will try and find out.

one more thing, will i be able to do signal processing with arduino board because i may need it later?

0 Kudos
Message 7 of 12
(3,989 Views)

@oathkeeper wrote:

 

one more thing, will i be able to do signal processing with arduino board because i may need it later?


Well anything is possible if you code it, but I am unsure of the full capability of an Arduino to do signal processing.

0 Kudos
Message 8 of 12
(3,982 Views)

Arduino has very little grunt for realtime DSP, but it can do a bit.

0 Kudos
Message 9 of 12
(3,944 Views)

Hi, 

 

Were you able to implement this with any success at all? I am considering doing the same thing and I have very little Labview experience so I'd like to know if it is feasible before I get too carried away trying to learn the software. 

 

Regards

0 Kudos
Message 10 of 12
(3,651 Views)