LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with setting cursor coordinates in intensity graph, Labview 6.1

Hello,

the following problem with setting the cursor in an intensity graph
occurs:

I have to switch between different arrays shown in the graph. While
switching the arrays, the cursor should stay at the same point, as
close as possible. The problem is, that the arrays may not fill the
whole grpah, but can be subsets of the whole graph. To try to be more
clear:

The whole graph can show an 128x128 array. Sometimes I want to show
only a subset, e.g. a 32x32 array that starts at 16,48.

This I can achieve by using the properties XScale.Offset and
YScale.Offset. So far, this is working.

Additionally, sometimes I have arrays where columns are missing,
e.g. I have only every other or ever third column to show. This I can
achieve using the property XScale.Multiplier. So far, this is working,
too.

Now to the point. The cursor must be locked, so that the user cannot
move the cursor outside the plot if I show only a subset of the whole
array. Therefore I use the properties Cursor.Index and Cursor.Plot to
set the cursor positions, as mentioned on the NI page and in articles
in this group.

And here the problem arises. If I first show an array that has only
every third column (i.e. XScale.Multiplier=3) and then switch to an
array that has every column (i.e. XScale.Multiplier=3) then the cursor
is set only in a correct way if the Index is 42 or below, which means
less than a third of the whole array. If the Index is 45 or above the
cursor jumps to 0,0 upon switching to the array that has every column.

If I first have an array that has only every other column
(i.e. XScale.Multiplier=2) then the erratic beaviour occurs if Index
is 64 or above, so it seems to be directly connected to the value
of XScale.Multiplier...

The extremely strange point is that, if I read Plot and Index directly
after setting them, I get the correct values.

I may note that I do not set everything at the same time. After
gettign the first errors, I decided to break it up into several parts.
I have four property nodes, serialized by an error wire.

First I set ActCrsr, XScale.Offset, YScale.Offset and
XScale.Multiplier

Then I set XScale.Range and YScale.Range. This is necessary after
changing XScal.Mulitplier, otherwise the range is also multiplied.

Then I set Cursor.Plot and Cursor.Index

Then I read Cursor.Plot and Cursor.Index, which gives me ALWAYS the
correct result, even if the Cursor is not set correctly.

Does anybody know how to deal with that?


Best regards

Armin Lambacher
0 Kudos
Message 1 of 4
(2,565 Views)
Hi Armin,

This is an interesting issue.

Could you post a small example that demonstates this behavour?

It sound like it could be subtle issue of timining and the order of your actions. I may be able to help if I could your code.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,565 Views)
First, thank you for your answer, I'm a bit late with my reply because
I was out of office for 10 days...

Ben writes:

> This is an interesting issue.

Hmm, for me it was more annoying that interesting...

>
> Could you post a small example that demonstates this behavour?

Meanwhile I found a workaround for the problem. If you follow this
order, it works:

1) set XScale.Offset, YScale.Offset and XScale.Mulitplier
2) set XScale.Range, YScale.Range
3) write the data into the graph
4) set Cursor.Index and Cursor.Plot

>
> It sound like it could be subtle issue of timining and the order of
> your actions. I may be able to help if I could your code.

Yes, as you assumed, it is an issue of the order of the
actions. Meanwhile I have a worki
ng example. It is 274KByte. Is it ok
to post it here or is this to large?

Best regards

Armin
0 Kudos
Message 3 of 4
(2,565 Views)
Ah yes, there must be a plot for you to be able to change its properties.

I have posted 1Meg attachments and larger files can be posted with the web-masters help.

Posting your solution could help others that run into this issue at a latte date.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(2,565 Views)