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.
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.
08-31-2015 06:03 AM
Hello!
I am trying to find the proper way by which cursors should be programmatically removed in LV 2012. There is an old thread about it: http://forums.ni.com/t5/LabVIEW/resetting-cursor-lists-programmatically/m-p/1490310/highlight/true#M... I initially posted this message in it, but I am not sure whether anyone saw it...
Probably the bugs mentioned in that old therad should be fixed now but it seems to me that the problem reported at the beginning of the thread is still alive.
I programmatically create a list of cursors to highlight spikes on a waveform graph (See cursors_created.jpg).
Then I cleane them all, except for the Threshold cursor. I remove all entries from the cursor list except the first one and rewrite the property. (see CleanUp_cursors_Vi.png).
The result I get is visible in Cursors_cleaned.png. What I wish to have is only the Threshold cursor visible in the Cursors area, without the coordinates of the deleted ones.
Can anyone advise about how to fix this issue? The workaround proposed by Paul Davidson doesn't work for me.
Thanks a lot!
MG
Solved! Go to Solution.
08-31-2015 07:51 AM
hi,
split 1d array seems to work fine ...
08-31-2015 01:02 PM
Would it be more efficient to create a duplicate graph (display style - red points), then leave only points below threshold, and replace other - with NAN (not to show them on graph)? I would say it will be easier for labVIEW to display the second graph, rather than 20 cursors.
08-31-2015 01:16 PM - edited 08-31-2015 01:17 PM
@alexderjuengere wrote:
split 1d array seems to work fine ...
"Reshape array" seems to be more logical. Why use split if you are only interested in one of the outputs?
(quote from the help on reshape: You also can use it to increase and decrease the size of a 1D array.)
Second choice would be "array subset".
(... and I also agree with the other comment that using cursors for all this seems overkill)
08-31-2015 01:23 PM
@altenbach wrote:
"Reshape array" seems to be more logical. Why use split if you are only interested in one of the outputs?
good point, I wanted to re-create the behavior reported by @MG70:
[...]] Then I cleane them all, except for the Threshold cursor. I remove all entries from the cursor list except the first one and rewrite the property. (see CleanUp_cursors_VI.png 12 KB )
09-01-2015 02:15 AM
Hi Alexander,
thank you for your helpful reply! You are righ. The sample vi you created doesn't show the issue and this made me wonder where else my problem came from.
Then I slightly modified your vi to represent a situation closer to what I have in my code. I added an event case and a tab control.
The waveform graph and the creation of the cursors is one event and the rest in another. Please try this:
- create the cursor list in the "Set Cursors" tab by clicking on the "Set Cursors" button
- reset them in the "Reset Cursors" tab by clicking on the corresponding button
- click again on the "Set Cursors" tab to see what the graph looks like
you will see that cursors are no more shown on the graph, their names are cleaned by the list, but their coordinates are still there.
You can also click on them and delete them, but after a while you likely get a runtime error and LabView crashes. This makes me think that the cursors are actually deleted, but still the coordinates are visible for some reasons.
It seems that having the diagram in one event and cleaning the cursors in another is the core of the problem.
Maybe I am doing something wrong in the code? Please, don't bother about the fact that in the "Reset Cursors" I use a Reference for the Wavefrom graph and I wrire it to the Curosrs List property. I could have used the Wavefrom graph property directly and the result would have been the same.
Please, let me know what you think.
Thanks a lot!
MG
09-01-2015 02:20 AM
Thank you Altenbach for your suggestions.
I agree, I could also use the Array Subset instead of the Array Split. The result is the same and it is probably more logical.
Best regards.
MG
09-01-2015 04:56 AM
@MG70 wrote:
[...]
you will see that cursors are no more shown on the graph, their names are cleaned by the list, but their coordinates are still there.
You can also click on them and delete them, but after a while you likely get a runtime error and LabView crashes. This makes me think that the cursors are actually deleted, but still the coordinates are visible for some reasons.
It seems that having the diagram in one event and cleaning the cursors in another is the core of the problem.
Maybe I am doing something wrong in the code? Please, don't bother about the fact that in the "Reset Cursors" I use a Reference for the Wavefrom graph and I wrire it to the Curosrs List property. I could have used the Wavefrom graph property directly and the result would have been the same.
Please, let me know what you think.
Thanks a lot!
MG
hi,
using MG70_cursor.zip 20 KB :
if you put the Waveform Graph outside the Tab Control on the Frontpanel, the Cursors' coordinates will also vanish:
09-01-2015 06:57 AM
Hi!
True, but the problem is that I can't put the waveform on the frontpanel for the way in which the all interface is built....
However, the cleanup of the cursors should work reagrdless the waveform is on the frontapnel or not. Right?
Thanks!
MG
09-01-2015 09:53 AM
@MG70 wrote:
However, the cleanup of the cursors should work reagrdless the waveform is on the frontapnel or not. Right?
Obviously, it does matter which page of the tab control is active, e.g. putting the Graph on the same page as the reset Button would work with