From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

show connector sub vi connections

I have a vi that I plan on using as a sub vi in a larger program.  The problem arises when I select show connector to connect things from the front panel.  The connector panel comes up as one big square and only allows me to connect one variable, I have a total of 14 I would like to connect.  I have attached a copy of the program.
 
Thanks in advance.

Message Edited by MeCoOp on 07-19-2005 03:48 PM

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 1 of 12
(3,065 Views)
Right-click on the connector and select "patterns". Pick any pattern you like 🙂
Message 2 of 12
(3,056 Views)
In the same set of menus (right click) you can change the pattern for more inputs.
 
 
Message 3 of 12
(3,056 Views)
Thats why I love you guys...lol...Thanks!!
LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 4 of 12
(3,050 Views)
I was looking at your code and there are a few things you might want to consider:
 
1. In the bit where you are assembling the file name for your output. There are better ways of accomplishing it that make it far easier to read. The attached file is a picture of code that performs the same function as what you had, but is much more readable.
 
2. You have a lot of opportunities for errors in you code that aren't going to get reported. You have three distinct error paths (four if you count the file IO that's sort of floating out in mid-air by itself), but only one gets reported out. In additon there is no error io on the subvi so errors will never get reported to the VI calling this one.
 
3. The bottom FP read uses the array read, but only gets one value. Why not use the single point read?
 
4.  Why do you need 14 terminals? Looks to me like you need three. An error in, an error out and a cluster with 14 items in it (which, by the way, you are already building... create a typedef to define the cluster and you're done.).
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 12
(3,036 Views)
Hello,

in addition to mikeporters comment:

1) its even much easier to format a date/time string...


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(3,026 Views)
Yes, that is the best way of managing a name that is based completely on timestamp data and I considered implementing it in that way. However, I am trying to demonstrate a larger issue: how to format large complex strings in general. The point is that from the standpoint of readability it's almost always better to use a large single string formatter than a string concatenator pasting together dozens of short bits of string data.
 
Also, say that tommorrow he decides that the preamble part of the file name (the "Cscan" part) needs to be able to change. He would have a couple options with your code. First, he could take the preamble part out of the formatting string and use a string concatenator to append it back on after that date part is formatted--in which case he's sliding back into the old way of doing things. Second, he could assume that this is a neat idea but it only works in situations where there is exclusively dates involved and go back to building the string his old way because this is a "special case".
 
Or to make matters worse, what if for some reason, they decided that they wanted a text string inserted in the middle of the date-generated part. Now you're talking about perhaps a lot of extra code.
 
By contrast, the basic method I showed will work regardless of what kind of data he wants to add into the string, or the order that it has to appear. For example, to compensate for the change in preamble string would simply mean stretching the formatter up to create one new input terminal and replacing the "Cscan" in the formatting string with a "%s". The technique is more generalized so no additional code is required to support new "special cases". For example, this technique is also a great way of putting together long prompt strings because it makes it easy to visualize what the block of text will look like when all the blanks are filled in.
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 7 of 12
(3,017 Views)
Hello mikeporter,

I did not wanted to offend you...

I just wanted to point out that there is a function to get a formatted date/time string, as I have seen a lot of code (at work and here in the forum) that just does this (format date/time to string) in a very "complicated" way. And all you need (in most cases) is just a format string and this function...


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(3,013 Views)
Hey no offense taken GW--hope none was given;
 
I just wanted to explain that in this situation (as in a lot of things with LV) thinking ahead a bit and looking for a generalized solution can save you a lot of time and heartache down the road. Plus, a very valuable skill for a new developer to have is the ability to evaluate the competative pros and cons of different approaches to the same problem. For example, I use the technique you showed a lot when formatting timestamp data for insertion into a database, or a time/date indicator on a front panel. Because in both of those situations the generality of the approach I presented is unneeded and so becomes an unjustified complication.
 
I have always found that good LV work is 99% mental.
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 9 of 12
(3,009 Views)
While we are on the subject if I wanted to keep the file save nomenclature but wanted to enable the user to change the file save directory how could I go about doing that without going into the block diagram and changing it there?
LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 10 of 12
(2,993 Views)