LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A silly question about Gaph XY

Did you look at your zip file? Your modified files are scattered all over your computer and for example your zero comparison is saved in the program files hierarchy of the installation. Other files are in your downloads folder! Ultimately, you probably need to reset your windows and start from scratch. This is madness!

 


@MarcusP. wrote:

The reason I use a VI for this is that I wanted to use it in multiple places and needed a way to differentiate them, so I created a VI to help keep things organized for myself.

"


I guess I don't understand the meaning of "differentiate them" Why, if they are all the same???

 

 

0 Kudos
Message 11 of 24
(499 Views)

Sorry, this is completely crazy. I can't deal with this.

 

  • Why are you configuring the serial port with every single iteration of the inner loop???
  • What's the point of the outer loop?
  • What are the sizes of the x and y arrays? Y seems to be zero length sometimes.
  • Are you sure that feedback node has purpose or did it get inserted automatically because you created a circular dependency?

Can you take a step back and create a simple VI that simulates typical data?

0 Kudos
Message 12 of 24
(493 Views)

Ok, I didn’t see the mess before, but now I think it’s good to go



@MarcusP. wrote:

The reason I use a VI for this is that I wanted to use it in multiple places and needed a way to differentiate them, so I created a VI to help keep things organized for myself.

"


I guess I don't understand the meaning of "differentiate them" Why, if they are all the same???

 


Just because I’m a bit of a confused person! Sometimes I make things that don’t make sense to others (but they made sense to me at the time).

0 Kudos
Message 13 of 24
(492 Views)

Ok, I’ll do my best to respond.

 


 

  • Why are you configuring the serial port with every single iteration of the inner loop???

To be honest, I didn’t even notice the serial configuration was inside the loop—definitely better to take it out.

 

  • What's the point of the outer loop?

As for the outer loop, the idea was to allow multiple tests, so I could collect more information. In this example, it may not make much sense since I trimmed the code to make it easier to post here (and it’s still complicated, I know!).


  • What are the sizes of the x and y arrays? Y seems to be zero length sometimes.

The array size depends entirely on how long the test lasts. If it runs for 1 minute, there should be around 300 or more points on the graph. It resets to zero in some cases just to clear the data for a new graph.

 

  • Are you sure that feedback node has purpose or did it get inserted automatically because you created a circular dependency?

Sorry, this one I just dont know, but I think I get it automatically, because i dont remember to put it in there 

 


Can you take a step back and create a simple VI that simulates typical data?


This was the simple vi...

 

0 Kudos
Message 14 of 24
(489 Views)

@MarcusP. wrote:

The array size depends entirely on how long the test lasts. If it runs for 1 minute, there should be around 300 or more points on the graph. It resets to zero in some cases just to clear the data for a new graph.


Your graph only shows what's in the wire. Does that mean your VI stalls for minutes waiting for 100seconds worth of points. I don't get it! Your acquisition loop in the subVI runs for one iteration, trying to read exactly 1000 data points while to loop stalls dues to the wait before returning. If the case structure on the caller is TRUE, you try to do the same twice in parallel with a non-reentrant subVI and the one in the inner loop will stall for 6000ms/995minutes! really?

 

Dividing 6000 by acquisition minutes to get a ms wait does not make any sense!

 

0 Kudos
Message 15 of 24
(474 Views)

Thank you for the detailed response!

I appreciate it, and I see where some things might be unclear.

To clarify, my goal is for the VI to capture 1000 data points per test, and I assumed dividing by acquisition minutes would help set the timing. I think I might be overcomplicating things, especially with the Wait in the inner loop and running the subVI in parallel. I didn’t realize this could cause such a delay in execution—thanks for pointing it out!

And as for "trying to do the same twice in parallel," it’s because I receive data from two sources—one from an extensometer and the other from the Traction machine.

I’m still not entirely clear on the stalling issue with the non-reentrant subVI and why it waits 6000ms/995 minutes. Could you explain a bit more about how that’s affecting the loop timing?

Thanks again for the help; I want to make sure I fully understand this to avoid similar issues in the future.

0 Kudos
Message 16 of 24
(472 Views)

You wired wait has nothing to do with the acquisition timing and just stalls the loop in the subVI. The wait is in parallel to the serial read, and whatever takes longer determines the time it takes to complete that one-iteration while loop.

 

Your serial subVI is not reentrant so it can only be used in sequence, one diagram location at a time. If it communicates with one instrument, the other instrument must wait.

0 Kudos
Message 17 of 24
(450 Views)

Wait, so even if they are connected to 2 different COM ports, I can’t read them simultaneously?

If that’s the case, then I might have to rethink everything…

Is there anything I can do to read both and display them on the graph? Maybe using two clusters at the same time, or some other approach?

0 Kudos
Message 18 of 24
(445 Views)

Marcos aqui vao algumas dicas de programacao em LabVIEW pro seu conhecimento: 

LVNinja_5-1730748571462.png

 

LVNinja_4-1730748537300.png

 

 

LVNinja_6-1730748605007.pngLVNinja_7-1730748639111.png

 

 

The serial commands are not running in parallel. as you are running on the same while loop, one runs after the other. 

If you want them to run in paralle, then you need to place then in separated loops (then you need o synchronize them ). I will assume that they are running at the same rate. I guess your XY graph is looking weird because you need to synchronize the data sources to read one point at a time when ploting XY graph. 

LVNinja_8-1730749046449.png

 

 

 

 

Message 19 of 24
(442 Views)

Your two subvi instances can only run in parallel if you make it reentrant. This will still not solve your main problem!

 

You really need to rearchitect your top-level from the ground up. Everything else is just duct tape.

0 Kudos
Message 20 of 24
(427 Views)