LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

No Data Change event generated for a XControl in a Type Def.

Hello,

Maybe I am missing something but the Data Change event of a XControl is not called when the XControl is used in a Type Def. or Strictly Type Def. (see the attached file).

There may be some logics behind it but it eludes me. Any idea of why or any idea of a workaround still keeping the Type Def. ?

Best Regards.
Julian

Windows XP SP2 & Windows Vista 64 - LV 8.5 & LV 8.5.1

0 Kudos
Message 1 of 8
(3,358 Views)
Does it have to be an XControl?
I replaced the XControl in the typedef with a numeric and a raised box and it worked fine.
I have no idea why the XControl wont update, seems like a bug to me...
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 2 of 8
(3,319 Views)
Hi Julian3,

Why do you want to put a XControl inside a typedef?

A XControl is  essentially a typedef with a block diagram. Just as you cannot edit an instance of a typedef, you cannot edit the instance of a XControl.
Also both instances of typedef and  XControl update when the source is modified.
0 Kudos
Message 3 of 8
(3,310 Views)

Hi TWGomez,

 

Thank you for addressing this issue. It must be a XControl because it carries many implemented functions/methods (though there is none in the provided example).

 

Also consider that the provided non-working example is in fact a reduction of my actual problem (in a 1000-VI large application) to the smallest relevant elements. In fact I use a  typedef of a mix of a lot of different XControls and normal controls, some of them being typedef, strictly typedef or normal controls and other XControls of XControls (of XControls...) in a object oriented like approach...

 

Hi Prashant,

 

I use a typedef to propagate its modifications automatically everywhere it is used in the application (a lot of places). As you imply a XControl would do the same, though one would like to construct a simple typedef when no additional functionality is wanted.

 

The remark "XControl=typedef+block diagram" is actually very neat (never thought of it that way) because it provides a workaround by transforming every typedef into a XControl. Thanks very much, I will explore this solution.

 

 

One issue remains: All normal controls update their displayed value when inserted into a typedef but not XControls. Data change event is not triggered. I known that XControls have some limitations (no array of XControls) but I would say, like TWGomez, that this is a “bug” considering the expected functionality.

 

0 Kudos
Message 4 of 8
(3,292 Views)
Hi Julian,

I agree with you that the behavior is strange. It would be interesting to know if this was a design decision or a bug.

I put some probes to see if the facade VI is actually called when the XControl is placed inside a typedef. The Facade VI is called but the Data change event is not triggered.
0 Kudos
Message 5 of 8
(3,285 Views)
Hi everybody.

I found another discussion related to your issues on NI Forums :
http://forums.ni.com/ni/board/message?board.id=170&message.id=311121&requireLogin=False

It may help you.

Regards,

Matthieu B.
Cordialement / Regards, Matthieu B. @ NI France.
0 Kudos
Message 6 of 8
(3,192 Views)

Hi Matthieu,

Indeed your link is about the Data Change event of XControls. What I find interesting is that your link is about situations in which the Data change event is unexpectedly triggered twice whereas this thread is about the Data change event not being triggered at all, not even once. 🙂

Thank you for this interesting link. Julian3.

0 Kudos
Message 7 of 8
(3,170 Views)

An XControl is not exactly "a typedef with with a block diagram". A Typedef supports the property "Callers' Names" (thought the help says it does not). An XControl does not have this property because it is a kind of a library.

The data changed event for XControls inside of a typedef is called in LabVIEW 8.2 but not in 8.5. Therefore I must replace the typedefs by the containing XControl. Some optimizing will not work thereafter. But the function is more imortant of course.
I would prefer to search my own bugs instead of those from LabVIEW...

Greetings,
shb

0 Kudos
Message 8 of 8
(3,140 Views)