02-13-2026 04:05 PM
Hello LabView Board,
I've used LabView in the past but am in process of composing my first full program. I've had to use AI a lot, but neither it nor the documentation seems to be able to address the issues I'm running into. The questions I have are below. I have also attached the program I have created for reference (though it is rather large). I'm using LabView 2026.1 with the associated DAQmx driver.
First, I'm getting a number of errors which I am unable to remedy.
1) My annotation list, which is associated with one of my graphs, is unable to take input from the modified x- and y- coordinates, which are in double format. I am hoping to use these values for each loop iteration to identify and mark the maximum value and it's position within the graph, and to output the Y-value to an auto-updating field on the front panel (see AnnList.png). The image shows the wiring from the constant definitions with my typedef, to the wiring through the consumer while loop, and then to array creation and AnnList. The full expanded version of the AnnList can be seen in AnnList2.png. It seems to be some type of data miss match, but I can't seem to figure it out and AI is extremely unhelpful. Also the error given is "Property node Acceleration contains unwired or bad terminal."
2) I am getting a similar error for my Array to Spreadsheet Strings (see ConsumTop.png). All of these (AccelStr, BridgeStr, ExctStr, Accin) have the "Contains unwired or bad terminal" error. I've checked that they are all receiving the expected 1D double arrays. Also, none of the other terminals are bolded except for the outputs, which are wired.
3) The final error I'm getting is that my Consumer while loop conditional terminal is not wired. I would like this to stop on the same condition as the producer loop (see ProdStop.png). The method I got from AI seemed very difficult to implement. Is there a smooth way to do this?
4) Finally, I'd like to start my program running with a start button (which allows the pre-calculation for the producer to queue up and then start at the same time as the consumer loop). However, When I try to select+drag the portions of my program which exist to the LHS of the loops into the waiting event structure, I end up with numerous broken links which I worry I will repair incorrectly. Is there a standard method to accomplish this?
5) DAQmx only shows up with virtual channels, even with the DAQ connected and even though it shows up in NI MAX. I added the channels manually as inputs into the "Create Virtual Channel portions of my code for data acquisition. Will this cause any issues?
I appreciate your help, and have included my .vi, typedef (.ctl), and .lvproj in the attachments.
Thanks again,
Joseph
02-14-2026 09:47 AM
The "Format String" input of " Array to Spreadsheet Strings" is a required input that you haven't wired.
Your code is such a mess that I only looked at that one error.
My suggestions are:
02-14-2026 09:56 AM - edited 02-14-2026 10:09 AM
Another thing you should know when posting code in the forum is that a large fraction of experienced users have not upgraded to LabVIEW 2025 yet.
In the file menu, there is a "save for previous" where you can create an independent code branch. A good version choice would be LabVIEW 2020 or below. (Don't go below 2019 if you e.g. use maps or sets)
I really don't understand the reason for most of your pictures. They don't provide any useful information.
jecunningham@vt.edu wrote:
2) I am getting a similar error for my Array to Spreadsheet Strings (see ConsumTop.png). All of these (AccelStr, BridgeStr, ExctStr, Accin) have the "Contains unwired or bad terminal" error. I've checked that they are all receiving the expected 1D double arrays. Also, none of the other terminals are bolded except for the outputs, which are wired.
You can clearly see that the format input is bolded in the context help and thus a required input.
Output are never required and never bold, so I have no idea what you are talking about. If you don't wire any outputs, the compiler will often eliminate it as dead code. Why calculate something if you don't use it?
02-14-2026 01:46 PM
You are (obviously) new to the LabVIEW Forums. Here is how to help us to help you.
I did look at your Consumer loop. Of course, I can't see all of it (because you didn't include the entire Block Diagram in your picture. Have you learned the Three Rules of Data Flow programming? Do you see that you don't update your Graphs (or Charts, hard to tell which) until the While Loop stops. Is this really what you intend?
Bob Schor
02-16-2026 09:16 AM
Thank you for the recommendations. Was trying to save time as I need an analysis program for some tests I'm running (hopefully this week) but looks like I fell into the same old AI trap as usual... 😕 Been going through some of the tutorials online and looking at some of the built in examples. We'll see what happens and I'm sure I'll be posting to this thread as I continue trying to figure things out.
02-16-2026 10:14 AM - edited 02-16-2026 10:58 AM
By way of additional information on the task I am trying to perform and the software/hardware/experience I am trying to perform it with:
Program purpose/functionality:
I am attempting to use the USB-6451 DAQ to both generate and log data for some vibration tests I'll be conducting. I am hoping for a sampling rate of 200 kHz for durations of 5-10 seconds (configurable in front panel or stopping with a Boolean switch). I am planning to use AI0:3 for monitoring voltages of various instrumentation and responses, and use AO0:1 to generate sinusoidal voltage waveforms at user-specified amplitudes and frequencies for excitation purposes (the amplitudes and frequencies of the waveforms will not be identical to each other).
I attempted to create my program to allow for the first of the AO waveforms to be in the buffer before the consumer/output loop begins to run, causing the first outputs to enter the system at the same time that the first outputs are logged. From what I've seen, the best way to to this is to wrap the initializations before the loops in an event structure triggered by the start button.
I am also attempting to use a TypeDef to define and pass my data packets to the generation and logging functions. The waveform charts should update as the program runs (I did change them to be within the consumer loop due to your catch. Thank you!). The configuration recommended for this by AI (which may or may not be useful) was to save each waveform chunk in a single CSV cell to increase processing/write speed. I can process the data either way but am trying to be efficient.
I am also hoping to have an updating annotation, with both a graph-based cursor and front-panel value field, which will show the maximum acceleration value so I can calibrate my accelerometer and make sure that vibration tolerances are not exceeded. This has been giving me a lot of grief.
Finally, I'm hoping to stop both the producer and consumer loops at the same time. I've been able to figure out how to stop the producer loop, but I'm not skilled enough yet to determine the best way to stop the consumer loop concurrently (hence the reason that particular logic is blank). Any suggestions are much appreciated!
System and Version:
OS: Windows 11 64-bit
LabView: 2026.1 64-bit
Previous LabView experience:
Have used and lightly modified existing programs, but never built something from scratch. I've learned LabView exclusively by poking around online and using AI. I'm also now looking into the tutorials.
Context:
I am developing in the context of a LabView project, using a .lvproj structure (Though I'm still only just beginning to learn what that means).
Included files: I did initially include the VI I've been working on, as well as the TypeDef I've been attempting to use, though these may have gotten lost among the snips I took to try and provide local context. Apologies that those weren't helpful. I've posted the .zip file of the project converted to LabView 2020 compatibility.
By the three rules of data flow programming, do you mean:
Not being familiar with many of the concepts, this is what came up with a general web-search. Are these the points you were referring to? They seem relatively straight-forward, assuming a variable is defined in this context as immutable, and that the point is you can't "store" data in a variable, but need another structure for that?
Thank you so much for being willing to help someone with many questions and very limited experience. I sincerely appreciate your help!
Joseph
02-16-2026 10:25 AM - edited 02-16-2026 10:35 AM
jecunningham@vt.edu wrote:
Thank you for the recommendations. Was trying to save time as I need an analysis program for some tests I'm running (hopefully this week) but looks like I fell into the same old AI trap as usual..
We would be happy to help once you have a rough draft.
A few comments to your original post:
jecunningham@vt.edu wrote:
4) Finally, I'd like to start my program running with a start button (which allows the pre-calculation for the producer to queue up and then start at the same time as the consumer loop). However, When I try to select+drag the portions of my program which exist to the LHS of the loops into the waiting event structure, I end up with numerous broken links which I worry I will repair incorrectly. Is there a standard method to accomplish this?.
Fist of all, once the program is finished, the start button should no longer have any meaning. Typically you would build it into a standalone application or at least set it to "run when opened" and "close when done": because edit mode should no longer be part of the execution.
If you use acronyms (such as "LHS"), you should spell them out for clarity. I am still not sure what you mean.
Dragging code across structure boundaries is tricky. Recent LabVIEW versions try to reconnect wires but that only works well in simple cases. Once you have many wires, the combinatorial explosion of possibilities creates a mess. When copying code, I typically do a <ctrl-drag>, which create a copy of the selected code with all wires disconnected and it is easier to reconnect everything, because the original is still there to inspect.
jecunningham@vt.edu wrote:
I have also attached the program I have created for reference (though it is rather large)..
I haven't had a chance to look at your VI, but the words "rather large" can have very different meaning to different people. A well structured program should not be one gigantic monolithic diagram.
Good luck!
Don't forget the context help (ctrl+h). Hovering over a broken wire typically tells you the problem.
Also clicking the broken run arrow will give you a detailed list of problems that prevents it from successful compiling.
02-16-2026 10:45 AM
@altenbach wrote:
We would be happy to help once you have a rough draft.
I have posted the zip file for the project in my above comment, though I have not yet fixed the event structure for starting the run. I also fixed the spreadsheet string fields due to your recommendation.
@altenbach wrote:If you use acronyms (such as "LHS"), you should spell them out for clarity. I am still not sure what you mean.
Aplogies, LHS=left-hand side. I use it so often I forgot to define it.
@altenbach wrote:Dragging code across structure boundaries is tricky. Recent LabVIEW versions try to reconnect wires but that only works well in simple cases. Once you have many wires, the combinatorial explosion of possibilities creates a mess. When copying code, I typically do a <ctrl-drag>, which create a copy of the selected code with all wires disconnected and it is easier to reconnect everything, because the original is still there to inspect.
Sound advice, and that should make things easier.
@altenbach wrote:
I haven't had a chance to look at your VI, but the words "rather large" can have very different meaning to different people. A well structured program should not be one gigantic monolithic diagram.
Good luck!
Don't forget the context help (ctrl+h). Hovering over a broken wire typically tells you the problem.
Also clicking the broken run arrow will give you a detailed list of problems that prevents it from successful compiling.
Well...currently it looks like a monolithic diagram, but that's probably because I'm starting from the ground up trying to build a very specific program. 😕 ctrl+h has been very useful, as well as the error list you mentioned.
Thank you so much for your help!
--Joseph
02-16-2026 01:32 PM
Ah, thanks. You must have posted while I was already replying.
Your event structure makes no sense. It will run in parallel to the rest of the code and will never complete because the default timeout is infinite. (Thus the VI cannot be stopped, even if you stop all the loops. it can only be aborted)
If you want to start acquisition etc. with a button press while the program is already running, I would recommend a simple state machine where the program starts in a defined idle state.
I don't have time at the moment to look at the rest of the code.
02-16-2026 03:28 PM
Hi altenbach,
I realize my previous event structure was not triggering, as I was uncertain how best to apply (I've given it a whirl now, with a few additional changes, and the update can be found attached). I've made some changes, removed some triggers, and now I'm at least getting some graphical output.
@altenbach wrote:
If you want to start acquisition etc. with a button press while the program is already running, I would recommend a simple state machine where the program starts in a defined idle state.
I'll take a look at the StateMachine example and see if I can figure it out. Thanks for the recommendation.
I'm now having issues with data acquisition, with error -200288, "Attempted to write a sample beyond the final sample generated...." My guess is this has something to do with the fact that I'm buffering the sinusoidal AOs before starting the producer loop and this is causing some interference. I'm uncertain how best to remedy this issue while still obtaining data and confirming that the actual output of the AO channels from the buffer are monitored at the same timing as the responses they instigate in the AI channels, something I imagine will probably carry over if I use the state machine approach as well.
Honestly I just want the program to run and get data so I can do my research, so however we can get there the quickest is fine by me! 🙂
The updated VI/project can be found attached.