BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Minutiae (that may bite you someday)

Kindly clarify me query.In the above for loops when the refnum data passes through the shift registors a valid refnum is obtained at the end of loop execution,whereas when the refnum does not pass through the shift registor refnum becomes invalid.What is the reason for this behaviour?

0 Kudos
Message 121 of 131
(10,464 Views)

Hi,

 

if your FOR loop runs NULL times, and you use tunnels, a null reference will come out - as there is no valid data at the output tunnel.

 

MB

 

 

0 Kudos
Message 122 of 131
(10,460 Views)

I'm not seeing the For Loop you referended, but watch out for loops that execute 0 times.  Because the shift register is a single memory space, you will have the reference on the other side of the loop even when the loop doesn't execute (e.g. indexed by empty array).  However, tunnels are independent memory spaces, so the outgoing tunnel won't have anything feeding it when the loop doesn't execute.  This isn't the case for a While Loop since it will always execute at least once.


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 123 of 131
(10,459 Views)

I'm pretty sure they are referring to this post: http://forums.ni.com/t5/BreakPoint/LabVIEW-Minutiae-that-may-bite-you-someday/m-p/1122315#M12323


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 124 of 131
(10,439 Views)

In the snippet below, the final output Boolean always evaluates to TRUE ... right?

 

Not quite!

 

The two pairs of functions are not exactly inverses of the other for IEEE 754 Floating Points, meaning the XOR of the two functions is not always TRUE. As with the first Bit of Minutiae, this discontinuity happens when either input is NaN.

 

The semantics of this output are very important to consider when designing fail-safe systems. Ensure that you choose the correct function with the desirable result, which is oftentimes a failure mode, for NaN!

 

TheThirdOutcome.png

 

 

Message 125 of 131
(10,410 Views)

Negate negativity.png

 

No Comment required.

Message 126 of 131
(10,333 Views)

@Intaris wrote:

Negate negativity.png

 

No Comment required.


Many fields require memorization of minutia.

Programmers should know the value limits of all common number representations. Smiley Very Happy

PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
Message 127 of 131
(10,320 Views)

Labels are wrong, -32767 goes to 32767 obviously, not 32768....

 

Otherwise I feel this should be mentioned in the help.  Currently it states that it negates the input number which is clearly not always the case......

0 Kudos
Message 128 of 131
(10,308 Views)

A help note would clarify the limits of the signed integer, but one could argue the function did negate the input as expected:

-32768 (-1) = 32768 (not possible in I16) = 32767 + 1 = -32768 (in I16)


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
Message 129 of 131
(10,288 Views)

Thanks for your reply.I have attached the for loop here.So, owing to the memory allocation a valid reference is obtained at the end of loop execution in the case of shift registers.Whereas in the other case when loop execution is zero a valid reference cannot be created.

0 Kudos
Message 130 of 131
(10,221 Views)