LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cursor will not stay when set to center

I am trying to use a button to get the cursor to center (I plan to have the cursor menu off so center will not be available)
 
I subtract the XScalemin from the Xscalemax then divide by 2 then add it back to the xscalemin.
 
The cursor goes to the center wne the event see the mouse down on the button but the cursor immediately returns to the position
it was at prior to iniating the mouse down event.
 
Anyone got an a suggestion to allow the cursor to stay centered?  I wish that property was avaialble....
 
 
This is on a mixed signal graph, it is a multiplot cursor
 
Thanks
Tim C.
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 1 of 8
(3,586 Views)

Seems to work just fine here. Can you show us some simple code that demonstrates the problem?

(I am guessing there is some other property node that undoes the centering or you have some other race condition)



Message Edited by altenbach on 12-28-2007 02:06 AM
0 Kudos
Message 2 of 8
(3,579 Views)
Hello Tim!

Try to set the cursor to "free". Maybe the cursor is jumping to the next plot point and its outside the graph view?

Just a thought. 🙂

Good luck and cheers!

//Beckman
0 Kudos
Message 3 of 8
(3,574 Views)
Here is the code that prevents the cursor from staying in the center.
 
 
Also had a couple other questions if anyone has the time.
 
 
Looking at the array constants in the provided code......  Those constants were skimmed from the last 25 elements from a larger array.
I used the originating functions to generate the array.... then
1.  I reversed all of them with th ereverse 1D functiontion
2.  then fed them into a for loop with indexing enabled, and loop through 25 times.
3.  Used the reverse 1D array function on each of the arrays on the right side of the for loop so they were back to cronilogical order
4.  Then fed them into the build waveform code.
 
Is that the (one of the) the fastest ways to get the last 25 elements from multiple 1D array?
 
 
I will have data files with years of data being used by this application.  What is the best way to open the files and gead the last 50 record sets (each line will be a record set)?
 
Thanks
Tim C.
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
Message 4 of 8
(3,545 Views)
I am not 100% certain you've run across a bug (I consider it one at this point), but if you have Watch all plots enabled, your VI will not work as you desire.  Other cursor types do not have an issue (of course they don't have a Watch All Plots option).

I modifed you VI and turn off the Watch all plots and set the cursor.  I found that I cannot turn the watch back on too quickly or it will bounce back, so I have a 1ms delay before I turn it back on.  It is very strange behavior.  I also grouped your property nodes together as you can do more than one at a time.  The issue I am still seeing with this is that the X value of the cursor disappears until you move the cursor again.  You also see a "flash" on the cursor pallette.  I also see some strange behavior - if I stop and restart the VI, the cursor bounces back to where it was before.

I also added another OK button for you to look at an alternative method.  This method allows you to set the cursor position by index of the plotted data.  So, I took one of your input arrays, got the size and divided it by 2.  Then I set the Cursor index to this value.  This could get a little tricky if your arrays are not the same size, but it sounds like yours will be.  If your data size is not changing, then you can calculate this value once, otherwise, you would have to calculate it every time.  It also doesn't require the need to turn off Watch All Plots nor the 1ms delay.


Message Edited by Matthew Kelton on 12-29-2007 09:52 PM
0 Kudos
Message 5 of 8
(3,536 Views)
As far as getting the last data is concerned, if you already have all the data, then use a subarray.  It will be easier, faster, and more memory firendly.



If you can modify the code the get the data, then you may be able to just get the desired data from there without reading it all in.


Message Edited by Matthew Kelton on 12-29-2007 10:02 PM
0 Kudos
Message 6 of 8
(3,533 Views)
Yes I figured the sub array was going to be faster...
 
But if I am opening the csv file with years of data available how do I get just the first 50 lines of data?  I will be doing this for 200 files constanly
so speed is a concern + memory management.  I am afraid if I just pull the whole file in I will end up using a lot of memory.
 
Any other sugestions would be helpful....  Is there any way to partition a file or split a file real quick...
 
Thanks
Tim C.
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 7 of 8
(3,530 Views)
It's the first or last 50 lines?
0 Kudos
Message 8 of 8
(3,524 Views)