08-20-2013 02:29 PM
Hello All,
I am a fairly new user to Labview and am currently creating a program that: monitors sensor inputs from various CompactDAQ modules (9213, 9217), does error checking, then uses the data in some final calculations, such as averaging etc. I have put together a small piece of code that includes the main functions that I am trying to accomplish. Right now I am fairly comfortable with getting the channels set up and assigned, then passing this data into a while loop that continually pulls data from these sensors.
I have the calculations vi complete and the channel inputs UI complete, now I am working on the reading and data manipulation side of things. The 1D Waveform that is coming out of read function is being broken up into the components that I am interested in (String Name and Y data). It then pass this information out of the loop through a queue which passes it along to the parallel loop below which will perform the error checking and the averaging calculations. There are some things that complicate this. I have shown 2 sensors in my example, but in the actual program, there can be up to 400 inputs. The issue is that not all these sensors will be used on every test that the software is used for. To use the inputs in the test VI as an example: If I am trying to average these 2 inputs to create a common value, but then on one test, sensor 2 is not there, it needs to recognize this and not use this in the averaging function.
So to get right down to it, I want to create something that can look through the clusters of data from the 1D Waveform, determine what these values are, then do the necessary functions to those numbers once they are identified, then pass them onto the Calculations VI where it then displays the usable information for the user. I think I am having an issue with determing how to sort as everything I have thought of makes me think there has to be an easier way.
Has anyone encountered this? Does my explaination of what I am trying to do make sense? Let me know and I can clarify.
Solved! Go to Solution.
08-20-2013 02:53 PM
How many different types of test does this system run.
If I understood you correctly, then you can use a look up table for each test to see which prameters you need to extract. From there you can manipulate the data. if this is feasible for you application, let us know and we can guide you through the configuration of your look up table.
Good luck,
08-20-2013 03:10 PM
Thanks for the response. This sounds like the solution that I am looking for. The current version of Labview that I have is 2012 and is the professional developer version. I forgot to include this in the previous post.
If I am understanding this correctly, the data from the waveform that I am extracting can be placed into a lookup table, which can then be searched through by the String name that I have identified each channel by and find the related Y value for that string name, then use this information in the calculation page. So essentially I will be creating a local collection of all the sensors that the inputs are being read on, then pulling out of that lookup table the necessary information? If this is correct, I can work with that solution, just need a couple more bread crumbs to get started. I will then post the completed example for anyone else with this question.
08-20-2013 03:41 PM
You are on the correct path. I would create a table of the channels you need and only get the value for those changes. This way you are not constantly creating a table of data which you will not use.
For example, you can create a 2D array of the channels you will use for each test. each coumn can specify which channels you need to use. and the rows specify the test. From there you can extract all of the values in an specific row, based on the test selected. from there I would only collect and manipulate the data which are specified in that row.
Sorry about the generic answers but I'm not very clear about how your software specifies these requirments. if you need any specific help on how to implement this, let me know and specify the specific task you need help with and I'll do my best to give you and example VI.
08-21-2013 10:43 AM
Hey All,
This is the conclusion that I had come up with for obtaining the information that I had needed. A big thanks goes out to everyone on the forums for getting me some of the right concepts and terms to search with for final program. It would also help to know the errors that I have made in the program that I had designed along with additional efficiences that I could add in to make this work faster and easier.
Once again, thanks everyone for the help.
08-21-2013 12:39 PM
As far as functionality goes, I don't see anything wrong. when it comes to efficiency you need to keep some general pointers in mind. These issues which I'm bringing up will not affect your code currently since your array sizes are small but can start creating memory fragmentaion and slow down the software if your array sizes are much larger and the software runs for a long period of time.
1. Try not to use Build Array. Each time you use a built array labview creates a copy in the memory. Try to initilized your arrays and replace the subsets.
2. as much as you can try not index arrays or unbundle cluster multiple times. try to perform as many tasks as possbile in one shot. (this was evident in your second loop)
Besides that it's looking good.
I made a few modifications to your code and attached it. I wanted to give you a different take on it as it relates to being able to control the inputs and outputs programitically, if you had a look up table. I didn't make the same modifications to your second loop but I can guide you through what needs to be done if you would like to move in this direction. Again your original code is well done for someone who is new to labview so don't feel like you need to follow the new VI design. Just try to remove the build array and multiple indexing as a good programming habbit.
08-21-2013 01:27 PM
Thanks for the refinements. The VI is much cleaner now and looks easier to expand. I will work on updating what I have now to put this in. I am a visual learner so this example that you had modified helps me a lot. Once again, thank you very much for your help on this.
08-21-2013 04:23 PM