ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple automated testing sequence

Solved!
Go to solution

I have been a LabView user for some years now and I've got on reasonably well with it. I am now suffering from brain fade as I'm looking to implement a very simple VI to run an automated test.

 

I have a motor driving a shaft with an encoder to give me position feedback. I want to cycle the motion of the shaft depending upon the position of the encoder. My basic routine would be:

 

Run motor to end of shaft and stop when encoder output is a certain voltage. Run the motor to the other end of the shaft and stop when the encoder output is a certain value. It sounds very basic but I can't for the life of me work out how to get it running!

 

Any advice would be greatly received...

 

 

0 Kudos
Message 1 of 5
(3,672 Views)
Solution
Accepted by topic author ryouden

Hi ryouden,

 

as you want to cycle your motor you should start to implement a simple state machine: init, homing, move to end, move to start…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(3,664 Views)

Thanks GerdW,

 

I found an online tutorial and it worked out great.

 

Richard.

0 Kudos
Message 3 of 5
(3,638 Views)

GerdW,

 

One more question for you, how can I count the number of times I execute a certain task in teh state machine? I have implemented a number of Case Structures and I'd like to know how often it is executed?

 

Thanks,

 

Richard

0 Kudos
Message 4 of 5
(3,626 Views)

Hello ryouden,

you can increment a counter within the appropriate state and store its' value in a shift register.

Kind regards

0 Kudos
Message 5 of 5
(3,623 Views)