LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loops

Please do not attach a new VI that has exactly the same name as a different VI posted earlier!

0 Kudos
Message 11 of 34
(400 Views)

@alhabeeb wrote:

I figured it out but it kind of a mess because I need to convert the current to mass flow rate by this formula

 

Flow Rate=(Measured Current_mA4mA)/16mA.

Any way to organize it more?   


Is the result correct?

 

Why do you have two identical diagram constant each if one each would be sufficient? You can branch the wire!

0 Kudos
Message 12 of 34
(398 Views)

That piece of code you can create a sub-vi, and reuse it everytime you need to convert the mA readings into Flow 

LVNinja_0-1738774885320.png

 

0 Kudos
Message 13 of 34
(394 Views)

 

Why do you have two identical diagram constant each if one each would be sufficient? You can branch the wire!


I branced them as shown in the attached VI.

0 Kudos
Message 14 of 34
(386 Views)

@LVNinja  a écrit :

That piece of code you can create a sub-vi, and reuse it everytime you need to convert the mA readings into Flow 

LVNinja_0-1738774885320.png

 



Yes it could be.

Thanks

0 Kudos
Message 15 of 34
(385 Views)

Done correctly, you can just incorporate the correct scaling of m_sec and m-prim into the array diagram constants outside the loop. You also need to decide how to chart and save things. You should append the ER to the 1D array for saving and you should also decide if you want three charts (currently, two of these unscaled "m_..." values will show on the P chart, not something that makes a lot of sense.

0 Kudos
Message 16 of 34
(388 Views)

Here's what I might do for the math using simulated data. (I could not deal with your disorganized front panel, but you should figure it out.

 

altenbach_0-1738780883066.png

 

altenbach_1-1738780924306.png

 

0 Kudos
Message 17 of 34
(379 Views)

@altenbach  a écrit :

Here's what I might do for the math using simulated data. (I could not deal with your disorganized front panel, but you should figure it out.

 

altenbach_0-1738780883066.png

 

altenbach_1-1738780924306.png

 


Hi,

-Yes, I want also to chart m_sec, m_prim and ER.

- Your code has no control for the target time!

- Also, I want to indicate the all values in numerics and charts.

- To be honest, I didn't understand how did you scale the m_sec and m_prim ^_^

Thanks a lot

 

Alhabeeb 

0 Kudos
Message 18 of 34
(346 Views)

@alhabeeb wrote:

I figured it out but it kind of a mess because I need to convert the current to mass flow rate by this formula

 

Flow Rate=(Measured Current_mA4mA)/16mA.

Any way to organize it more?

Thanks

 

ALAHBEEB​   


So it's a typical 4-20mA module? Usually that's the normalization, then you need to scale it to the original range.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 19 of 34
(323 Views)

@alhabeeb wrote:
-Yes, I want also to chart m_sec, m_prim and ER.

- Your code has no control for the target time!

- Also, I want to indicate the all values in numerics and charts.

- To be honest, I didn't understand how did you scale the m_sec and m_prim ^_^


I was demonstrating the scaling and intentionally left out the target time. You already figured out how to deal with it with just a comparison and case structures. No need to leave that in, cluttering the code. Same with all your indicators. It would be much easier to use arrays of indicators for each class.

 

If you want to chart these three values, you need to decide where (P chart? T chart? A third chart? Two more charts? Second Y scales?). I cannot make that decision for you.

 

I always assume that you are honest, no need to state that. Scaling is just a linear mapping and you can calculate what the constants should be from first principles. That's what I did. In your old code, you scaled twice in a row, first by multiplying by 1 and adding zero, then subtracting 0.004 and dividing by 0.016. This is the same as multiplying by 62.5 (1/0.016) and adding -0.000064 (-1 x 0.016 x 0.004). Right?

 

 

0 Kudos
Message 20 of 34
(297 Views)