LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XControls - datatype: can the data in differ than the data out?

I just recently started using XControls for a project and I am pretty happy with the results so far.   At this point, though, I think it would be helpful to have the 'Data In' be a different datatype than the 'Data Out'.  Is that weird?  Basically, if the Xcontrol was an indicator I want to pass different data to it than it would output as a control.  Let me know if I need to expand more on my question.  Any help is appreciated...

0 Kudos
Message 1 of 5
(2,530 Views)

Well you can resort to using a variant which can be anything you want.  Or have two XControls with two different data tyeps.  Other than that I don't think you can change the data type this easily. 

0 Kudos
Message 2 of 5
(2,524 Views)

I'm trying to think of a use case where this would be relevant and coming up blank. Can you give one or two examples?

 

I'm also trying to think of native controls which do this and none come to mind. Some can change their data type (representation for numerics, scalar or 1D array for listboxes, multiplot graphs, etc.), but that's a user configuration and I don't see how XControls would do that, as I believe the data type has to be static.

 

One thing you can do is create a property VI instead of the terminal. Then, that VI can have whichever data type you want. You would need a property node instead of the terminal, but it would work.


___________________
Try to take over the world!
Message 3 of 5
(2,518 Views)

So, originallyI was thinking about just using a property of the XControl to change the inputs, as I think you are suggesting.  I just thought it could be cool to change how the XControl works, if possible.  The use case I have is this:  The XControl is set as a recipe control for user input only.  The recipe data from the XControl is read out by application some time later.  Sometimes, though, I would like to change the strings[] within an enum inside the XControl to reflect some new recipe choices.  I thought it would be neat to do this by creating a different data input than the already used data output.  Anyway, thanks for the help.  I will probably just try to access the enum strings[] from a property...

Message 4 of 5
(2,511 Views)

@cycleguy wrote:

I just recently started using XControls for a project and I am pretty happy with the results so far.   At this point, though, I think it would be helpful to have the 'Data In' be a different datatype than the 'Data Out'.  Is that weird?  Basically, if the Xcontrol was an indicator I want to pass different data to it than it would output as a control.  Let me know if I need to expand more on my question.  Any help is appreciated...


Edit: Nevermind - I read your next post too late... I don't think I can delete my this post.

 

What you said is possible but only in certain situations (Hooovahh's suggestion is a much simpler way to accomplish what you want.)

 

If you simply want different data representation (DBL/I32/U16/etc) coming out of xcontrol depending on certain conditions, you can probably disconnect  "Data Out" from connector and place a numeric indicator with same name on the VI & connect it to the connector. Then make that numeric indicator "Adapt to Source" through right-click options.  But I get a feeling that you're not wanting to simply do that... (plus I would really discourage messing with typedef Data Out/etc as you'd break things if not careful, your datatype changes through typedef won't work any more.)

 

Are  you are wanting a completely different data type as the output?

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 5 of 5
(2,502 Views)