LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

some problem about Labview + Arduino + stepper motor + proximity sensor

I'm using LabVIEW 2021 and wanted to achieve three main functions for two-axis stepper motors and 4 proximity sensors.

The first function is using proximity sensors to positioin the home-position of each axis.

The second fuction is to manually control the motor rotation by entering the angle within the range by the proximity sensors.

The third function is using the table data of excel to automatic control of motor rotation. 

But I have 3 problems.

1. When I press the stop button while the motor is spinning in the Home-position event, the motor does not stop spinning. Also when other events are running, pressing the stop button is equally unresponsive.Even the stop button cannot be pressed.

2. Now I have no idear of stopping the motor by accroding the value of proximity sensor when the motor is runing. So now I have to give the motor rotation signal one by one and at the same time to read the value of sensor. But in this way I can't make the motor runs faster.

3. After reading the excel data the motor will rotate according to the data. But when it rotating I can't drag the table slider. That means I can't check the table unless the motor stops runing.

 

That is all the problems that I have encountered. Could you guys help me with these three questions?

Position eventPosition eventsub Vi Home positionsub Vi Home positionmanually controlmanually controlautomatic controlautomatic controlsub Vi motor runing accroding to excelsub Vi motor runing accroding to excel

0 Kudos
Message 1 of 3
(884 Views)

Granted it has been a long  time since I used LINX but...

 

An Arduino is a simple single core single tasking microcontroller. So I don't think you can do what you are trying to do here.

Inked1_LI.jpg

Splitting the Arduino reference and running parallel code probably will result in a race condition at best.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 3
(863 Views)

Hallo Enthusiast, 

Thinks for your answer at first. I've also wanted to use LINX to program, but I could only find a large number of examples of the old Arduino. 

I have tried to run the motor with my programming above, and all the functions I want are available. Now I just want to optimise the programming. So I have asked the three questions above.

0 Kudos
Message 3 of 3
(828 Views)