LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Using LIFA and Arduino Problem For Power System??

Hi,

I will use Arduino Mega 2560 for my project and I want to use Labview for monitoring the my hybrit power system's current,voltage and power. At first I started to use current sensor Acs712 for arduino and I can take correct results from the sensor by means of Serial Monitor in Arduino program. And I want to see this correct results also in the Labview.Can I see the this results (ex:Current=1A) only using LIFA_BASE system directly? I think I can take these datas with using serial communication but LIFA is more easier for monitoring the datas so at first I want to do with LIFA.

0 Kudos
Message 1 of 6
(4,352 Views)

Since that sensor has an analog output, you can simply use the Analog Read Pin VI.  Also, if you have LabVIEW 2011 or newer, you should consider upgrading to LINX.

0 Kudos
Message 2 of 6
(3,044 Views)

what the advatages of LINX according to LIFA? Is there a code about LIFA or LINX to writing inside of my arduino codes for making necessary options automoticly in the Labview?

For example I write this code block for taking the current value. I want to see uploading my these codes to my arduino mega at the same time I can read what the values of my sensors output according to my equations in my main code.

#include <Average.h>

void setup() {

Serial.begin(9600);

}

void loop() {

float average = 0;

for(int i = 0; i < 1000; i++) {

average = average + (.0742 * analogRead(A0) -37.878);

delay(1);

}

Serial.print(average);

Serial.println("mA");

}

Are there any codes comand for making options about LIFA or LINX while I'm using  and running my main codes.I hope I can say what I want to do completely.

Thanks.

0 Kudos
Message 3 of 6
(3,044 Views)

You are very hard to understand.

You cannot run your own Arduino code as it is when you use either LIFA or LINX (they are essentially the same thing but LIFA is old and no longer being developed).  What you can do with LIFA and LINX is read the analog pin.  It will be slower than what you currently have if you use LIFA and LINX unmodified because of the required serial communication.

To replicate what you currently have in LIFA or LINX, you would need to create a custom function that will do your loop and average and send back a LIFA/LINX compatible response.  You would then need to create custom VI's to interact with that custom function to get the value for displaying it.

0 Kudos
Message 4 of 6
(3,044 Views)

Is there any detailed example or explaining which you can give?

0 Kudos
Message 5 of 6
(3,044 Views)

Every existing function in LIFA is an example of how you can create a custom function.  Simply duplicate an existing function with a new name and command number and test it.  Then, modify it to do what you need it to do.  There does not exist a guide to do it.

0 Kudos
Message 6 of 6
(3,044 Views)