06-11-2020 11:18 AM
Hello,
I am using LabVIEW 2012 Student Edition and I am trying to write a VI that creates a new VI with imports some data from a text file and shows it in a chart. With the code in the photo #2 I am able to create a new VI with a chart and read the file, but when I use the code in the photo #1 I get the error "Specified objects cannot be wired together.". I am relatively new to LabVIEW and tried to follow the examples "Script Random Strip Chart with Diagram Cleanup" and "New VI Object - Location" but I was not able to get this VI working. How can I do this? Thanks
#1
#2
Solved! Go to Solution.
06-11-2020 01:36 PM
Well the error is coming up because you are trying to connect the waveform chart to itself (the terminal is the little nub that appears if you hover your mouse over the waveform chart on the block diagram). The wire source would be the thing you want to connect that terminal to (usually another terminal reference).
That being said, what exactly is your end goal here? I'm asking because VI scripting is usually not a topic you need to be concerned with if you're a newer developer and the task you have described doesn't really seem to fit the use case of VI scripting (although this could be a smaller portion of a larger project or just academic interest).
06-11-2020 03:07 PM
Thank you, so how could I get a terminal reference from the array in order to connect it to the chart?
This is a small part of a project a part of which is to create new a new VI for each data file to be read.
06-12-2020 08:23 AM - edited 06-12-2020 08:28 AM
I think I was able to create an array constant and wire it to the chart, but I don't know how to import the data from the file into that array constant
06-12-2020 08:43 AM
Use a Value property on another property node for the Array Constant.
06-12-2020 09:43 AM
It gives an error "The data type of the variant is not compatible with the data type wired to the type input."
06-12-2020 11:22 AM
What does the array constant look like once the script places it on the block diagram?
I'm wondering if it needs another property node to enable the dimensions of the array, or even the type of data.
You know, if you attached your VI instead of just a picture of it, it would enable us to play with it ourselves. 😉
06-12-2020 01:08 PM
Something strikes me as odd about this, but nonetheless I tend to give people what they want without dwelling on why.
This works just fine for me, and adapts to the datatype for 1D and 2D arrays that I tested. Add a BD cleanup or deal with the terminal positions as you desire.
Attached version saved for LV12
06-12-2020 03:05 PM - edited 06-12-2020 03:10 PM
@RavensFan
You're right, I should have attached it from the beginning. The files are:
06-12-2020 03:09 PM - edited 06-12-2020 03:12 PM
@Darin.K
Thank you, it works, can I ask you to explain me where is my mistake? 😅
Yes, it looks odd because almost certainly it is not the best solution for the problem (from a "main" VI I wanted to select a data txt file and open another window with a chart showing the data, and I wanted to be able to do this this for multiple data files, obtaining multiple windows, each one with the chart showing the data of the file for which it was launched).