06-14-2023 01:49 PM
Hey LabVIEW Community,
This is difficult to explain but in summary the attach VI is used to change positions on actuator which rotates position in a 4 to 6 port valve assembly. Everything worked fine with VI, but randomly the programmed position in VI would change physically on valve from position 1 to 6. For example VI position 1 is selected, but when tested with liquid it comes out of position 6. Nothing has changed physically or thru software but the position randomly changes. Please help!!!!
Solved! Go to Solution.
06-14-2023 02:23 PM
Thank you for attaching your VI. A few suggestions about that:
You seem to be doing VISA communication with three similar devices. What happens if you plug the VISA line for one Station into your PC, open MAX, and see if you can "turn on" a Valve to a known position. Could this be something as silly as "faulty wiring" or a "bad cable"? Could it be "sending the wrong command", or "using the wrong Baud Rate"?
Bob Schor
06-14-2023 02:27 PM
I'm not seeing anything obvious that would cause the error you describe. Perhaps it is your controller resetting if you don't send it any commands in X amount of time.
A simple code smell: There is no need for a wait in a loop that has an Event Structure in it.
06-14-2023 02:31 PM
Bob shor,
I have the 2022 Q3 version, not sure how to save it to earlier version of Labview. I only have 1 version
06-14-2023 02:35 PM
CrossRuls,
Are you referring to this? Let me know if I need to remove the wait
06-14-2023 02:40 PM
Attached is the technical notes from manufacturer of Valve actuator assembly. Let me know if this helps....
06-14-2023 02:59 PM
@Manny904 wrote:
Bob shor,
I have the 2022 Q3 version, not sure how to save it to earlier version of Labview. I only have 1 version
File > Save for Previous Version...
06-14-2023 03:00 PM
@Manny904 wrote:
Attached is the technical notes from manufacturer of Valve actuator assembly. Let me know if this helps....
You forgot to add the attachment.
06-14-2023 03:01 PM
Sorry!!!
06-14-2023 04:11 PM - edited 06-14-2023 04:33 PM
All your event timeouts are -1, which is the same as "infinite". They will never trigger!
Your 1s waits have absolutely no purpose except that the the various events get sluggish to react if they occur in rapid succession.
Yes, this entire code has a horrible "code smell" as already mentioned. Displaying the elapsed time in millisecond resolution is just plain silly. All your code gymnastic to turn a simple scalar into a few booleans and tanks boggles the mind! Why not have e.g. arrays of tanks? Only maximally one LED for each group can possibly be true, so why not use a radiocontrol indicator?
It seems bad idea to have all these stop buttons, because once you stop one of the four loops, it can never be restarted. Why not have a proper state machine? Open each VISA session before the loop and close after the loop. Get rid of the event structures and just loop at the desired rate. The position can be on the toplevel loop diagram and trigger a case structure when it's changed.