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: 

Simultaneus print on XY Graph of a function and a point

Hello to everybody, I've started from a while to work on Labview, but i've got a problem. 

I'd like to print on the same graph a function that I calculated inside a for case and at the same time the point which is calculated inside the for.

 

In pratice, the red point on the Phase Portrait should move while it's calculated.

 

Sorry for my english ^^'

 

this is the VI, if someone can help me i would be grateful.

 

0 Kudos
Message 1 of 11
(3,202 Views)

Hello,

 

In your code, you put the graph outside of the for loop and enabled auto indexing in the tunnel mode, which would cause the graph to start getting the points only after the loop has been completed the N iterations (100 in your case).

I didn’t understand exactly what you meant by: the point should be moving while it’s calculating…

I have put another XY Graph inside of the for loop and replace some array subsets…

Is it what you mean?

Point xy graph.jpg

Greetings and Regards,

James

Greetings and Regards,
James
0 Kudos
Message 2 of 11
(3,154 Views)

Here's a quick modification. Still needs cleanup 

0 Kudos
Message 3 of 11
(3,141 Views)

@JamesSouv wrote:

 

I have put another XY Graph inside of the for loop and replace some array subsets…

 


Wow, that's bad! Writing to a terminal and reading from a local variable of that same terminal (e.g. "appended array") in parallel is a prime example of a race condition caused by blatant overuse of local variables.

0 Kudos
Message 4 of 11
(3,140 Views)

Thank you for your answers! I'm a newbie in Labview and I still have to learn many things. But Thank You Again!

0 Kudos
Message 5 of 11
(3,129 Views)

Another Question .. If I wanna to plot in  the same XY graph again a function calculated outside of the for ? What can I do it ?

0 Kudos
Message 6 of 11
(3,126 Views)

Hello,

 

@Altenbach,

My code is not performant, I agree!

I used the provided template to show why the point was not moving.

As I mentioned before, the main problem was that the XY Graph was outside of the for loop.
But thanks for your precision.

 

@Marco,

Here are some useful tutorials highly recommended for newbies in LabVIEW

 

Have fun programming in LabVIEW.


NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

 

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

 

 

Greetings and Regards,
James
0 Kudos
Message 7 of 11
(3,121 Views)

Hello again,

To do multiple prints on your XY Graph, you could do following:

Pull down the Build Cluster Array function.

Add the (calculated array) function to the input of the Build Cluster Array function.
xy graph multiple plot.jpg

More information about Graphs and Charts are provided here.

Did it solve your problem so far?

Greetings,

James.

Greetings and Regards,
James
0 Kudos
Message 8 of 11
(3,112 Views)

Not at all .. probably I don't understanding how treat cluster and array in Labview .. This is my problem. I tried to implement the VI of altenbach (thank you again!) ma I must link the array of cluster (n.2 in the image) with the other array of cluster (n.1 in the image).

Separately the XY Graph plot both, but I don't be able to plot together, In the same Phase Portrait.

0 Kudos
Message 9 of 11
(3,107 Views)

You need to decide on a common structure for the plots. I was using complex while you were using clusters. I would recommend to use complex arrays for everything.

 

Your image is incomplete, so we cannot help much unless you attach the actual VI.

0 Kudos
Message 10 of 11
(3,081 Views)