LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array manipulation

Dear LabVIEW Forum members,

 

Here's my program functional design specification...

 

(1)  I have a tank initially filled to 100 litres

(2)  After each 1 second interval the following liquid (in litres) is filled and discharged from the tank at the same time...

      Inlet to tank [0, 0.345, 0.6, 0.76, 0.86, 0.88, 0.85, 0.82]

      Outlet from tank [1.534057, 5.250186, 6.801075,6.801075, 6.801075, 9.11922, 0.989118, 0.989118]

 

How can the tank contents (in litres) be calculated at each 1 second interval ?

 

Regards,

0 Kudos
Message 1 of 21
(3,891 Views)

Hi,

 

So, if I get you right, the tank initially filled to 100L, then 0L input after 1 second and at the same time, 1.534057L discharged from tank. Then after discharge (assuming discharge/intake happens in 1 second), another value input of 0.0345L intake and 5.250186 discahrge in 1 secomnd and so on right?

0 Kudos
Message 2 of 21
(3,890 Views)

Yes, that's right, I need the tank contents in 1 second intervals based on the input and output contents.

0 Kudos
Message 3 of 21
(3,889 Views)

Can you show us what you are trying to do with a VI?

 

I would guess by putting your fill values in an array and enable indexing, this will be your 'x' values. do the same for the drain values, this will be your 'y' values. Use the subtract function then add it to your tank shift register value with a 1sec wait in the while loop?  hard to guess what you are trying to do here...

0 Kudos
Message 4 of 21
(3,873 Views)

I'm sorry but I didn't understand your description (mainly because I'm not at all experienced with LabVIEW).  I have described the problem that I'm trying to implement in LabVIEW and I've been trying myself to implement this however I'm completely stuck, I don't even know where to begin.

0 Kudos
Message 5 of 21
(3,858 Views)

@bunnykins wrote:

I'm sorry but I didn't understand your description (mainly because I'm not at all experienced with LabVIEW).  I have described the problem that I'm trying to implement in LabVIEW and I've been trying myself to implement this however I'm completely stuck, I don't even know where to begin.


 

hi bunykins,

 

at first, how about you place two 1-d Arrays (inlet & outlet) and one constant (100 l tank) on your Blockpanel and type your data into those control elements:

      

      Inlet tank = [0, 0.345, 0.6, 0.76, 0.86, 0.88, 0.85, 0.82]

      Outlet tank = [1.534057, 5.250186, 6.801075,6.801075, 6.801075, 9.11922, 0.989118, 0.989118]

      tank = 100

 

 

alex

0 Kudos
Message 6 of 21
(3,847 Views)

Please post your VI with the inlet and outlet values saved as default.

 

It will be faster for us to help you and you will learn more if we show you how to fix your VI than if we write on for you.

 

Lynn

0 Kudos
Message 7 of 21
(3,837 Views)

I've attached what you've suggested but how do I start off with the 100 litres to calculate the next value after 1, 2, 3 seconds, etc.  I guess that this is done with a loop?

0 Kudos
Message 8 of 21
(3,836 Views)

Example_VI.png

0 Kudos
Message 9 of 21
(3,832 Views)

No,that's not what I want.  I can see how your program works and this gives the correct result after x seconds however I want an array of results for each 1 second interval.

0 Kudos
Message 10 of 21
(3,824 Views)