01-02-2014 05:43 PM - edited 01-02-2014 05:48 PM
Hi all,
I am writing an xcontrol to embed an array into it. But I found that the array doesn't really response to the mouse or other events if it is emed into an xcontrol, i.e. I can not expand the array by clicking and dragging the array to show more elements. Is that any way to let array support all those events?
p.s. I don't know why I cannot attach *.zip file so I change the extension of the zip to jpg. If you download the code, please change the extension from jpg to zip before unzip.
01-02-2014 05:54 PM - edited 01-02-2014 05:56 PM
Your facade.vi refers to a NonEmptyArray.xctl, which you did not include. Did you externally rename some files before zipping? There are probably other missing items.
01-02-2014 06:00 PM
@altenbach wrote:
Your facade.vi refers to a NonEmptyArray.xctl, which you did not include. Did you externally rename some files before zipping? There are probably other missing items.
The forum is pretty strange, it doesn't allow to upload the zip or rar format, I try many times. The first time I upload file with NonEmptyArray.xctl but the last time, I uplaod the new one. I don't know what's going on. But I upload the file again here.
01-02-2014 06:01 PM - edited 01-02-2014 06:05 PM
OK, renaming "MyArray.xctl" to "NonEmptyArray.xctl" seem to fix the loading problem.
You cannot directly resize an array at run time from the front panel. Make sure it is not reserved in a VI, else you cannot edit it.
You only have a filtering "key down?" event for the array. Seems quite limited functionality. What are you trying to do with all this?
01-02-2014 06:08 PM
@altenbach wrote:
OK, renaming "MyArray.xctl" to "NonEmptyArray.xctl" seem to fix the loading problem.
You cannot directly resize an array at run time from the front panel. Make sure it is not reserved in a VI, else you cannot edit it.
You only have a filtering "key down?" event for the array. Seems quite limited functionality. What are you trying to do with all this?
But I am not trying to resize it in run time, I am resizing it in edit mode. Anyway, I think the event won't pass to the array from control, that's might be the reason it won't work.
01-02-2014 06:17 PM
I can resize the array container just fine.
Can you explain what the xcontrol is supposed to do and how it should be used? What is the key down event supposed to do to the array? The "data" is a DBL scalar. How does the value of the array reflect the key action? You are not changing the value of the xcontrol and you never output a "data changed" state. It's not clear at all what you are trying to do.
01-02-2014 08:33 PM
@altenbach wrote:
I can resize the array container just fine.
Can you explain what the xcontrol is supposed to do and how it should be used? What is the key down event supposed to do to the array? The "data" is a DBL scalar. How does the value of the array reflect the key action? You are not changing the value of the xcontrol and you never output a "data changed" state. It's not clear at all what you are trying to do.
Hi altenbach,
It is requested by the client that they want an array container to hold at least one element of number. I am trying to implement that in xcontrol. I have no idea if it is possible to do so but I am trying to band the del key since I don't want user to delete the element of the array.
I wonder if you could resize the array container or resize the array in the container. What I am wondering is if I can resize the array in the container not the container itself. For example, in the following screenshot
The bottom array is the builtin array, I can click on the array and use money to expand it to show more elements. But in the top case, implemented in xcontrol, I can resize the containter but not the array.
Sorry that I just start xcontrol programming few days ago, I don't know will it change the behavior or not. But I just remove the key down event, I change the data type from DBL to array of DBL, and I set the "data changed" and "state changed" to true in "Display State Chnage" event. I didn't mean to implement the full function in the attached code, I just want to try if I can control (resize, changed dimension, etc.) the array in xcontrol like a regular array.
01-03-2014
02:53 PM
- last edited on
05-15-2025
05:25 PM
by
Content Cleaner
XControls have dynamic run-time and edit-time behavior. This is defined by VIs that run in the background. In other words, even though the VI that you are creating is in edit mode, the XControl is always running in the background. And you can not resize the array in run-time. It looks like you are trying to change the size of the array from the front panel of the VI that you are using to call the XControl. Instead you need to make sure that the Xcontrol is no reserved by any VI, and before you place the XControl in any VI, open the Facade.vi and you can change the size of the array from there.
Using XControls - LabVIEW 2012 Help
https://www.ni.com/docs/en-US/bundle/labview/page/using-xcontrols.html
William Fernández
Applications Engineer
National Instruments
01-04-2014
05:16 PM
- last edited on
05-15-2025
05:26 PM
by
Content Cleaner
@wfernand wrote:
XControls have dynamic run-time and edit-time behavior. This is defined by VIs that run in the background. In other words, even though the VI that you are creating is in edit mode, the XControl is always running in the background. And you can not resize the array in run-time. It looks like you are trying to change the size of the array from the front panel of the VI that you are using to call the XControl. Instead you need to make sure that the Xcontrol is no reserved by any VI, and before you place the XControl in any VI, open the Facade.vi and you can change the size of the array from there.
Using XControls - LabVIEW 2012 Help
https://www.ni.com/docs/en-US/bundle/labview/page/using-xcontrols.html
William Fernández
Applications Engineer
National Instruments
Thanks for the information. So does it mean it is not possible to implement customize array in XControl supporting resize in front panel (not in facade)?
01-04-2014 05:22 PM
Hi dragon,
you can use some property nodes to change the number of visible elements of an array, if that's all you need.
The only point is you need to program some logic to detect that user wish - easiest might be to place two additional buttons for in-/decreasing the number of elements...