08-16-2022 09:40 AM
Hello,
I am working on a project and want to reuse the VI attached.
However, the problem is that the ROW and COLUMN are constants. Is there a way to make these variables so I can assign values to them in the top level VI?
Thanks
Rich
Solved! Go to Solution.
08-16-2022 01:32 PM
Can you use File -> Save for Previous and save it in, say, 2018? A lot of people don't have LV 2021 yet.
08-16-2022 10:07 PM
You need to learn a little more LabVIEW. Do you know about "Clusters", the method of grouping various data elements into a (usually named) group, similar to a Pascal "Record" or a C/C++ "Struct"? The Cluster constant "MS Office Properties" is, indeed, a Constant, which you need because it defines the Cluster. Do you know about the "Bundle by Name" function, which takes a Cluster (Constant or variable) and "exposes" elements that let you "redefine" (or "input") your own values? Here's what it looks like (from your example):
As you can see, I "broke" the wire from the MS Office Parameters cluster (the structure on the top right of the Snippet) and wired it into a Bundle-by-Name Cluster function. The first element originally said "position (Excel)", but I clicked on it and chose to expand it (it was also a Cluster) and show its elements called "row" and "column". I then wired my own variables (imaginatively-named "My Row" and "My Column"). When you run this, now, the code will use the values you choose for My Row and My Column to replace the "5" and "1" shown in the original Cluster. Incidentally, I think (5, 1) corresponds to Cell B6 (rows are numbered, columns are lettered, and the first "index" is 0, not 1).
Bob Schor
P.S. -- I never use the "Append Report" functions; I find the "Easy Report" versions much "easier" (and more flexible) to use. I posted a "Revised Excel Report Example" here on the Forums about 8 years ago -- you can find it easily if you search, starting with the word "Revised" that may prove useful.
08-17-2022 02:48 AM
Hi Bob,
Yes I am still quite new with GCode but I've dabbled with Python in the past so fortunately I am familiar with structures and your solution has triggered exactly what I needed to see! I'll also take a look at 'easy report' and your example. I have seen the bundle function used in a few tutorials but I've never used it.
I will try and get it working using both methods, but if the 'easy report' is nicer to use I will go down that path.
Thanks
Richard