High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

cursor point for absolute time

Hi,
 
I'm trying to get an amplitude of the plot with mouse down. The Y-axis is the data read from multi-lined text file, X-axis is the absolute time read from the same text file.
When the user mouse clicked the cursor, I want to display the line from the text file.
 
Below is the sample data text file.
 
1/12/2007 10:04:20 AM Lev 5.6
1/12/2007 10:27:53 AM Lev 10.5
......
......
 
So if user click on the plot where amplitude is 5.6, it displays the whole line -> 1/12/2007 10:04:20 AM Lev 5.6
 
I had it working when I used x-axis as line of text. Can anyone give me some idea of what I'm missing?
I really appreciate any help. Thank you!
 
 
0 Kudos
Message 1 of 4
(6,557 Views)
I am not sure I understand the question, but it looks to me that all you need to change is from X to Y in the "Mouse Down? event"  That way you have the Y value where it was clicked and can then search for that value in the array.  Although the value of Y is not neccassarily an incdex, so I would suggest looking at the threshhold 1D Array VI that may help you as well.  It will return you the index of that Y value, so you can then grab the string.  However read the help on that function to make sure your data will work with it.
0 Kudos
Message 2 of 4
(6,551 Views)
Hello,
 
What I'm trying to do is that when user click on the cursor, not neccessarily the exact point but near the cursor, then the mouse point displays the amplitude. So, if user click on the middle of the bar on the bar graph, it still displays the amplitude, not the point where the user click.
 
Thank you~
0 Kudos
Message 3 of 4
(6,547 Views)

Take a look at this example.  I take the X value from the click to find the index in the X array, therefore the index of interest.  I then get the Y values at that index and check to see which one is closest to the Y value of the click.  Based off that I update the name.

Let me know if that doesn't make sense.

Message 4 of 4
(6,540 Views)