02-27-2023 03:54 AM
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
02-27-2023 03:55 AM
Post the code, not a screen shot.
02-27-2023 04:06 AM
It is the code!
02-27-2023 04:19 AM
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.
02-27-2023 10:14 AM
@luna30 wrote:
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.