LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a stop button to send commands through serial port and end labview vi?

Solved!
Go to solution
I put 10000
0 Kudos
Message 31 of 43
(2,425 Views)

Lynn is correct, that was a dumb mistake on my part.

Move the VISA close outside the For loop, but keep it inside the case structure.
That should do the trick 

Cory K
0 Kudos
Message 32 of 43
(2,424 Views)
And lynn, my visa close is outside the loop actually.
0 Kudos
Message 33 of 43
(2,423 Views)

You HAVE NOT placed a delay between the stop commands. In fact, your delay does nothing except add a delay before the main loop stops.

 

Don't attach images. Attach your actual code. No one can debug images and you only posted a small section of your code.

0 Kudos
Message 34 of 43
(2,412 Views)

Do not place your wait in that random case structure, that doesnt do what you think its doing.

 

Just place the wait in your while loop, completely outside of any other loop except the while loop.

And 10 seconds is a really long time between iterations, try bringing that number down. 

Cory K
0 Kudos
Message 35 of 43
(2,394 Views)
Placing the wait in the while loop just makes everything wait, How can i place the wait solely in between the stop command case structure and the program stop block in the while loop?
0 Kudos
Message 36 of 43
(2,369 Views)
And here is the current version of the code.
0 Kudos
Message 37 of 43
(2,355 Views)
Solution
Accepted by topic author superomario

You would put the wait inside the For loop that stops the pumps.

Wait.png 

Cory K
Message 38 of 43
(2,343 Views)

You can simplify your code by only calculating the address strings once.  Then use autoindexing on the for loops.  If you ever change the number of pumps, only one value in the program needs to be changed.

 

As a trouble shooting tool temporarily place indicators to display the strings sent to the equipment.

 

Lynn

 

For.FP.png   For.BD1.png

For.BD2.png 

Message 39 of 43
(2,325 Views)

Can you explain the autoindexing stuff a bit more? Also I am trying to enhance the program now, and just want to know the best way to go about it. I want to add in addition to the main killswitch that shuts everything down (which is actually taking about 2-3 seconds to complete when i press it) to making individual pump buttons at the start of the program. I've attached my first attempt at this, But i am certain there is a better way to do this. So right not I have it set up as two case structures. Unfortunately there is no pause command for the pumps just full stop. The buttons work fine, but the whole program is rather sluggish and the first pump at address 00 does not always chage the rate with the dial as it should. And any buttons that are pressed have a very noticeable lag between on and pump stopping or turning back on.The program itself works but is not as fast in response as it should be.

 

any thoughts? 

 

And thanks for all the help with everything everyone! 

0 Kudos
Message 40 of 43
(2,297 Views)