LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xcontrol data type

I'm trying to change the data type of an XControl. When I try this, I get a message that says "Can't use XControl recursively".  I can change it to a built-in type, but when I try to change to a cluster or array of cluster, it doesn't work.
 
I opened the thermometer example and I am able to change the data type on that example by cutting and pasting to replace the data type for the control.  I can't do that on my control.
 
Thanks,
Bill F
0 Kudos
Message 1 of 4
(2,665 Views)
That should work just fine. How are you modifying the data type? Are you really editing the "Data" type definition?
 
It it possible that the cluster you are trying to use contains your x-control by mistake? (That would be a recursive use). 😉
 
0 Kudos
Message 2 of 4
(2,652 Views)
No, the xcontrol contains four booleans and the data type is a cluster of four Point controls.
 
Anyway, I deleted the whole thing and started over.  This time I was able to change the data type.  Now however, my Facade vi is broke because of incorrect data types for DataIn and DataOut.  Aren't these supposed to automatically update when you change the Datactl type?  Man, I guess I seriously don't get these xcontrols.
 
What I'm trying to do is allow a user to adjust the dimensions of a box drawn in a pic control.  I have four arrow booleans that when pressed, would cause the box dimension to adjust  in that direction.  So I thought this would be a good case for my first xcontrol.  The user presses the buttons, and the xcontrol code behind would figure out the new coords for the corners of the box (hence the cluster of Point ctls for the data type).  I even thought maybe if I could include a ref to the pic control, I could have the xcontrol redraw the box as well.
 
Am I even on the right track here?
 
Bill F
0 Kudos
Message 3 of 4
(2,638 Views)

Bill,

I think you're on the right track.  It's probably easiest to have the picture control inside of the XControl instead of having the XControl pass out coordinates to a picture control.  Just as a proof of concept I made a quick 5 minute XControl that does something similar to what you're trying to do.  My XControl contains a picture control with a dark rectangle in it.  By pressing the left and right buttons on the control you can change the position of the rectangle.  I've attached a zip of my simple project if you want to take a look at it and see what I did.

Hope this helps,
Justin D.
Applications Engineering
National Instruments

0 Kudos
Message 4 of 4
(2,622 Views)