02-23-2018 06:11 AM
I am new to Labview and am so far strictly self taught. I am writing a program that in conjunction with another program will automatically take a user-defined set of measurements over a rectangular area.
I wrote two different codes, both of which will run fine so long as I only take 3 rows of measurement. After that, usually around the middle of the 4th or 5th row, the controller appears to not follow code.
For instance if the controller is on row 4, the first 2 measurements of that row will be taken fine. Then on measurement 3, instead of the x-axis, the y-axis might move at some increment that isn't anywhere in the program.
To troubleshoot, I attempted to write a third code that was as simple as possible. If I don't make the y-axis move at all, and the x-axis just moves back and forth, there is absolutely no issue, but even in the simplest code I could think of, as soon as I add in the y-axis, the code has the same failure.
I've attached the code for the simple version of the program, and I am using a Newport ESP-300. I'm hopeful a more experienced Labview user will have some advise.
Thank you,
Solved! Go to Solution.
02-23-2018 10:07 AM
It is easy to tell you are "new to LabVIEW" -- you don't know the First Principle of LabVIEW, the Principle of Data Flow. You should (almost) never need a Sequence Frame, and should never need a Stacked Frame. Use the Error Line (that's an important function of it) to serialize your code.
You should also learn to write sub-VIs. For example, the first Stacked Sequence can be a sub-VI with Error In, Index In, and Error Out, it would compute your Exponential, pass that to Move to Relative Position (wired to Error In), then Wait for Motion Stop (also connected to Error Line), then exit with the Error Line wired to Error Out (name the VI something appropriate, like Move to X). You then write a second (almost-identical?) sub-VI for the second outer Stacked Frame, also naming it (possibly Move to Y?). Now your entire routine becomes a For Loop consisting of a "Do 5 times" loop calling Move to X, then a call to Move to Y. Much simpler logic to debug, easier to understand the program, and if an error appears at all, you'll get a warning and a note where the Error occurred.
Bob Schor