LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I make the comparison of two string one by one

Solved!
Go to solution

Hello everyone,

 

I am new in labview and I am stuck with the problem.

I have a huge text file with a different pressure values at different ports. My goal is to find the mean value of two ports and finding the dP and from that value I have to find  max value of dP.For that please see the attached VI. and see the 1st case structure from that attched VI.This I already done.

[I first case structure I compare the port 103 and port 115 ]

 

Now what I did, it was for the 2 ports and now I want to make a calculation for the comparison of two ports but labview should do it automatically , for reference I attached the text file.

[Now I want to compare 103 & 115,104 & 116, 105 & 117 automatically one by one]

Please refer the 2 nd structure for that.( in first case structure I put the search 1D array function for finding the location of the port column but I have to write manually there the "Port 103", now what I want that The labview read automatically the port 103 , port 104 and calculate the mean value)

 

It would be grateful if you can help me. 

Download All
0 Kudos
Message 1 of 11
(2,723 Views)

Any one can help me in this problem?

 

regards,

Maulik

0 Kudos
Message 2 of 11
(2,709 Views)

Hi Maulik,

 

you know this is a forum of volunteers. So asking after just 45mins is not the way the forum works...

 

If you would attach your VI in an older LabVIEW version (like LV2011) much more people would be able to look at it!

 

I would start with a function like ReadFromSpreadsheetFile or SpreadsheetStringToArray...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 11
(2,706 Views)

I am extermely sorry for my impatient...

0 Kudos
Message 4 of 11
(2,702 Views)

I would just use Read From Speadsheet File, remove the row colum, and then wire the resulting array into a FOR (autoindexing).  Inside of this FOR loop will be the code you already have.  Just use Array Index to get the two values you want to search for.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 11
(2,689 Views)
Solution
Accepted by topic author mrdesai88

I push the run button and also push the highlight button to see the execution. And I found something wrong.

 

In the second case structure search element function read the perfect location of column but after identyfied the column number the message not passed to the upper structure and calculation not started. The calculation started when it reads all the element and passes the final element column and then the calculation started ... 

0 Kudos
Message 6 of 11
(2,679 Views)

@mrdesai88 wrote:

I push the run button and also push the highlight button to see the execution. And I found something wrong.

 

In the second case structure search element function read the perfect location of column but after identyfied the column number the message not passed to the upper structure and calculation not started. The calculation started when it reads all the element and passes the final element column and then the calculation started ... 


I'm not following you at all there.  And what case structures?  Those look like In Place Element Structures to me.  And those are not needed at all.  Post your latest code and we'll see what we can find.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 11
(2,660 Views)

sorry its a place element structure... I just put it for my conveniency.

 

I will post the new VI soon. And yes I found the mean value. I just wanted to know that my way is correct or not.. 

thanks for your help...

0 Kudos
Message 8 of 11
(2,656 Views)

Please see the attch file.

 

Now I am able to find the mean value...

 

now I want to do the subtraction of the 1st row of array 5 and 1st row of array 6 then 2nd row of both array and so on ....

 

and then from the out put I have to define the max value of the each row... THE SECOND BIG PROBLEM IS, SOMETIMES I FOUND THE ERROR THAT "NOT ENOUGH MEMORY TO PERFORM THIS OPERATION".. I dont knw how to deal with this...

0 Kudos
Message 9 of 11
(2,648 Views)

I tried cleaning up your code.  The subtraction is just as simple as doing it inside of the FOR loop.  Same for the Maximum value of each.

 

The Out of Memory issue can be a hard one to nail down.  Things you can do is try to avoid extra memory allocations caused by resizing of your arrays, avoid duplicate computations that aren't needed, reduce the number of front panel objects, or just use smaller arrays.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 11
(2,621 Views)