LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loops

Hi @ 

There is something wrong. Indicated data are wrong. The graph of mass flow rate? The timer cause error when stop the while loop.

How can fix these issues?

Thanks

 

Alhabeeb

0 Kudos
Message 21 of 34
(302 Views)

Hi alhabeeb,

 


@alhabeeb wrote:

Indicated data are wrong. The graph of mass flow rate? The timer cause error when stop the while loop.


  • Which data are wrong and in which way are they wrong?
  • What's wrong with the "graph of mass flow rate"? Btw. this is a chart and not a graph…
  • Which timer causes errors? Which errors does it cause?
  • Why do you need "value" property nodes when you could use wires inside the loop??? (Race conditions ahead!)

You really need to learn to provide useful information with your questions!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 22 of 34
(290 Views)

@alhabeeb wrote:

Hi @ 

There is something wrong. Indicated data are wrong. The graph of mass flow rate? The timer cause error when stop the while loop.

How can fix these issues?


The word "something" is an understatement here!

 

Why would you replace the large index array with a few shorter ones? Your start indices are obviously wrong, they should be 5 and 9, not 6 and 10. Also if you want to start with index=zero, you don't even need to wire that.

 

As has been mentioned, do NOT use value property nodes, just wire as before. (You currently cannot tell if the property is read before or after the terminal has been written, but the outcome depends on that. Race condition! Property nodes are also computationally very expensive).

 

There is no "timer" that can cause any errors.

0 Kudos
Message 23 of 34
(279 Views)

@ 

@ 

I really appreciate what you have done to me. Let's make my question clear ^_^

Dear @ 

1- Why did you replace saving file by a table?

2- About the index, does the index in the index array represent the number of the physical channel? 

3- What is the difference between these induces in your code , and what are they representing?

alhabeeb_0-1738922142621.png

Thanks

 

Alhabeeb

   

0 Kudos
Message 24 of 34
(260 Views)
  1. I used the table to make a quick demo and avoid writing files that I don't want. You asked about the scaling math. You already know how to conditionally write to a file, no need to show and explain that again.
  2. If you don't know what the index of an array element means, you need to go back to the tutorials.  An array is a collection of identical elements, each identified by its index. The firs array element has index zero, and so on.
  3. If you don't know the function of a code element, open the context help (ctrl+h) and hover over it. For more detailed help, do a right-click...help. It's all there!
0 Kudos
Message 25 of 34
(226 Views)

Hi,

Thanks a lot for your help.

Just check for me please, whether adding ER to the mass flow chart is correct or not the.

Thanks

 

ALHABEEB

0 Kudos
Message 26 of 34
(190 Views)

You still have the wrong indices wired to some of the index array nodes. Did you understand what I said last time?

 

 

0 Kudos
Message 27 of 34
(171 Views)

Hi,

With this 

alhabeeb_1-1739264548125.png

In total I have 11 elements. I split first two (m_prim and m_sec) for the mass flow rate chart, then from the rest, I split first 5 to T_chart and the rest goes to P_chart as shown in the pic. below. It is good.

 

alhabeeb_2-1739264689323.png

 

But when I added ER to the mass flow rate chart: 

alhabeeb_3-1739264917063.png

I got this?!

alhabeeb_4-1739264941035.png

How can I fix it?

Thanks

 

Alhabeeb

 

 

0 Kudos
Message 28 of 34
(161 Views)

Hi alhabeeb,

 


@alhabeeb wrote:

In total I have 11 elements. I split first two (m_prim and m_sec) for the mass flow rate chart, then from the rest, I split first 5 to T_chart and the rest goes to P_chart as shown in the pic. below. It is good.

 

But when I added ER to the mass flow rate chart: 


You don't "add", but you create a 2D array from elements!

And you do this creation in the wrong order!

 

Why don't you create a 1D array from your two m_* elements and one ER element and then build a 2D array from this 1D array to plot in the chart? (And so you would apply the very same algorithm as is used with the other charts!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 29 of 34
(155 Views)

@GerdW  a écrit :

 

 

Why don't you create a 1D array from your two m_* elements and one ER element and then build a 2D array from this 1D array to plot in the chart? (And so you would apply the very same algorithm as is used with the other charts!)


How can I do that? The other two charts come directly from the acquired elements but ER is for the division of the two acquired elements.

Thanks

 

Alhabeeb 

0 Kudos
Message 30 of 34
(149 Views)