LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Quiztus2

Optional Channel Wire Control on the Connector Pane

Status: New

I like channel wires for obvious reasons. I like to have modules, which work on their own, coming with their own GUI. This is convenient for developing my modules and testing them. Afterwards I want to be free to insert this module into a bigger project, which takes control of my module.

The channel wire controls on the connector pane can be set optional, but LabVIEW throws an error, when executing a VI with not connected channel wire control. (All branches of a channel wire must be connected to a channel endpoint...)
Please make VIs working with not connected, optional channel wire controls on the connector pane. That way, we can have channel wire based modules, which can run on their own, as a single VI, or can be controlled remotely without any change.

Quiztus2_0-1707901224255.png

 

11 Comments
wiebe@CARYA
Knight of NI

Can you give a minimal nr of steps to reproduce this problem?

 

It seems to work just fine for my channel wire:

wiebeCARYA_0-1707907038705.png

The VI has an optional channel wire input, and it's caller isn't broken when it's not wired.

 

There seems to be more to it (maybe a specific channel wire type?).

Quiztus2
Active Participant

This is valid for at least Channel Template: Messenger

 

Create String Constant->Create->Channel Writer...->Template Messenger->Write

real module.png

Add this SubVI into another one->leave the channel control unconnected->hit run! -> Error

wiebe@CARYA
Knight of NI

Thanks, that I can reproduce.

 

I'm not into Channel Wires enough to tell if it's a bug or feature, and if it's a feature if it's (always or sometimes) useful or not.

IlluminatedG
Active Participant

Optional channel terminals would go against how the compiler makes them work (every terminal becomes an input control during compilation even if it's an indicator).

 

As a workaround you could make a "terminator" VI that can be used to wire to but it doesn't need to do anything in its BD that impacts the channel contents. And then use it when you have a terminal you don't need to actually do anything but need to satisfy the required wiring.

~ The wizard formerly known as DerrickB ~
Gradatim Ferociter
Quiztus2
Active Participant

As Wiebe showed there are channels types, which can be optional. With Terminator VI you mean a VI in which I insert the actual VI?

IlluminatedG
Active Participant

Channel being optional and not showing an edit time error sounds like a bug. As demonstrated an error gets generated when trying to run.

 

I just mean a VI that has the channel terminal as an input (or output) and calls something like a status method or other non-effect VI on the channel wire so that it's "terminated". I can make some examples later this evening.

~ The wizard formerly known as DerrickB ~
Gradatim Ferociter
wiebe@CARYA
Knight of NI

>As Wiebe showed there are channels types, which can be optional. With Terminator VI you mean a VI in which I insert the actual VI?

 

To be honest, I didn't try to run my example. The reproducible example only gave an error when the VI was run....

 

This seems to be behavior that is very specific to channel wires. Channel wires are different, but I don't see why you would be required to wire inputs. Usually, the programmer gets a say in that.

IlluminatedG
Active Participant

Not with channel wires. They do some voodoo during compilation to trace back to a root segment and insert some initialization code and then every terminal (even if it's an indicator output) gets treated as an input. It's why you can't wire straight through a structure.

 

And sry I totally forgot to make the terminator example.

~ The wizard formerly known as DerrickB ~
Gradatim Ferociter
IlluminatedG
Active Participant

Basically this should only be done when you understand the underlying channel wire mechanism and how they're implemented but for the messenger channel I was able to make a small VI like this:

IlluminatedG_0-1708980873913.png

When you have a channel wire implementation type, you can make a termination VI specifically for that data type and channel type combination. In this case, the probe action is a no-op within the channel and won't actually write anything in or read anything out. I forgot that the shipping channel wire types don't have a mechanism to make this easier than digging into some of the internals.

~ The wizard formerly known as DerrickB ~
Gradatim Ferociter
Quiztus2
Active Participant

This looks interesting. I can't test the 'Termination', since I don't have access to LabVIEW for some time. I don't see how I this makes an input optional, since the input terminal still would exist.

 

Would this make a VI executable by itself with a not connected Channel on its connector pane?