LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My recirculating pump in sub vi simulation link doesnt work in the second iteration .It opens for maybe half a second whereas i gave the time delay for 5 secs..plz help very urgent

Hi,
     I have attached my simulation loop.In the model attached i hav eone main pump with constant rpm which drives the 5 smaller pumps and fills the tank at the same time.As soon as the tanks reach their 90% level,the valves of the five pumps close(SP1,SP2,SP3,Sp4,Sp5).After that the recirculating pumps opens for 5 secs of the first tank.As soon as the recirculation finishes,the drain valve(SV1) for tank 1 open and the volume goes to interim storage.This happens for all the remaining tanks.

My simulation works the first time,but when the second time the loop starts,it skips the recirculation pump even though i gave a time delay for 5 secs.Plz help ..I have attached the simulation.

Thanks,
Rami
0 Kudos
Message 1 of 4
(2,504 Views)
Rami,

I suspect that you have a race condition. The widespread use of local variables frequently leads to race conditions. Your subVI (Spatial Logic Sub_2.vi was not included) so I cannot run the VI. You have no way of knowing whether the subVI or the inner case structure will execute first, because there is no data dependency between them.

I think a shift register or a few and some dataflow thinking would allow you to eliminate the inner case structure, the local variables, and, probably, most of your problems.

Some of the SPi are indicators and some are controls. How are they used?

The last case of the inner loop retursn to Case 1. Would case 0 be better?

As for the second time through issue, it may be related to the Elapsed time function Auto Reset. From the help file: "Resets the start time to the value in Present (s) when the Express VI reaches the Time Target (s)." If more than 5 seconds elapses between the first time you use this and the next, it will exit immediately on the subsequent calls.

Lynn
0 Kudos
Message 2 of 4
(2,490 Views)
Thanks for the prompt reply.i m hereby attaching my sub.vi so u can run it..i'd be grateful to ur time and help..

Sincerely,
Rami
0 Kudos
Message 3 of 4
(2,482 Views)
Thanks for the prompt reply.i m hereby attaching my sub.vi so u can run it..i'd be grateful to ur time and help..

Sincerely,
Rami
0 Kudos
Message 4 of 4
(2,477 Views)