08-22-2014 07:35 AM
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 ?
08-22-2014 07:41 AM - edited 08-22-2014 07:42 AM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-22-2014 07:53 AM
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?
08-22-2014 07:59 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-22-2014 08:09 AM
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 ?
08-22-2014 08:13 AM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-22-2014 08:17 AM
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?
08-22-2014 08:43 AM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-23-2014 03:54 AM
Arduino has very little grunt for realtime DSP, but it can do a bit.
08-08-2016 04:28 AM
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