LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

graph cursors update late

I'm trying to export an image of a graph with cursors to file. However, sometimes the cursor positions which are determined inside the program don't update before the image is stored to file. What is the the procedure for making sure the exported image always has the updated cursors on the plot?
 
Thanks,
Sam
0 Kudos
Message 1 of 18
(3,542 Views)

In the event my suggestions fail you, please post your code so we can look closer.

1) Check the sequencing of the operations performed on the graph to make sure that data dependacy dicatates the cursor actions occur before you get the image.

2) You did not mention how you are getting the image. Invoke node >>> Get image has been very effective in getting LV to update the image of objects.

3) Post LV 6.1 (?) the "Defer FP Updates" will force a screen update when set true AND false.

Like I said, if you want a good answer, post some 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 18
(3,527 Views)
Thanks for the reply,
 
I've tried the property note suggested to no avail. I've found that the problem only occures the first time the vi is called and only if the vi is being called without the front panel being opened. The problem is I am calling the vi that has the graph on the front panel from Teststand and I don't want to popup the front panel.
 
An example code is attached. Here Graph update main is playing the role of teststand.
Download All
0 Kudos
Message 3 of 18
(3,515 Views)

I cannot reporduce your problem, but still...

Also try this:

right-click on your graph and select "advanced...synchronous display".

 

0 Kudos
Message 4 of 18
(3,507 Views)
Thanks for the reply,
 
It seems like the combination of synchronous display and the poperty node "defer fp update" works on the simple vi, even when it is called from teststand!!
However the actual vi which does some work to produce the graph, and does excatly the same thing with the graph as the example vi, still doesn't update the cursor positions in the image when run from teststand on the first run only!
 
I'm attaching the code, however it won't run because of missing vis

Message Edited by sadeghi on 02-28-2007 06:45 PM

0 Kudos
Message 5 of 18
(3,508 Views)
Have you tried to just insert a small delay before getting the image?
 
Also note that there is no data dependency between drawing the graph and getting the image so there is a chance that the picture is taken before the data shows.  You code does not guarantee that the data shows on the graph, but apparently this is not the problem. For safety, you should still make sure to sequence things properly, e.g. as in this image.
 
 
I am not sure if it would make a difference, but how about running this Vi in the UI thread?

Message Edited by altenbach on 02-28-2007 05:52 PM

Message 6 of 18
(3,497 Views)
I suggest adjusting your data flow to ensure the data is in the graph before you start doing with the settings etc.
 
In the code you posted, there is no guarantee the graph have anything in it the first time it runs. Put the graph in a seq frame so that the graph get data before the other things happen.
 
Ben
 
PS: I knew I was looking athis Q to long! I bow to you sir.

Message Edited by Ben on 02-28-2007 07:52 PM

Message Edited by Ben on 02-28-2007 07:54 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 18
(3,496 Views)
Ben, for some reason I'm faster. 😄
Message 8 of 18
(3,490 Views)

Many thanks for your suggestions. I had tried sequencing the graph by sending the data wire to the for loop where cursor positions are determined and adding a 0.5s delay before the image export, but they didn't help, so I took them out. It seems like my problem is particular to my system, so I'll try looking at it later.

By the way would passing the graph wire to the loop always make sure the graph is updated before the operation in the loop take place or is it better to place the graph indicator inside a sequence frame? And does it make any difference whether the graph data is sequenced first or the settings?

 

0 Kudos
Message 9 of 18
(3,480 Views)

Put he graph in a seq as Christian illustrated and make sure it happens before any of the other properties are applied.

Post an update of your code after you mod it, in the event the issue remains.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 18
(3,466 Views)