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: 

Multiple cursors...

Hi!
I have a question that Natinst seems to know very little about. I have
two graphs. I need to set the x-value of two cursors per graph via my
program. The y-value is unimportant. How do I do that? I tried what
seemed to a good idea, the cursor x attribut node but nothing happened.
Please help!

Regards

/Stefan
0 Kudos
Message 1 of 7
(4,032 Views)
You need to use the Active Cursor attribute first, to select one of the
cursors (they are numbered 0,1,2..). The you can use the Cursor
Position>Cursor X attribute to set the X position of the active cursor.

Stefan Eriksson wrote:

> Hi!
> I have a question that Natinst seems to know very little about. I have
> two graphs. I need to set the x-value of two cursors per graph via my
> program. The y-value is unimportant. How do I do that? I tried what
> seemed to a good idea, the cursor x attribut node but nothing happened.
> Please help!
>
> Regards
>
> /Stefan

--
Tom Johnstone
FAPSE
9, Route de Drize, CH-1227, Carouge (GE), Switzerland
Email. Iain.Johnstone@pse.unige.ch
http://www.unige.ch/fapse/emotion/members/johnston/johnston.html
Tel. +41 22 705 9777 Fax. +41 22
300 1482
0 Kudos
Message 2 of 7
(4,032 Views)
> You need to use the Active Cursor attribute first, to select one of the
> cursors (they are numbered 0,1,2..). The you can use the Cursor
> Position>Cursor X attribute to set the X position of the active cursor.
>

This will work fine if the cursor is not locked or snapped to a plot. If
it is, then you can't use the X position attribute, and you should use the
index attribute instead. Free cursors can be placed arbitrarily at any X
and Y position. Locked or snapped cursors need you to tell them which
plot and which point to index from the plot. I'd like to see the X work in
the future, but for now use the Active Plot and the index.

Greg McKaskle
0 Kudos
Message 3 of 7
(4,032 Views)
> This will work fine if the cursor is not locked or snapped to a plot. If
> it is, then you can't use the X position attribute, and you should use the
> index attribute instead. Free cursors can be placed arbitrarily at any X
> and Y position. Locked or snapped cursors need you to tell them which
> plot and which point to index from the plot. I'd like to see the X work in
> the future, but for now use the Active Plot and the index.
>
> Greg McKaskle

Well, I currently have a 'free' cursor. I then wire 0 to the active plot and
then a number, then 1 to the next active plot and then the same number plus an
offset into the next cursor x node and I still get only one cursor. I have
asked Natinst about this, sent my 'code' and all but they can't seen
to
understand what I want to do. I didn't receive any answer anyway.

Currently I have four nodes. two active cursors and two cursor x's. I wire 0
and 1 into active cursor and two variable and different values (sliders) into
the cursor x nodes. The first cursor moves just fine according to the slider
but the second cursor is not visible. Please help!
0 Kudos
Message 4 of 7
(4,032 Views)
....
> Well, I currently have a 'free' cursor. I then wire 0 to the active plot and
> then a number, then 1 to the next active plot and then the same number plus an
> offset into the next cursor x node and I still get only one cursor. I have
> asked Natinst about this, sent my 'code' and all but they can't seen to
> understand what I want to do. I didn't receive any answer anyway.
>
> Currently I have four nodes. two active cursors and two cursor x's. I wire 0
> and 1 into active cursor and two variable and different values (sliders) into
> the cursor x nodes. The first cursor moves just fine according to the slider
> but the second cursor is not visible. Please help!

Ah. Well I was also misunderstanding your problem. If you want to progra
mmatically
define a new cursor, you need to use the Cursor List. Assuming you want
to keep the
current cursors, read the Cursor List, append a new element to it with
all cursor
settings however you want them, then write the Cursor List. Active
Cursor will always
pin to the currently valid cursors on the graph. It will never create
new cursors.

It also sounds like you are breaking the attribute nodes apart. They
execute from top
to bottom and can have intermixed reads and writes. This makes it
easier to sequence
without introducing sequence structures or race conditions. Just grow
the node to have
the number of terminals you need, then popup to select what you need and
to make it a
read or a write.

Greg McKaskle
0 Kudos
Message 5 of 7
(4,032 Views)
Greg McKaskle wrote in message <37D3FC72.3187C0E6@austin.rr.com>...
>...
>
>Ah. Well I was also misunderstanding your problem. If you want to
programmatically
>define a new cursor, you need to use the Cursor List. Assuming you want
>to keep the
>current cursors, read the Cursor List, append a new element to it with
>all cursor
>settings however you want them, then write the Cursor List. Active
>Cursor will always
>pin to the currently valid cursors on the graph. It will never create
>new cursors.
>
>...
>Greg McKaskle

An even easier way if you know how many cursors you want ahead of time is to
define them on the front panel using the cursor display. This display shows
two cursors by default and if you need more you can "gr
ow" it just like you
do an array. That's what it is anyway, an array of cursors. Of course, if
the number of cursors need to change at run-time then you need to use Greg's
appraoch.

Have Fun!
Scott Menjoulet
0 Kudos
Message 7 of 7
(4,032 Views)
Greg McKaskle wrote in message <37D3FC72.3187C0E6@austin.rr.com>...
>...
>
>Ah. Well I was also misunderstanding your problem. If you want to
programmatically
>define a new cursor, you need to use the Cursor List. Assuming you want
>to keep the
>current cursors, read the Cursor List, append a new element to it with
>all cursor
>settings however you want them, then write the Cursor List. Active
>Cursor will always
>pin to the currently valid cursors on the graph. It will never create
>new cursors.
>
>...
>Greg McKaskle

An even easier way if you know how many cursors you want ahead of time is to
define them on the front panel using the cursor display. This display shows
two cursors by default and if you need more you can "gr
ow" it just like you
do an array. That's what it is anyway, an array of cursors. Of course, if
the number of cursors need to change at run-time then you need to use Greg's
appraoch.

Have Fun!
Scott Menjoulet
0 Kudos
Message 6 of 7
(4,032 Views)