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: 

Problem with making plots visible

Hi All

   I'm trying to make a VI that will pull an array from a text file (previously written to), split it up and display each individual array on one plot and the average on another. This way I can get a sense for what each plot contributes to the overall average. The program works okay, but sort of spasms when it refreshes and seems to be a bit wonky. Any advice for improving this? I will be scaling it up later on too btw. I've attached a vi that is only that section of code so that everyone can run it. Thanks

 

Ian

 

P.S. "Matrix Size" and "reciprocal" are the two components missing that are in the newer version of LabView

0 Kudos
Message 1 of 11
(2,635 Views)

Hello,

 

I'm not very familiar with the technical term "wonky", so I don't exactly know what you mean with it.. 😉

 

I do see some things that could cause problems when refreshing your display:

- The property nodes that change your graph appearance are placed in parallel with the actual updating of the graph.

Do you see any difference if you change the properties before writing to the graphs?

- The clicking on the "individual" controls is done in parallel with your graphs

This could also cause some issues.

 

I could not test the code, but those are the things I would change at first sight.

 

Hope this helps!

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 2 of 11
(2,628 Views)

😕 didn't really do anything. From what I understand, everytime it runs through the loop it will refresh the plots, but rather than do it smoothly they sort of spasm and the plots don't really show up too well either.

0 Kudos
Message 3 of 11
(2,611 Views)

Hello Ian,

 

Can you show me a screenshot of how the Matrix size and Reciprocal functions should be wired in the diagram?

 

This way I can test your code and exactly reproduce the behavior and change your code depending on the behavior.

 

The description wonky is still a bit unclear for me. 😉

Do you mean that the scales change while updating?

Have you tried it with fixed scales?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 4 of 11
(2,599 Views)

ThiCop

   I really think it has something to do with the bounds...I think i'm getting closer to solving it.

0 Kudos
Message 5 of 11
(2,583 Views)

All

   The problem was that the property nodes that set the bounds were inside the loop. That's why it was freaking out.

 

However, I still can't figure out how to write it so I can turn the plots on and off (i.e. which plots are averaged together). I'd like to be able to check/uncheck each boolean and have the corresponding plot disregarded from the average, that way I can see what each one contributes to the overall average. I was very close, but the "build array" vi doesn't seem to work unless all inputs are satisfied, meaning I can't just turn one or two off because then the whole thing won't work. Thanks

 

Ian

0 Kudos
Message 6 of 11
(2,561 Views)

Hello Ian,

 

Here's a very simple example of how you can do this.

Please note that should wire the error clusters and that there are way better solutions.

 

I used a lot of Express VI's to illustrate how everything works.

The only tricky thing might be the selector input of the select signals Express VI, but LabVIEW Help should explain everything adequately.

 

If there are any questions, then just let me know.

 

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 7 of 11
(2,546 Views)

Thanks!

But I'm working with 2-D arrays, how can I turn these into a signal and plot it? I've tried the array to DDT conversion, but it doesn't seem to ever plot it correctly because the x-axis isn't time.

 

Thanks!

0 Kudos
Message 8 of 11
(2,534 Views)

Hello Ian,

 

Can you send me an example of the 2D arrays you're working with.

Which datatype is your 2D Array?

Which column represents your time axis in the 2D Array?

 

Can you provide me with a simple example of where it goes wrong?

This way I can further help you troubleshoot the issue.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 9 of 11
(2,526 Views)

I'm working with 2-D arrays of double. I read them from separate files. I changed up the VI so you don't need the files, and put in a representative array. I'd like it to display the original array as well as the averaged array, and I'd like the ability to switch certain plots on and off (ideally I'd be able to include multiple arrays). Thanks

 

Ian

0 Kudos
Message 10 of 11
(2,511 Views)