LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change the type of a network stream control?

Is there a way to change out the network stream type for a control?

Network stream type.PNG

For example, lets say I want to use a different type def for the above control.

0 Kudos
Message 1 of 10
(4,280 Views)

The Typedef for the Endpoint is set by the process of creating the Endpoint (the "data type" input).

 

Bob Schor

0 Kudos
Message 2 of 10
(4,239 Views)

So there's no way to switch typedefs after it's been created?

0 Kudos
Message 3 of 10
(4,197 Views)

I'm pretty sure that is correct -- creating a Network Stream EndPoint requires the TypeDef at creation time, similar to creating a Queue requires a TypeDef.  Once a Queue of I32s, for example, has been created, you cannot convert it to a Queue of Doubles ...

 

Bob Schor

0 Kudos
Message 4 of 10
(4,193 Views)

Ah, you can, however, make the TypeDef a Variant ...

 

BS

0 Kudos
Message 5 of 10
(4,187 Views)

@Bob_Schor wrote:

I'm pretty sure that is correct -- creating a Network Stream EndPoint requires the TypeDef at creation time, similar to creating a Queue requires a TypeDef.  Once a Queue of I32s, for example, has been created, you cannot convert it to a Queue of Doubles ...

 

Bob Schor


 

You can drop a double control into a queue control to change the type.

 

Changing Queue Control Type.PNG

0 Kudos
Message 6 of 10
(4,171 Views)

@Oligarlicky wrote:

@Bob_Schor wrote:

I'm pretty sure that is correct -- creating a Network Stream EndPoint requires the TypeDef at creation time, similar to creating a Queue requires a TypeDef.  Once a Queue of I32s, for example, has been created, you cannot convert it to a Queue of Doubles ...

 

Bob Schor


 

You can drop a double control into a queue control to change the type.

 

Changing Queue Control Type.PNG


You can create a Queue (or a Network EndPoint) of different types, but once created, you need to leave it that way -- you cannot modify it mid-program.

 

BS

0 Kudos
Message 7 of 10
(4,152 Views)

Are you talking about edit time?  Then yes, it's easy.  Wire a constant of whatever data type you want into the "data type" input.  That determines the data type of the stream.

 

If you mean during runtime, you'll need to take Bob's advice and use a Variant or a String and then use the variant and (un)flatten to string functions to get different data types through the stream.

0 Kudos
Message 8 of 10
(4,138 Views)

@natasftw wrote:

Are you talking about edit time?  Then yes, it's easy.  Wire a constant of whatever data type you want into the "data type" input.  That determines the data type of the stream.

 

If you mean during runtime, you'll need to take Bob's advice and use a Variant or a String and then use the variant and (un)flatten to string functions to get different data types through the stream.


None of the above. I'm not trying to change the data type riding on the wire using the polymorphism of create network stream, I have an exisiting control/indicator I'm trying to modify similar to how you'd modify the type of a queue control. I made an idea exchange describing what I want to do.

 

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Drop-control-into-network-stream-control-to-change-the...

0 Kudos
Message 9 of 10
(4,116 Views)

Ah, now I understand.  That's definitely "not necessary", since you will always get the correct Control/Indicator type from the output of the Create Network Stream (when you wire the "Type" input appropriately).  I must confess that I'd never created a "flexible Queue Control" the way you indicated (not the least because many of my Queues depend on a User-defined Type), but instead created them after I'd defined the Queue and could right-click the Queue output terminal and say "Create Control".

 

Bob Schor

0 Kudos
Message 10 of 10
(4,098 Views)