08-29-2016 01:54 AM
Hi,
I am trying to do a subtraction with two matrices. Why does this refuse to work?
Chuan
Solved! Go to Solution.
08-29-2016 02:13 AM
Looks like a bug. Works just fine with a 2D array instead of a matrix.
(As a workaround, Insert a "matrix to array" before, and an "array to matrix" at the end.)
08-29-2016 09:54 AM
The problem comes from the Feedback Node (I never did like them -- I prefer the "old-fashioned" For/While Loop with Shift Registers). This "equivalent" code works just fine:
Bob Schor
08-29-2016 09:58 AM
Thank you for the alternative.
08-29-2016 10:26 AM
@Bob_Schor wrote:The problem comes from the Feedback Node (I never did like them -- I prefer the "old-fashioned" For/While Loop with Shift Registers). This "equivalent" code works just fine:
This code is not equivalent. The shift register will get initialized with every call while the feedback node gets only initialized on the first call. Big difference!
So the question is: What is the code actually supposed to do? How does it fit into the rest of the code?
08-29-2016 10:31 AM
You are correct, as always, Altenbach. I'd actually used a "Do Once" While Loop (which, I think, is equivalent), then (carelessly) converted it to a For Loop just to make sure it still ran. My (stupid) mistake!
Bob "Oops" Schor
08-29-2016 10:42 AM - edited 08-29-2016 11:28 AM
To make the "shift register/single cycle loop" equivalent to the feedback node, you need to leave it uninitialized, then use a "first call?" primitive and a case or selector inside the loop to properly initialize. Singificantly more code, that's why I like the feedback node. 😄
08-29-2016 11:28 AM
@altenbach wrote:Do make the "shift register/single cycle loop" equivalent to the feedback node, you need to leave it uninitialized, then use a "first call?" primitive and a case or selector inside the loop to properly initialize. Singificantly more code, that's why I like the feedback node. 😄
Except, of course, that it doesn't work in this particular example with Matrices (it certainly could be a bug in implementing matrices, of course, but also a possible bug in implementing Feedback Nodes ...):smileywink:
08-29-2016 11:30 AM
Yes, I made an entry in the monthly bug thread. Maybe we get a CAR#. 😄
08-29-2016 04:34 PM - edited 08-29-2016 04:35 PM
Thank you for being vigilant in providing feedback. This behavior is now reported in CAR 304169. You may reference future LabVIEW release documentation to track bug fixes by CAR number.