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.
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.
04-15-2005 10:47 AM
04-15-2005 12:31 PM
@Dennis Knutson wrote:
Need to see the new subVI. I do see that you're not passing a VISA Resource Name to the subVI. Unless you've set the default to be a valid com port, when called as a subVI the resource name may be empty.
p.s. You don't have to do separate posts to attach multiple files. The easiest thing to do is to create an llb with the main VI and all subVIs. Do this by selecting Save with Options>Development Distribution. You can also edit a post and attach a second or third file. The edit post is available from the Options button.
04-15-2005 01:11 PM
04-15-2005 04:29 PM
@Dennis Knutson wrote:
You're writing to com4. Are you sure that's the port you want? You should also use the error out connections of the subVI. If the subVI works standalone but not being called as a subVI, any errors you get might help to identify the problem.
04-15-2005 04:42 PM
04-15-2005 04:47 PM
@Dennis Knutson wrote:
Changing the resource name to com 1 in the subVI before you run the main does nothing. When the main calls the subVI, it passes the parameters it has to the subVI. Any input (with or without wired to the connector) that does not have a value wired to it in the main VI will be set to it's default value. The thing you should do is wire the resource name to the connector pane of the subVI and then explicitly wire a constant of Com1 to it in the main VI.
04-15-2005 05:04 PM
04-15-2005 05:39 PM
@Dennis Knutson wrote:
Here it is. It's not as neat as I would like but it should work a lot better.
04-18-2005 08:44 AM
04-18-2005 09:17 AM
@Shawn B. wrote:
Aurelia,
I made a quick change to the VI from what you posted, which may solve your problem. I think it is important to first explain how sub VIs work. A sub VI takes the data you pass into it, manipulates it or performs an action, and often outputs data back into LabVIEW. The sub VI will always use the data that was passed into it through its inputs. If there is nothing wired to the input it will use its default value. The default value can be changed by opening the sub VI, changing the value of the control, selecting Operate>>Make Current Values Default, and saving the sub VI.
It is important to understand this because you shouldn't ever have to open a sub VI and make changes before you run your program if it has been designed right. Changing the resource name to COM1, and the pump number to 00 inside the sub VI does nothing because both of these inputs were already receiving inputs from your main VI. If they are the wrong inputs then your main VI should be changed to pass the correct values to your sub VI.
Since you say the sub VI works by itself with COM1 and 00 as the pump number, I made a quick change to the way the pump number was formatted. Now if you set "#pumps" to 1 it will write to pump 00.
Shawn B.
National Instruments