05-04-2024 04:13 AM
Hello!
I am creating a program that allows you to plot multiple graphs on the same graph. I created a subVI that allows you to select the measurement range between two Y points and then create a new graph. I encounter a problem when I create a reference of my graph, I cannot connect it with my subVi. Thank you for your support.
Solved! Go to Solution.
05-04-2024 04:37 AM - edited 05-04-2024 04:41 AM
Please use "save for previous" (2020 or below) before attaching. I currently cannot look at your VIs.
From the "capture" image, you have giant race conditions due to blatant overuse of local variables. All your local variables will get read way before their indicators have received data, so the outcome is completely unpredictable. You can easily eliminate ALL locals by just branching the wires, guaranteeing that the execution order is correct.
Why are there terminals without labels and so (so!) many wire bends and hidden wires? Clean code would be much easier to handle.
I cannot tell from the image alone what the problem with the reference is.
05-04-2024 04:59 AM
Thank you for your suggestion I will modify
it here is the 2020 version
05-04-2024 05:21 AM
We are missing the toplevel (project.vi).
05-04-2024 06:09 AM
Sorry, here it is
05-04-2024 06:13 AM - edited 05-04-2024 06:21 AM
Most likely you created the reference before defining the datatype of the xy graph and now the datatype differs.
(XY graphs can have many datatypes (complex, cluster, points, etc.) and only after connecting the data to the terminal it will be defined. You need to change the control reference.
If you get the "value" in your subVI, you can see that it is a single cluster of xy arrays instead of an array of such clusters.
See if this can give you some ideas. I took the liberty to simplify a few things. Of course you probably want to expand it so the second graph adjust whenever the cursors change, by creating a proper state machine.
05-04-2024 06:26 AM
Thank you, it works really well and you simplified it very well.
05-04-2024 07:15 AM
This solution works but it's not exactly what I want to do because it doesn't take into account all the points. Here is the photo of the final result that I want to obtain. Thank you for your feedback.
05-04-2024 09:19 AM
It is because thresholding in your implementation only finds the first crossing point. If you want all data in the given Y range, you need to inspect every point. That's even easier!
05-04-2024 09:29 AM
That's absolutely correct. I don't see how else to do it.
If I create a cursor for each graph it complicates things further.