11-04-2024 11:08 AM
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???
11-04-2024 11:19 AM
Sorry, this is completely crazy. I can't deal with this.
Can you take a step back and create a simple VI that simulates typical data?
11-04-2024 11:20 AM
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).
11-04-2024 11:33 AM
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...
11-04-2024 12:01 PM
@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!
11-04-2024 12:11 PM - edited 11-04-2024 12:15 PM
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.
11-04-2024 01:24 PM
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.
11-04-2024 01:28 PM
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?
11-04-2024 01:40 PM
Marcos aqui vao algumas dicas de programacao em LabVIEW pro seu conhecimento:
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.
11-04-2024 03:22 PM
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.