LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

val(sign) exemple

Hi,

could you send me an exemple how to use the node property "val(signl)" ?

I need to use an event that happens when an indicator exceeds a certain value...
When an indicator exceeds a certain value it better to use a comparison with a dialog or an event structure with "val(signl)" ?
Thx,
Samer,
0 Kudos
Message 1 of 10
(3,783 Views)
The Value(Signaling) property is intended to be used to programmatically trigger the "Value Change" event for a control/indicator. For a control, you wire a value to the property and it would be the same as if a user had changed the value of the control on the user interface. For an indicator you are basically forcing the "Value Change" event to be triggered whenever you write a value to it.

If you want to respond to an indicator going beyond a value you would need to have a "Value Change" event for the indicator. In there you look to see if the value is beyond a certain range, and then act accordingly.
Message 2 of 10
(3,775 Views)
It really depends on your program design.
 
To check a value for a threshold, you need to poll it anyway, so a simple comparison operation followed by a case structure is all you probably need.
 
Typically, you would tap into the wire before it reaches the indicator and handle the exception in parallel with the indicator update. Of course if your code is heavily fragmented by the overuse of local variables, this might be a bit more difficult.
 
Could you explain in a bit more details what your program does and how it is architecured? State manchine? how many parallel loops? etc.


Message Edited by altenbach on 07-09-2008 10:27 AM
0 Kudos
Message 3 of 10
(3,757 Views)
Could you explain in a bit more details what your program does and how it is architecured? State manchine? how many parallel loops? etc.

I have shared variables coming from an OPC server. I am using event structures to trace, archive and choose which variable I need to archive and trace...

When a variable exceeds a certain value i want an event to happen...i thought of using value(signallng)
but it seems that i didn't understand yet how it works... what is your oipinion ?

I made an example using
value(signallng) but it is not working...

Could u tell me why ?
thx,
Samer,
0 Kudos
Message 4 of 10
(3,707 Views)

Hi Samer,

you have to use the property node for it. Before the loop you make it right. Use also a property node in your timeout case, but bear in mind that you´ll get a message box every 10ms. Smiley Happy

Mike

0 Kudos
Message 5 of 10
(3,706 Views)
Thx,

could u explain me why i have a "value change" event every 1s even so the value of the numeric indicator (equal to 2) is not changing Smiley Surprised ?
Samer,
0 Kudos
Message 6 of 10
(3,700 Views)

Hi Samer,

the event occurs every second, because you connect  a constant of 1000 to the timeout. The value never change, because you write first the value from the control into the indicator and than you write "2" with the value(signaling) into the indicator. Connect directly the control to the value(sign) property and place the indicator, for example outside the loop.

Mike

0 Kudos
Message 7 of 10
(3,699 Views)
Please Mike,

I cannot understand this: even so the value of the indicator is not changing i have a "Value changed" event Smiley Surprised

I find this not reasonable at all....why is it happening ? why the event "
Value changed " of " Numérique" is triggered even so the value of the indicator is "not changing"...i don't understand Smiley Sad

could you be more explicit ?
Samer,
0 Kudos
Message 8 of 10
(3,689 Views)

Hi Samer,

it´s not necessary that the value realy changes if you use the value(sign) property, because with using this property you want that this event occurs. Try the attached example.

Mike

Message 9 of 10
(3,688 Views)

If you want to use the value(signaling) property node with value changed event, but only want the event to execute if the value has truly changed, do this.

1.  In the value change event, put all of your code inside the True case of a case structure.

2.  On the left side of the event case, have the oldVal and NewVal terminals show.  Wire them together with a NotEquals comparison going into the selector of the case structure.

This way the event will fire every time the value(signlling) property is written to, but the code inside the True case of the case structure will only run if the values have truly changed.



Message Edited by Ravens Fan on 07-11-2008 12:01 AM
Message 10 of 10
(3,653 Views)