LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Scripting Main Board

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.

Download All
0 Kudos
Message 151 of 171
(2,666 Views)

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.PNGCSV

FrontPanel.PNG  Existing FRONT PANEL

Thanks in advance!!!

Regards

Shweta

0 Kudos
Message 152 of 171
(2,666 Views)

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

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 153 of 171
(2,666 Views)

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/Wrx_control




00000000000


not used3131:10000000000000000000000000000000


en_rx10:00

I want my front panel to be like this

1.PNG

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/Wrx_control




00000000080


not used2731:5000000000000000000000000000


en_rx_via_spi14:40


not used33:1000


en_lna_via_spi10:00

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

0 Kudos
Message 154 of 171
(2,666 Views)

Hi,

I'm sorry, this is out of my league I hope someone else can help you.

Thanks,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 155 of 171
(2,666 Views)

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...

0 Kudos
Message 156 of 171
(2,666 Views)

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



Using LV2018 32 bit

Highly recommended open source screen capture software (useful for bug reports).

https://getsharex.com/
0 Kudos
Message 157 of 171
(2,666 Views)

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.

Message 158 of 171
(2,666 Views)

If you create the original DVR with a call to VI->CreateFromDataType() then the element can be replaced:

CreateandChangeDVR.png

Not sure why it is different.

Message 159 of 171
(2,666 Views)

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.



Using LV2018 32 bit

Highly recommended open source screen capture software (useful for bug reports).

https://getsharex.com/
0 Kudos
Message 160 of 171
(2,666 Views)