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: 

XY Graph Endpoint

Hi everbody,

 

i have a following problem. As is evident from a pictures my last point in the chart is always connected to the first point of my chart.

What could i do to fix that problem ?

 

thx

pic0.png

pic1.png

pic2.png

 

0 Kudos
Message 1 of 8
(3,578 Views)

Hi grba,

 

at first: clean up your VI.

Next step: initialize the shift registers with arrays, which are initialized with a default value of NaN (instead of 0)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,562 Views)
It's hard to say exactly since you show so little code, but it looks like you are trying to preinitialize your data arrays but perhaps are not collecting enough data to overwrite all the initialization values. Where is the rest of your code?

Another problem is that you are overusing local variables. I can tell because I see one.

You should also get rid of the express VI. All you need is a cluster bundler.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 8
(3,558 Views)

Hi GerdW,

 

i'll take care of my code 🙂 . it's perfect. now all working fine. i have tried with Inf, -Ind but never with NaN 😞

Thanks for your tipp 

0 Kudos
Message 4 of 8
(3,548 Views)
...except it's not perfect, and it's not working fine. If it were you wouldn't have asked for help.

What NaN does is prevent a particular data point from being plotted.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 8
(3,545 Views)

Even without showing your code:   Put a probe at the XY graph input and look at the data (end of the arry) Somehow I'm pretty shure you will find some [0,0] left over...

 

Perfect code with a local variable 'Step' to size your array??  

Hidden wires ??

...

 

 

YMMD 😄    "my code is perfect"          run Tools-> VI Analyser  and learn!

 

 

And a RG I like ... convert to dynamic data, use express vi to pass data into a xy graph 🙂      have a look at the help about xy graph and the provides examples 

it's easy like this:

XY.png

 

Sorry ...   it's friday...

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 8
(3,522 Views)

Hi everyone,


 

thanks for your help! with your help i woud learn everything what i need.so i am very grateful for every tip or some critique. 

I send my code.


 

I have one question ? can i get the LabView code in C e.g Python ?.. or can i get linear code ? Thx

 


 

0 Kudos
Message 7 of 8
(3,478 Views)

Hi grba,

 

can i get the LabView code in C e.g Python ?

When you want C code you should create your programs using a text editor and a C compiler.

When you want Python code you should use the same text editor and a Python compiler…

 

As long as you use the LabVIEW IDE you get LabVIEW VIs and an executable!

 

or can i get linear code ?

What is "linear code"?

 

Your code uses way too much local variables…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(3,455 Views)