LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update of tank indicators (by sending a command within a while loop)

Solved!
Go to solution

Hi there,

 

I am slowly getting a bit more familiar with LabView and feel confident enough to code for an ISCO Pump (model 100dx).

 

My pump has two syringes, and I'd like to display the ammount of fluid contained in those pumps - continuously. 

 

So far I've tried what's on my snippet (tank A & B)

 

I beleive there is a more elegant way to send a command at every loop. Thank you for your help 🙂

 

Flo

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

Tank A's terminal belongs inside the loop rather than using a local variable.  (The read local variable write to terminal outside the loop only happens once, and it otherwise pointless.  That's like say Let x=x in a text based language.

 

Beyond that, I don't understand your question.

 

What I do see is that you have an event structure there.  That loop only iterates whenever an event happens, which means reading the tank A and B values onlyi happens when an event happens.  You might want to wire in a timeout value to the event structure so that it will execute the timeout case (even if you do nothing in it) and it will iterate the loop again to read the tank A and B values.

0 Kudos
Message 2 of 16
(3,182 Views)

I must have been more specific: my syringes see their contain varying all the time throughout my experiment (their are receiving and giving fluids). So I would like to see those changes over my tank indicator. 

 

The only problem is that I have to send a command to get that information, and as you said, the while loop will loop if an action is done by the user. 

 

Let me know if you need further explaination

 

Flo

0 Kudos
Message 3 of 16
(3,174 Views)

So do what I said and wire up a value to the timeout terminal of the event structure.

0 Kudos
Message 4 of 16
(3,167 Views)
If you add a timeout to your event structure, the code in the timeout will execute if no other event occurs during that time - you could put your code for reading the syringes in there.

(Of course, if you send/generate a lot of events...the timeout case might never happen - if that's a problem you might want to put that into another loop)

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 16
(3,166 Views)

I tired to add a timeout event, but everytime I trigger an action (run the pump, or whatever action), it fails....

 

Flo

0 Kudos
Message 6 of 16
(3,100 Views)
What do you mean by 'fails'? What do you see? What error message do you get?

Did you read my comment in brackets?

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 16
(3,097 Views)

I did yes, and besides clcking on a run button I don't generate that much event. 

 

Basically what's happening is that every other case event which contain a WRITE/READ function fails to send that command. the error message is -107something (sorry I am not in the lab this morning).

 

Flo

 

 

0 Kudos
Message 8 of 16
(3,090 Views)

You will need to attach your latest VI.  Somehow I don't think you implemented things the way we said.

0 Kudos
Message 9 of 16
(3,062 Views)

Here you go 🙂

 

 

0 Kudos
Message 10 of 16
(3,059 Views)