From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

question about Val(Sgnl) property

Solved!
Go to solution

Hello,

I am reading data from a telnet connection as 16-bit binary values.  I strip individual bits of that 16-bit word to light up indicators.  For each indicator that I light up, I want to have an associated 'history' indicator, that would show if it lit up, then went dark at some point (i.e. like an overnight test).

 

To achieve this, when I assign a value to a given indicator, I send that same value to that indicator's Val(Sngl) property.  Then I have an event structure that simply sets the 'history indicator' true whenever there's a Value Change in that Val(Sngl) field.

 

OK so my problem is that I must not be understanding what constitutes a value change, because what's happening is that when there is an error on any indicator, ALL of the history indicators are lighting up.  The VI is large and complex, so instead I attached a picture that shows the important parts.  Notice on the left I mask out individual bits, then on the right is where I light up the indicator based on the Value Change property.  I've only shown one here because they are discrete but the code is identical...if the respective error bit changes value (low-to-high or high-to-low), then light the history.

 

So as an example...if G_LOL Summ goes active, the history bits for all 5 indicators goes active.

 

I put probes on the signals that I don't expect to light up (i.e. probe #18 at the bottom of the picture on the left)...it stays "false" the whole time (i.e. value doesn't change), yet it's history indicator comes on.

 

Any thoughts?  Thank you

0 Kudos
Message 1 of 20
(2,964 Views)

Val(Sgnl) will trigger the Event Structure case no matter what value you write (even if it's the same value).

 The long blue wire could be getting all xFFFF.

0 Kudos
Message 2 of 20
(2,953 Views)

I can understand that, but then why does the event structure on the right execute?  In other words, "value change" to me implies that the value actually changed... I can understand that in the loop on the left, it's constantly writing 0...but if that's the case why does the code on the right execute?

0 Kudos
Message 3 of 20
(2,949 Views)

I guess then if you are correct my question would be, is there a property I can write to that would execute only when the value actually changed?

0 Kudos
Message 4 of 20
(2,948 Views)

I don't think so.  You'd probably have to include logic that writes a value to value(signaling) only when it actually changed.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 20
(2,940 Views)

OK, I could look into that...

 

Thanks for the help, I appreciate it.

0 Kudos
Message 6 of 20
(2,938 Views)

Or you could make the change in the event structure - compare the old value to the new value.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 20
(2,936 Views)

that's an excellent idea because the event structure 'value change' options by default include New Value and Old Value...I can just check to see if they are = and if not then set the history bit true.  Great idea!

0 Kudos
Message 8 of 20
(2,932 Views)

@bmishoe wrote:

that's an excellent idea because the event structure 'value change' options by default include New Value and Old Value...I can just check to see if they are = and if not then set the history bit true.  Great idea!


Or, to avoid extra code, you could check to see if they are NOT true equal and use that output as the value for your history bit.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 20
(2,927 Views)

ah, but of course!

 

sincerely,

Grasshopper

0 Kudos
Message 10 of 20
(2,886 Views)