LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set up stops in Labview

Hello!

 

I need to code a program in labview to control the up and down movement of the platform of a 3D printer (with a stepper motor). At the end of the stroke there are stops which send 5V when they are activated. I managed to create a programme which, when it receives 5V, changes the direction of rotation of the motor. However, when the voltage drops below 5V, the motor returns to its original direction of rotation. Concretely, I would like the program to keep the n-1 direction and not the default one. I've tried to make a shift register but without success.

 

Thanks in advance for any help

 

0 Kudos
Message 1 of 6
(194 Views)

Hi Korralegend,

 


@Korralegend wrote:

I managed to create a programme which, when it receives 5V, changes the direction of rotation of the motor. However, when the voltage drops below 5V, the motor returns to its original direction of rotation.


You should change direction based on rising edges in your end switches - and not based on the current state of the switch…

 


@Korralegend wrote:

Concretely, I would like the program to keep the n-1 direction and not the default one. I've tried to make a shift register but without success.


It seems you made an error in your program.

As you didn't attach the VI you need to debug on your own!

Best regards,
GerdW


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

@Korralegend wrote:

I've tried to make a shift register but without success.


You probably did something wrong.

 

Post what you have...

 

That crossed, once is enough.

0 Kudos
Message 3 of 6
(173 Views)

Hello, thanks for your answer. So i need to change my analogic input by a digital input? Sorry it's my first message on this forum. I attached to this message my VI but it's an FPGA layer so don't know if it will help.

Download All
Message 4 of 6
(170 Views)

Hi Korralegend,

 

as I wrote before you need to check for rising edges:

Right now you only follow the current state of your switch signal…

 

You still can use the AI signal as you get a boolean value after the comparison.

Best regards,
GerdW


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

okay thanks, I will try!

0 Kudos
Message 6 of 6
(116 Views)