LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help VI change position

Solved!
Go to solution

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!!!!

0 Kudos
Message 1 of 16
(1,192 Views)

Thank you for attaching your VI.  A few suggestions about that:

  • Don't "hide controls".  It makes it difficult to "see the code".
  • Try to keep all elements of the Front Panel "within sight of each other".  Moving Controls and Indicators 4 or more screen-sizes away from everything else makes them difficult to examine.
  • Many well-experienced LabVIEW users do not update to the Latest Version every year (or even every 3 years).  With "simple code that doesn't work", getting more eyeballs on it really helps.  Consider saving to a LabVIEW version 3 or 4 earlier than the Latest.

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

0 Kudos
Message 2 of 16
(1,180 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 16
(1,178 Views)

Bob shor,

 

 

  I have the 2022 Q3 version, not sure how to save it to earlier version of Labview. I only have 1 version

0 Kudos
Message 4 of 16
(1,173 Views)

CrossRuls,

 

  Are you referring to this? Let me know if I need to remove the wait

 

Manny904_0-1686771243827.png

 

0 Kudos
Message 5 of 16
(1,167 Views)

Attached is the technical notes from manufacturer of Valve actuator assembly. Let me know if this helps....

0 Kudos
Message 6 of 16
(1,162 Views)

@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...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 7 of 16
(1,146 Views)

@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.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 8 of 16
(1,144 Views)
0 Kudos
Message 9 of 16
(1,136 Views)

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.

 

 

0 Kudos
Message 10 of 16
(1,101 Views)