Our online shopping is experiencing intermittent service disruptions.

Support teams are actively working on the resolution.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to update all "strict type def" component?

 

Hi ,all :

 

I have using a "strict type def" (my.ctl) in a labview app, and sometime later I change the pictures in the my.ctl file and some strings associate with it, How do I update all the feel & look in the VIs that using this control?

 

Thanks all!

0 Kudos
Message 1 of 11
(3,196 Views)

Hai,

When the control is strict type def then all the controls derived from that ctl are updated automatically when the parent control is changed.  But what ever you said in the message contradicts with the actual behaviour of strict type def. Can you post with some more details?

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 2 of 11
(3,193 Views)

Not necessarily so...

 

Check your individual instances of the Strict Typedef Ctl whether "Auto-Update from Type Def" option in teh rt-click short-cut menu is checked. Then only it will work appropriately.

- Partha ( CLD until Oct 2024 🙂 )
Message 3 of 11
(3,171 Views)

It seems that after change my.ctl's type from "Control" to "strict type def", the modification to my.ctl is updated automatically.

 

 sorry to post this simple question, i am using the VMIC 5565 example to develop a PCI driver for AMCC S5933, the original ctl file i created is of type "control", and could not update for all instances in VIs, I thought that I change the type of ctl from "control" to "strict type def" in my.ctl would result in changes of all instances,  but it is not, you need to delete and re-insert the my.ctl to take effect.

 

0 Kudos
Message 4 of 11
(3,156 Views)

If I follw you correctly, then that is proper behaviour.

 

 

THe control instance's type you drop on a FP is determined by what it was when you dropped it. If you gothrough your app and replace all occurneces of the non-type-def'd with the type-def'd version, THEN all updates will be applied when the type-definition is updated. Note: cosmetic changes are not applied to constants on the diagram.

 

If you have not so already I would recomend you review my Nugget on Type-defintions here.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 11
(3,146 Views)

Thanks for the replay and the nugget, I am using the "type def" the same way in the VMIC 5565 code example: using type def in place of refnum variants. It is easy to add attributes to variant and passing it through VIs and you can configure the icons to make it more beautiful.

 

BTW: will labview include the real typedef feature as C? like this

struct my {

union {

unsigned int frame : 1;

unsigned int crc : 1;

unsigned int distance : 15;

unsigned int azimuth : 15;

};

unsigned long int padding;

};

 

typedef struct my VAR;

 

the User could simply type the C code above (like the mathscript) and the typedef.ctl will be generated automaticall, and could be specified the terminals just like subVI do.

 

I have search the site and found a link to "U32 split bits" thread, the proper way is to use MASKs and bitwise AND to  take the desired bits part out, but the typedef suggestions may be an alternated way.

 

 

0 Kudos
Message 6 of 11
(3,133 Views)

I believe that is called  a "sparse enum" and this thread (and its links) are the best I can do to help.

 

LV does not allow you to specify sparse enums but will let you use them.

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 11
(3,124 Views)
You also can't define unions in LabVIEW. Smiley Wink
Message 8 of 11
(3,118 Views)

Kudos! (for recovering from my mistake. "I used to "C" but now I "G". Can you tell?)

 

Ben

Message Edited by Ben on 09-08-2008 09:38 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 11
(3,116 Views)

Thanks for the replies. Forgive for my broken English, I may not have express the question clearly in the first place.

"type def" really have the power of encapsulate all the data in one component, that's why I always *try to* compare it with C's struct.

in the AMCC driver project, I have successively using "type def" component as refnum variant and using it to link functional parts such as

open, dma_en, dma_read, dma_close, etc...

 

now it comes to the data that need to be transfer to and read from dma, I want to use "type def" to represent more complicated data,

which I have easily represented in C and using frequently in the old driver of AMCC (ya, forgot to tell you, it is insane to port a working but plain looking 

C driver to labview, especially when you are using DMA interrupt features and for the first time develop a DMA interrupt routine in labview. System lockup and restart are so common that almost drive me crazy)

 

a typical C structure is 

 

union u32_0 {

struct {

unsigned short int frame : 1;

unsigned short int num : 4;

unsigned short int code : 4;

};

unsigned long int padding;

};

 

union u32_1 {

struct {

unsigned int temperature : 16;

unsigned int bear : 16;

};

unsinged long int padding;

};

 

struct house {

union u32_0 : u0;

union u32_1 : u1;

};

 

typedef struct house HOUSE;

 

hope you will understanding the C code 🙂

 

now, what i want is to use "type def" ctls as easy as i use HOUSE in C, just put the CTL in front panel and change it to control will act as a sequence of input to a processing block or put CTL directly as a indicator, with pin node just like a de-cluster and cluster.

 

i am new to labview(3weeks) and want to make my code (although you call it data-flow in Labview) clean and tidy in C, as a mature programming env, labview should have the capability doing these task, it puzzled me a lot, and... I even couldn't find the constant I/O of VISA refnum in the palette, which was used in the type pin of variant to data convert component 😞 ...

 

after ask the almost no-need-to-answer question in the first thread, I search this forum and zone, found many things, with great usefulness for a beginner.

search before you ask is a special(useful) feature in this forum.

Thanks all all the same! L!

0 Kudos
Message 10 of 11
(3,079 Views)