04-16-2019 07:12 PM
I have attached my code, block diagram, and front panel.
The goal of this set up is to count "jumping jacks" which is an moving accelerator right / left direction.
The error we see, is that when we surpass 10 or stay below ten, we get a failed message either way. how do we fix this?
Also we need to count peaks not data points above the threshold. How do we do this?
Any help or advice is appreciated!
04-16-2019 09:12 PM
Start by taking LabVIEW seriously. With very rare exceptions, you should never use a Sequence structure -- by using the Error Line, you can not only "see" your run-time errors, but you also set the sequence. Do you know about the Principle of Data Flow? That's the "central idea" behind LabVIEW, and if you don't know about it, you need to learn.
Spend serious time with the Tutorials. Try to not use Express VIs -- learn LabVIEW.
Bob Schor
04-17-2019 03:24 PM
Hi nixxi119,
I echo Bob's sentiment that you will probably need to spend a fair amount of time with the LabVIEW and DAQmx documentation to understand how to implement your ideas in LabVIEW. I'll try to offer some specific advice and then I'll link some tutorial resources as well.
As a sidenote, I took the DAQ code out of your VI and it runs fine without any bugs on my machine. I think your particular issue is being caused by the DAQ Assistant not returning quite the data you are expecting. This is one of the reasons I would recommend looking into sampling rates. Think about how much data you are collecting and how you are representing it. Unfortunately, LabVIEW is not quite as magical as it may seem. You still need to get all the numbers right.
Here's a couple of additional learning resources I would recommend:
Learn 10 Functions in NI-DAQmx
I think this project will become trivial to you if you spend just a few hours researching and learning about how to use the DAQmx API more effectively. That being said, feel free to post any follow up questions here and we will try to help.
Best,
Duncan Waldrop
Tech Support Engineer
National Instruments