11-13-2009 03:21 PM
Quick few questions about the Event Structure (if there is info on the Event Structure could you post a link):
Q1:See my attached jpg. How do I get the Tab Control local variable ("Profile TC (Meter Display)") and its constant to execute before the enqueue element? There are no error terminals I could use on the Tab Control to control it that way .... didn't want to get into anykind of overhead using a sequence (would this be overhead?).
Q2:What's the purpose of using the "convert to varient" for the input into the "enqueue element"? Would a "constant" bundled along with the type def case enum bejust as sufficient?
Q3:What are the purposes of the "Source, Type, Time, Ctl Ref, Old Value, New Value" aspects of the Event Structure? Does it just transfer the occurring events value out? Where would these come into advantageous use? What's the difference between "Old Value" and "New Value"
Thanks a bunch.
11-13-2009 04:16 PM
Q1: one of the situations where you actually should use a flat sequence.
Q2: If it works without the "convert to varian", then LV is automagically inserting that for you. So doesn't matter at all.
Q3: Take a look in the help, this gives you all the info you need. New/Old is of interest in the value change event, new is the one after the change and old is the one before the change.
Felix
11-13-2009 06:07 PM
Q1: why does execution order matter in this case? If you only write to the tab local to switch the visible tab then this "race condition" doesn't hurt.
Q2 (in addition to Felix): if the question is why use variant then I think because it can be used to send any kind of data. If the displayed event is triggered when the boolean switches to true or to false then obviously a constant can't replace the actual value.
Daniel
11-13-2009 06:28 PM
Q1: I agree with Daniel. Execution order here is irrelevant, because both code segments execute nearly instantaneously and the user would not notice a difference.
Q2: You should always wire the datatype that the queue expects. This is defined in "obtain queue".
Q3: The event terminals offer useful information that you can ignore or use to your advantage. Most of the time they are not used. You could compare old a new values to see if the event was triggered by a real value change event or by a signaling property fed with the existing value (in this case old=new) or you could subtract the two and execute different code for a small change vs. a large jump. Sometimes the control terminal is elsewhere, so having access to the new value can be useful. The ctrl ref is useful if the same event case handles several controls. This will give you information of which control triggered the event. The type is useful if you have several event types assigned to the same event case, e.g. value change and timeout. Other events have different terminals. For example a cursor move event has a terminal for the new cursor position.
Many event outputs are rings. Right-click on e.g. the "type" terminal and do a "create constant" Inspecting the constant will tell you all possible outputs.