LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear motor: change direction with threshold function

https://forums.ni.com/t5/LabVIEW/Linear-motor-change-direction-with-threshold-function/td-p/4286523

I'd check this link for the other person doing the same homework a very similar project

0 Kudos
Message 11 of 15
(571 Views)

Post the code, not a screen shot. 

0 Kudos
Message 12 of 15
(576 Views)

It is the code!

0 Kudos
Message 13 of 15
(571 Views)

Yes, but having the code means we don't have to create your vi by hand to try and help you. 

You've also not included the sub vi which deals with resetting your code. 

Make sure you include everything which is required for your code to run so that people can assist properly. 

in short, you need some sort of logic that reads from the counter value, and controls the T/F state of the direction switch. 

0 Kudos
Message 14 of 15
(564 Views)

@luna30 wrote:

luna30_0-1677490182732.png

This is an example of the code, I'm using myRio to read the encoder. 


Your sequence structure has no purpose because execution is already fully determined by dataflow. Don't add unnecessary complications. You should also know that code with express VIs cannot be analyzed from a picture because all configuration is hidden.

 

See if this can give you some ideas. As noted in the diagram comments, the logic is incomplete and NOT safe.

 

altenbach_0-1677514445593.png

 

0 Kudos
Message 15 of 15
(532 Views)