LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview & arduino

hey I am trying to control a stepper motor with help of arduino nano. Can somebody help me in converting  the arduino code to LabView  VI. 

 

The arduino code is :

 


const int stepPin1 = 3;
const int dirPin1 = 4;

void setup()

{

pinMode(stepPin1,OUTPUT);
pinMode(dirPin1,OUTPUT);
}
void loop()
{
digitalWrite(dirPin1,HIGH);
for(int x = 0; x < 200; x++)
{
digitalWrite(stepPin1,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin1,LOW);
delayMicroseconds(500);
}
delay(1000);
digitalWrite(dirPin1,LOW);

for(int x = 0; x < 200; x++)
{
digitalWrite(stepPin1,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin1,LOW);
delayMicroseconds(500);
}
delay(1000);
}

 

 

Thanks in advance.

 

 

 

0 Kudos
Message 1 of 6
(1,148 Views)

Hi veNKY7,

 


@veNKY7 wrote:

Can somebody help me in converting  the arduino code to LabView  VI.


Why do you want to do that?

Why don't you stick with your Arduino code and just add some communication using the (virtual) COM port of the Arduino?

(The Arduino can control the timing much better on its own than you could do using LINX…)

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(1,130 Views)

because I created a  vi. Based on the  inputs from vi stepper motor should operate

0 Kudos
Message 3 of 6
(1,107 Views)

can i use arduino nano  in labview interface with arduino examples

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

Hi veKNY7,

 


@veNKY7 wrote:

because I created a  vi. Based on the  inputs from vi stepper motor should operate


I still don't see a reason to convert Arduino code to LabVIEW VI.

Is there a reason you cannot use simple VISA on LabVIEW side with some more Arduino code on the other side?

Best regards,
GerdW


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

Hi veNKY7,

 


@veNKY7 wrote:

can i use arduino nano  in labview interface with arduino examples


Which interface are you talking about?

I still recommend to use simple VISA "interface" with some more Arduino code handling the serial port…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(1,082 Views)