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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

finding the average between 2 cursors

I am not sure if you are still active and I know this is a few years old, but I just found this and was wondering, how would I go about adding another set of cursors that do the same thing as the original two, but do it independently and calculate and independent average? I have been trying to perform this function for days but nothing works and I keep running into error. 

0 Kudos
Message 11 of 22
(1,034 Views)

@Punsach wrote:

I am not sure if you are still active and I know this is a few years old, but I just found this and was wondering, how would I go about adding another set of cursors that do the same thing as the original two, but do it independently and calculate and independent average? I have been trying to perform this function for days but nothing works and I keep running into error. 


It would seem trivial to extend my current code to many cursor pairs. Show us what you tried.

0 Kudos
Message 12 of 22
(1,026 Views)
0 Kudos
Message 13 of 22
(1,023 Views)

I am not at the lab right now and do not have access to it, but basically I used the property node to add two more cursors, and paralleled the indexes to that of the original two. Then I repeated the code from the original two cursors (that you wrote) for these two new cursors, in an indepedent while loop. I attempted to fix the problem by putting them into the same while loop, but that did not work either. 

0 Kudos
Message 14 of 22
(1,009 Views)

If my attachment above does not work for you, please show us your code. Most likely the fix will be very simple.

0 Kudos
Message 15 of 22
(1,000 Views)

 

 


@altenbach wrote:

If my attachment above does not work for you, please show us your code. Most likely the fix will be very simple.



Your attachment worked perfectly! Thank you so much! Using this I can add to it to meet the specifications I have been given, so again, thanks for the help! 

0 Kudos
Message 16 of 22
(997 Views)

Hello, I have a vi that i am using to display the output of a strain gauge.  There are two folders, the first is used to calibrate the gauge and the second to perform the test.  Currently the average value is displayed at the end of the test, however i would like to be able to select the range to use for the calculation.  I saw your solution using the cursor lines and tried to implement that into my vi but i could not get it to work (i have no experience with labview).  Would it be possible to for you to take a look at what I have and see if you can help.  thanks

0 Kudos
Message 17 of 22
(761 Views)

Your VI does not contain any cursors. Show us what you tried. Were you using locked cursors?

 

(There are no "folders". Your VI uses 100% CPU when not doing anything and architecture seems inside-out. Have a look at a simple state machine architecture.)

0 Kudos
Message 18 of 22
(743 Views)

Thanks for the quick response.   I tried incorporating the code you created called  GetCursor into my vi but I was unable to get it to work, I am very new to labview.  I removed it because I didn't want to muddy the waters.

0 Kudos
Message 19 of 22
(738 Views)

Then create a small VI only containing some typical calibration data and your xy graph.

 

 

0 Kudos
Message 20 of 22
(733 Views)