LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ARDUINO MEGA 2560 Digital IO Control

Capture.PNG

 Hi, I can't connect L1 1D array to the digital I/O pin, I want to know which converter to use

0 Kudos
Message 1 of 5
(476 Views)

I don't have your toolkit, but what does it say in the context help if you hover over the input terminal?

Is there a reason you are still using the ancient LIFA instead of LINX?

 

 

(also note that you can simplify your comparisons by using an array diagram constant.)

 

altenbach_0-1720981506099.png

 

 

 

0 Kudos
Message 2 of 5
(406 Views)

Hi Ancien,

 


@Ancien97 wrote:

I can't connect L1 1D array to the digital I/O pin, I want to know which converter to use


What does your subVI expect as inputs?

 

(Why don't you use an autoindexing FOR loop to set your 4 DO channels?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(380 Views)

Am using LiFA because I think it's better than LINX right?

 

I done it's projet, actually I want to use sensors ACS712 ans Zmpt101b to acquire current ant voltage!

 

I want to have the RMS values, I find an Arduino code but I want to translate it in LabView language!

 

I need help 

 

The code :

Explique moi le code Arduino ci-dessous :

double sensorValue1 = 0;
double sensorValue2 = 0;
int crosscount = 0;
int climb_flag = 0;
int val[100];
int max_v = 0;
double VmaxD = 0;
double VeffD = 0; double Veff = 0;

void setup() {
Serial.begin(9600);
pinMode(A1, INPUT);
}

void loop()
{ for (int i=0; i<100; i++) {
sensorValue1 = analogRead(A1);

if (analogRead(A1) > 511) {
val[i] = sensorValue1; }

else { val[i] = 0; }
delay(1); }

max_v = 0;

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

if ( val[i] > max_v ) {

max_v = val[i]; }
val[i] = 0; }
if (max_v != 0) {
VmaxD = max_v;
VeffD = VmaxD / sqrt(2);
Veff = (((VeffD - 420.76) / -90.24) * -210.2) + 210.2; }
else { Veff = 0; }
Serial.print("Voltage: "); Serial.println(Veff); VmaxD = 0; delay(100); }

0 Kudos
Message 4 of 5
(302 Views)

The function you are using allows you to write only one digital line at a time. 

 

 

The input is a number not an array . 

LVNinja_0-1722346212385.png

 

 

 

 

0 Kudos
Message 5 of 5
(294 Views)