11-05-2020 08:48 AM
Hi,
Is anyone know why when I want to run my program I recieve this kind of error?
I didn't have this issue until I add reading from file case (and build array from saved waveform with my daq waveform).
What should I do?
I just want to see my saved waveform with measurements... or my live waveform from daq independent what i choose..
11-05-2020 09:22 AM
I recommend "shrinking" your program so that it has only the DAQ code (with the Error Line running through it, at the bottom of your VI). Don't worry about saving to files. I can't read your labels (sorry), but you have three options just before you issue the DAQmx Start function -- do any of them work? Can you get a simple example that fails?
If you can attach a simpler example, and also tell us what DAQ device you are using, we can take another look. Be sure to let us know what setting you want to use.
Bob Schor
11-05-2020 10:00 AM
Do you see on the right hand side where your task reference is going out that you don't have a solid block? That means that you've got it set to use default if unwired, and at least one case is not wired. That case is the one that is shown, which I believe is the case that you added. Wire the task through all cases.
11-05-2020 10:07 AM - edited 11-05-2020 10:14 AM
You use "Build Array" to make an array of 2 waveforms. The 2nd one comes from your DAQ task and that one should be ok (unless you also had a DAQ error).
The first one is the problem. It's coming out of a case structure output tunnel but only one of your cases sends anything *to* that tunnel (the case "Odczyt z pliku"). The others don't, including the default case. The vi is only allowed to execute because the tunnel is also set to "Use Default if Unwired." However, the default value of a waveform will include an empty array, i.e., less than 1 sample. That must generate an error from one or more of your downstream processing functions.
[Edit: right after posting I saw the response from johntrich1971 which is *also* correct. My best guess is that what you probably *really* want to do is *select* one of the two waveforms rather than build an array out of them. Which means that you probably may as well skip *all* the DAQ stuff in the case where you read data from file.]
-Kevin P
11-08-2020 06:29 AM
Thank You for your fast response,
I am using NI USB-6351 daq. The problem is that i can't "wire the task through all cases" because I want only one waveform (a choice of two), from daq or from saved .csv file... if i chooce "Odczyt z pliku" i want to have waveform on graph and measurements from saved earlier .csv file, but when i choose "Bez wyzwalania" or "Wyzwalanie zboczem" i want to have waveform on graph and measurements from my daq device... ONLY ONE OF THEM, but my program see the error becouse one of this signals is empty and the second one is correct, but it still gaves an error, i just don't want it to wait for two signals but want it to choose this only one and correct.
I attached the example .csv file which i use.
Thank You,
Mateusz
11-08-2020 10:12 AM
Please post your code and I can illustrate in code easier than I can explain in text. If you're using a newer LV version, use "Save for Previous Version" back to 2016 so I can help best.
-Kevin P
11-12-2020 04:14 AM
I posted my program in 2016 version like You pleased.
11-12-2020 07:04 AM
I made minimal mods to illustrate what I meant. In the case where you read from file, the task still gets created and cleared, but is never started. That's not ideal, but it shouldn't really hurt either. I felt it best to leave the mods as minimal as possible (including comments), so it was easier for you to compare to your original.
-Kevin P