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: 

need cursor value from graph to use in block diagram

I have a graph made using the XY Graph function.  I have two different cursors setup.  I am be able to move the cursors around to different data points I have in a 2D array. 

Basically I want to be able to select the data between the two cursors for removal from that array.  I cannot figure out how to take the value that the cursor is at in the front panel and access that value in the block diagram.

Any help would be appreciated.
0 Kudos
Message 1 of 21
(3,172 Views)
here's my code...

Message Edited by gatordan82 on 06-14-2006 02:56 PM

0 Kudos
Message 2 of 21
(3,162 Views)
I would use the index property of the cursors.  Right click on the XY Graph and select Create>Property Node>Cursor List.  This will return an array of culsters containing various properties for every cursor on the graph.  From there you can delete the subset from your data.


Message Edited by jasonhill on 06-14-2006 02:58 PM

0 Kudos
Message 3 of 21
(3,161 Views)
is there any way you could tell me what all those functions are, or let me see the actual .vi file.  I'm an ultra noob at labview
0 Kudos
Message 4 of 21
(3,151 Views)
OK, here's a quick modification of your VI, using direct property nodes (LabVIEW 7.0). You just right-click on the terminal of the desired graph and select "Create...property node", expand to how many terminals you want and for each if it should be read or write and what property you want.
  • Notice that the two other graphs never receive any new data, thus they belong outside the loop.
  • Since the loop just handles user interactions, you need a small wait statement so it plays nice and does not consume all available CPU doing nothing important.
(In LabVIEW 8.0, things would be quite a bit easier, because we now have events for cursor movements! :D)
0 Kudos
Message 5 of 21
(3,144 Views)
maybe this is for me to figure out, but basically I want to be able to cut out many different sections of the data, and replot the new (subset) data in all of those graphs.  Maybe have some kind of button setup when I have the desired portions (for deletion) selected, Click and everything gets updated.
0 Kudos
Message 6 of 21
(3,143 Views)

You just need to build new arrays, containing only the "in range" data.

Attached is a very quick&dirty implementation that should get you started. It clearly needs more work, especially when switching plots etc. Also, if your arrays have significant size, you should avoud the built array nodes and use soemthing more efficient.

I don't have a datafile, so I cannot test, and it's probably full of bugs. Just modify as needed.

0 Kudos
Message 7 of 21
(3,132 Views)
I'm also having another problem with the actual data and how it's transformed from a .txt file to an array.

My first test data set i used only integers, and everything seems to work fine.

I tested again with only decimal values (<1) and it's all messed up.

I'll attach the pertinent section of code (.vi) and the two sample data sets.
Download All
0 Kudos
Message 8 of 21
(3,130 Views)

(To read decimal data, set your format to %f instead of %d)

However, don't complicate things, just use "read from spreadsheet file". 🙂

Message Edited by altenbach on 06-14-2006 02:56 PM

0 Kudos
Message 9 of 21
(3,121 Views)
OK, so I think I've got something that will do what I want, but it seems to have errors.   Any help would be appreciated.

Let me just restate what the program should do.

1) Takes input of a (3 column) spreadsheet data file (.txt) Example file is attached (sample2.txt)
2) Makes 3 plots... two mini plots for inspection of Column 1 (y) vs. Column 2 (x), Column 1 (y) vs. Column 3 (x).
  The third larger plot should be one of the other two graphs selectable by the switch (simply replotted, larger and with cursors).
3) With that large plot, you should be able to move the two cursors to select a range of data.
4) The data in that range will be deleted when you press the button, leaving a smaller sub-array of data.
5) This deletion should be repeatable any number of desired times, while every time leaving a smaller sub-array of the original data set.
6) After every deletion, the graphs should replot the new sub-array of data.
7) After you're satisfied with the data, you can save the new smaller sub-array into a similar spreadsheet file.


 
Download All
0 Kudos
Message 10 of 21
(3,100 Views)