LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Bob_Schor

Generate "more random" default names for Timing Loops (and possibly for other structures that have "internal" names)

Status: Declined

Any idea that has received less than 5 kudos within 5 years after posting will be automatically declined.

I just got "bitten" by the -808 Timing Loop error, namely one loop refusing to run because there is another loop with the same (random-looking) name, L364350956.  What confused me was that an earlier version of the code, with the same timing loop, worked just fine!  However, I subsequently added several VIs, one of which included another Timing Loop, which was also given the name given the name L364350956.

 

I'd like to suggest that names such as this that can be "randomly assigned" be generated more "randomly", for example, as L<# seconds since midnight>.  This scheme would make it vanishingly-unlikely that the same name would be generated twice (eliminating the -808 error, unless the user deliberately chose the same name), and would be particularly useful for structures such as the Timed Loop where the name is generally not visible, and has little meaning to the user (except, as in my case, when it causes an error).

 

6 Comments
Brian_Powell
Active Participant

I believe that numeric value is the pointer address of the timed loop data structure in memory.  (Or the pointer address of some part of the loop.)

 

When I visited this code for 64-bit LabVIEW, I filed a CAR to change this to something else, but the CAR was rejected.  (It wasn't important enough.)

 

Interestingly, the original version of the timed loops were most likely to have this problem; the loop name was derived from an offset in memory of the loop from the beginning of the block diagram data structure.  In 8.5, we changed it to a pointer, which is more likely to be unique.

 

What you're seeing is that the chance of 1 in 2^32 does occasionally happen.

 

I suspect that with the current design, we're not going to be able to prevent this situation.  However, we might be able to warn the user at load time.

 

Mr.Mike
NI Employee (retired)

Brian,

 

How could he have encountered that name on two different loops if they have the same address in memory?

-- Mike
Bob_Schor
Knight of NI

I have two entirely separate VIs, with different names, that have Timed Loops.  If I wire a Constant to the Structure Name terminal of either VI, it returns the constant L364350956, identically in both cases.  Needless to say, when I run this system (both VIs that have the timed loop are started by VI Server and run asynchronously), they seem to "retain" this name and generate the -808 error.  The "easy fix", once I figured out the problem, was to simply wire my own (different) name(s) to the loops.  But using a better "random" generator (like "Seconds since Midnight") would almost certainly prevent this problem.  I'm not sure why the "pointer solution" doesn't work, but it clearly does not.

Bob_Schor
Knight of NI

A Very Bad Thought just occurred to me (regarding my two VIs that have the same Structure Name).  I just realized that it is possible that, as both VIs do very similar things (but are run independently, ultimately on different targets, but on the same PC for testing purposes), I might have created the second VI by opening the first and doing a "Save As" to a new name.  This would, of course, replicate the original Structure Name (as the Timing Loop wouldn't be plunked down "fresh") -- maybe this is just a Foolish User Error after all ...

 

Brian_Powell
Active Participant

@Mr. Mike, it's the address when the loop is created.  Even if the loop data structure moves in memory, it retains its original identifier.  So you could launch LabVIEW, drop a timed loop, save and close the VI, create a new VI, drop a timed loop... theoretically (and as we've here determined, empirically), the second timed loop could be reallocated in the exact same spot of memory freed by closing the first VI.  Or this could be two different instantiations of LabVIEW, or perhaps when you share your VI from another machine.  There are a variety of ways that a 32-bit address may appear more than once.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 5 kudos within 5 years after posting will be automatically declined.