06-29-2013 01:36 PM
Hello,
i am trying to write a new Xcontrol Element. In the data model I can create data types using the cluster to create compound types, eg an int and an int array. But how do I create an xcontrol which has multiple data inputs and outputs?
Kind Regards
06-29-2013 01:39 PM
The cluster route is the only way to go.
When you drop an XControl on the block diagram, it turns into a single input or output terminal. Because of this, XControls are restricted to a single datatype.
Why do you want multiple inputs/outputs? I can't think of a case where you'd want to do that. If you want to handle configuration or new actions, the best way to do it would be through building new XControl properties and/or methods.
06-29-2013 01:44 PM
Alright: I see: An xcontrol is either an input OR an output. How do I achieve an output? Secondly: So you are saying the only Elements that can have multiple inputs and outputs are VIs?
06-30-2013 01:54 AM - edited 06-30-2013 02:21 AM
@Limping_Twerp wrote:
Alright: I see: An xcontrol is either an input OR an output. How do I achieve an output? Secondly: So you are saying the only Elements that can have multiple inputs and outputs are VIs?
Can you take a few steps back and explain what you are actually trying to do. SubVIs and Xcontrols have nothing in common and it is not clear why you even try to compare them side by side (e.g. in terms of the number of connectors).
Your questions about input or output tell us that you seems to have some misconceptions about xcontrols. Xcontrols are like regular controls, except they have some built-in intelligence that you can program. Most front panel object can be either controls or indicators and the same is true for Xcontrol. You create an Xcontrol, and after placing it on the front panel you can decide if it should be a control (where the code reads the value) or an indicator (were the code writes values to it). When you define the xcontrol facade, you also need to program how the visuals change if it is changed from control to indicator or vice versa.
As a first step, you should opend the example finder and look at some xcontrol examples.
Again, what are you actually trying to do?
06-30-2013 04:39 AM
Thank you for this brief discussion of the subject. I will follow your advice regarding the examples. I have two goals:
1) Learning Labview and in this process test out its limits. I already am a developer with a decent amount of experience, but fairly new to graphical programming. I want to know what works and what doesn't work.
2) I am writing a control and measurement environment for a laser experiment, controlling multiple cameras and lasers and their respective logic. I found the idea interesting to design the labview "circuits" in a way so that the user control on the front panel is tethered to the logic on the block diagram - in the end, you should have a very intuitive and easy to grasp view of the programme's logic design. An example: Lets say I want to write the part of the program that configures the cameras. It will have buttons and controls on the front panel, and some logic in the block diagram. It works almost autarchical and that's why I try to have just one element of it on the block diagram with some outputs which I may use later in the program. So what I am trying to do is this: A subVI with some controls at the front end. Its purely cosmetic, really.
While answering bear in mind that I am new and just playing with ideas and testing out the possibilities.
Greetings