‎07-10-2018 04:31 PM
RavensFan -- you are (not surprisingly) correct about the Feedback Node and that Option setting. So where is the Cycle? I don't see it, but then, there's a Stacked Frame Sequence, where wires go in and out "chaotically" (instead of neatly through Shift Registers or Tunnels, and can be arranged to encourage straight parallel wires, making inputs and outputs "obvious", another reason that NI "banned" the Stacked Sequence Frame to discourage such chaos).
Almost all of the Frames (all but Frame 5) appear to do almost nothing, setting or getting a few (often Local) Variables, or Property Nodes, most with no "wired" (from outside) inputs. Frame 5 has massive code, many inputs, but because they are in a Frame structure and not straight, it is extremely difficult to say what the wires coming into the Frame are originating outside the encompassing Case Structure.
Assuming that this code is supposed to do something reasonably important, and will need to be maintained and possibly modified, I would urge you to do the following:
Note that this "advice" can be summed up in two words (which I have said to some of my LabVIEW colleagues, most of who are still speaking to me) -- Start Over! The steps above are one way to "replace from the inside .out", but it is often easier and more effective to design from the "outside in". But do keep the Single Responsibility Principle in mind -- at every level, you want to say "What does this Code (or sub-VI) do", and "bury" inside it the Messy Details of How it does it. As you start coding the How, see if that can't be broken down into simpler "One-Thing" Steps. Simple Code is Simple to Test, Simple to Understand, and Simple to Debug (but it might be so intuitively obvious that it needs no debugging). Building the next level from known Simple Code That Works ultimately leads to Top Level Code that Works.
Bob "Philosopher" Schor
‎07-10-2018 04:47 PM
Caveat about starting over:
Sometimes badly written code depends on bad things happening to make it work right. If/when the attempt is made to refactor this code, be very careful that the refactored code functions the way it used to.
‎07-11-2018 07:43 AM
I will only be working on this project for 8 weeks or so, so I probably won't get around to rewriting much of the code. I am pretty much tasked with fixing some inherent issues with the code and integrating the code for use within another system. Only about 50% of my LabVIEW time goes to working on this code directly, and usually it is with a specific task in mind; however, it definitely could use some overhauling in general.
‎07-12-2018 12:45 PM - edited ‎07-12-2018 12:46 PM
For anyone curious, the issue had nothing to do with the I/O code, as Bob showed it should be working correctly. The issue actually was that one wires going into the "Format into String" function was coming from inside the for loop, so it was giving the "is a member of a cycle" error. Creating a value property node and wiring that to the "Format into String" which creates the file name solved the issue.
Thanks everyone!
‎07-12-2018 03:01 PM - edited ‎07-12-2018 03:02 PM
😞 An object lesson in why it's so important to write well organized, modular code. It's difficult to find even a simple issue like that if you also have to concentrate on wading through disorganized code. I'm sorry you were made to suffer someone else's foolishness.
‎07-12-2018 03:05 PM
I think tomorrow I'm going to take all of the separate areas of code, most of which are in sequence structures, and actually make them subVIs which they should have been in the first place. I believe doing this will make the code a lot more manageable to work with, as it will be 1/4 if not less of it's current size due to code in stacked sequence 5.
‎07-13-2018 01:26 PM
When you do that, be sure to use the 4-2-2-4 Connector Pattern, put Error In and Error Out on the lowest L/R terminals, and connect the VIs in sequence via the Error Lines. If you can do something similar with the code in Sequence 5 (maybe with a few simple Loop/Case structures and more sub-VIs), then you can be rid of the Sequence and have a chance at getting something where you can "see at a glance" what (should be) happening.
I think (and sincerely hope) you will be pleased with this effort!
Bob Schor