From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

compare live feed to limits in a spreadsheet

once again i turn to the all knowing labview board in my hour of need....

 

attached is my code and data.

 

 

I am trying to compare my live data feed (Ref in) scan through an excel spreadsheet and find where the Ref in satisfies that it lies between the two limits(2nd & 3rd rows). and then returns the value in the 1st row.

 

The Data:

I have a excel sheet with 3 rows of data,

 

1st row is the data to be returned to the user if the reference value is between the below limits....

 

2nd row is the maximum threshold for the reference signal that comes in.

 

3rd row is the minimum threshold for the reference signal that comes in.

 

in my code I read the data into an array then compare that the Reference signal is greater then the minimum value.

then it has to satisfy that it is below the maximum value.

 

for example:  if the current Reference signal is  1.220 then my output will be 6.........all going to plan.

 

and then finally return the value in the first row at that position to the user as the answer.

 

i have made and attempt at it in the attached files.

 

your advice / assistance is appreciated.

 

 

Thanks,

John

Download All
0 Kudos
Message 1 of 3
(3,167 Views)

Why don't you just use the In Range & Coerce function and check against both limits at the same time.

 

Obviously your PH Out has to be an indicator so you can wire to it.

0 Kudos
Message 2 of 3
(3,152 Views)

Hey thanks for the reply

 

How about this. Not sure why this wont work (I'm new to this stuff).

 

 ultimatly ill be putting all this in a sub vi. that will just keep "decodeing" my Ref in data into a ph number.

 

 

also as I want this function/code/doodle to monitor the continuous data from "Ref in". How would I go about resetting the the for loop( after it reaches the end of the spreadsheet so as to start the process all over again)

 

im thinking after a time delay restart the for loop again?? a couple of milli seconds to the user wont be too detremental.

 

 

Advice/support/direction appreciated.

 

John

 

 

Download All
0 Kudos
Message 3 of 3
(3,138 Views)