11-15-2017 08:31 AM
Morning everyone,
I am using labview for a data aquisition board to study engines.
This VI interacts with hardware from a company called UEI.
Unfortunately, this code won't run unless it reads that hardware, but it should be pretty simplistic.
I know there are a lot of rookie mistakes in this code, I would appreciate any advice given.
All I am looking to do is
1)Obtain the data, and display it on the front screen . Any rate of 2Hz or faster is appropriate. The code does this currently.
2)Record all of the data at a rate of 1Hz or marginally faster. (I don't know how to control recording frequency)
I am using a lot of loops here. I'm sure some are unnecessary. I don't know how I can get my data to pull out of those loops to save into my text file. Most of my data that is currently saving are zeros, as the data doesn't come out until the loop finishes iterating.
Thanks!
-Dave
11-15-2017 08:45 AM
Older version attached for those who need it
11-15-2017 08:49 AM
Hi lavid,
Most of my data that is currently saving are zeros, as the data doesn't come out until the loop finishes iterating.
It's not the loop, which provides this problem. It's the case structure with all those "default if unwired" output tunnels!
- When you want to create a state machine, then do it correctly with a typedefined enum and some shift registers to store data!
- Cleaning up a VI can greatly improve it's readability and so also improve your ability to debug the VI!
- Why don't you use subVIs? Keeping a block diagram to the size of the screen is recommended…
11-15-2017 02:11 PM
I was able tp get rid of almost all of my case structures. I dont know how to get rid of the case structure at the bottom however.
How can I pull that data out of the case structure?. Or better yet, how can I reprogram this to not use case structures??
I'll post my updated VI soon.
Thanks!
11-16-2017 01:12 AM
Hi lavid,
I never said you need to get rid of case structures at all!
The problem are those "default if unwired" tunnels at the case structure border!!!
Did you check the state machine example coming with LabVIEW? (You will find it when you create a new project from scratch…)