11-14-2013 06:38 AM
Thanks DFGray for this link. I'll check it out as soon as I find the time. For the sake of completeness I have attached my fully functional solution using tst's C/P-approach. Straight-forward, really. And a great fat lot of help when writing 30+ SubVIs a day.
PutSubVIdecor.vi is the actual QD Shortcut (letter k)
SubVIdecor.vi is the "source" VI containing the decorations I copy to the caller of QD. Put it in the parent folder of "plugins" - this is where I expect it to be.
Since the Move method is executable only when the VI, from where the moving/copying is done, is in edit mode, I could not think of any way to get the decor other than to put them in a different VI that's not running. Therefore the "auxiliary" SubVIdecor.vi...
EDIT: Found another option just now - https://decibel.ni.com/content/message/23285#23285 and the following post's sample VI should do that trick, provided my odd Text decor's reference is uniquely identifiable.
EDIT2: "Create from Reference" method is incompatible with Class "Decoration", so the hint in the 1st EDIT doesn't work.
05-20-2015 06:14 AM
Hi ,
I want to develop a VI which can generate another VI with the below FRONT PANEL and INPUT file can be either XLS or CSV or XML File.
This XLS we have generated using IPXACT XML.
Any Idea how should i proceed using Scripting or any other method.
Reason: why i want to do this?
My Xls or csv keep on changing , so everytime i need to update my VI Accordingly.To get rid of too much of repeatative work i want to automate that.
CSV
Existing FRONT PANEL
Thanks in advance!!!
Regards
Shweta
05-21-2015 12:54 AM
Hi,
Your images above are broken, I can't see them. However, from what I understood it sounds as though you need a typedef more than scripting. If you use a typedef'ed cluster instead of a regular one updating the typedef updates all the instances of the cluster in your code.
Good luck,
Danielle
05-21-2015 01:21 AM
Hi Danielle ,
Thanks for the reply.
I think in my previous post , My question is not fully described.
Lets Take with one example:
Below is the one register in my CSV ,there could be "N" number of Registers.
Reg Addr
R/W | rx_control | 00000000 | 000 | |||||
not used | 31 | 31 | : | 1 | 0000000000000000000000000000000 | |||
en_rx | 1 | 0 | : | 0 | 0 |
I want my front panel to be like this
That ,i have implemented in very first time of development.
Now,Specification got changed and it keeps on changing not only to one register but to multiple .
Reg addr | ||||||||
R/W | rx_control | 00000000 | 080 | |||||
not used | 27 | 31 | : | 5 | 000000000000000000000000000 | |||
en_rx_via_spi | 1 | 4 | : | 4 | 0 | |||
not used | 3 | 3 | : | 1 | 000 | |||
en_lna_via_spi | 1 | 0 | : | 0 | 0 |
Reg addr and all fields got changed ,again i need to do re work for my front panel.
I want to get rid of implementing it manually ,so i want that with xls or csv or XML as input, can i generate the font panel vi automatically using scripting?
If you could please help me out with this, it would be really appreciable .
Thanks & Regards
Shweta
05-26-2015 02:04 AM
Hi,
I'm sorry, this is out of my league I hope someone else can help you.
Thanks,
Danielle
05-28-2015 02:32 AM
I seem to be unable to understand exactly how the CSV is resembled by the front panel you posted. Could you please be a bit more specific how the text in the CSV relates to the element(s) in the front panel? Perhaps a direct comparison of the first CSV/Front Panel with the second CSV and the desired FP for that CSV? Just so it is clear which element of the CSV is to be held where and by which data type in the FP.
As it seems to me, the first answer is close to what you might need - a TypeDef will reflect changes in your data structure anywhere you use it, so you only have to change the TypeDef. Of course, this will very rarely go without changes in UI appearance...
07-08-2016 09:05 AM
Please could someone help me with DVR element replacement when creating the DVR from scratch. It only seems to work once the newly created DVR has been viewed as the control datatype at least once (defaults to icon view)
I think I posted my original question in the wrong place: https://decibel.ni.com/content/message/140782#140782
Thanks
07-08-2016 10:03 AM
I looked through all the private methods for the DataValRefNum control type, and I didn't see a way to view it as an icon, or control, which is a bit surprising. What I suggest is to save a DVR control as a CTL file which has been seen as a terminal or control, then perform a replace on the DVR you want replacing it with the CTL you have, and then you can replace the control inside it.
Attached is a quick demo that does this. Run the Replace DVR Demo, and it will take the VI provided, and replace all DVRs with the included controls, and then replace the control inside the DVR. A bit of a hack but it seems to work as long as you replace the DVR with the same view type. I used the control size to try to determine if the control was viewed as icon or control.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-10-2016 10:11 PM
If you create the original DVR with a call to VI->CreateFromDataType() then the element can be replaced:
Not sure why it is different.
07-11-2016 04:19 AM
Hooovahh
Thanks for the example. I hadn't thought of checking the control size to see which state it was in. I wonder if this information is available through a NI specific control tag. Shame they can't all be listed like the VI tags.
pauldavey
Thanks. That does exactly what I need.