10-27-2008 12:17 PM
I'm attempting to apply calibration data to multiple channels. The calibrations could have been done at different times for different channels and could be using different fits. I think I have a solution for just applying the calibration information to one channel. I'm posting the solution for one channel in this post. In the next post I will include the multi-channel problem I'm working on. I had to add txt onto the initial file in order to post this.
Thanks in advance.
Solved! Go to Solution.
10-27-2008 12:24 PM
10-29-2008 11:23 AM
Hi Knoebel,
To simplify things, you could create your Custom Scales in Measurement and Automation Explorer and then apply them as desired to your input channels, or you could create input tasks in MAX with the scales included I found several links that should be helpful to you:
What Are Custom Scales, and How Do I Use Them?
Applying Custom Scales to Each Channel of a DAQmx AI Task (includes example program)
How Do I Include Custom Scales When Building an EXE?
If you want to have more control of the scales through your vi itself, take a look at these links:
Programmatically Create a Custom Scale in DAQmx
How Can I Change the Values of a Custom Scale Programmatically?
If you have any other questions please let me know--this should get you started on the right track. Thanks for posting!
-John
10-29-2008 02:46 PM
Thanks for the links John. I just logged on to post my working solution so I haven’t had a chance to look at them yet.
I’ve been working on this problem and have come up with the below attachment. I believe the logic is correct, but do not know if this is the most efficient way of doing this. I start by reading the calibration information in my ini file for only the channels that I am collecting data for. This is accomplished by the case structure enclosed in the for loop. The calibration values are stored as variables so I don’t have to read them with each data point I collect. I then start the data collection within my while loop. As I collect the data I pass it through a for loop where I apply the calibration curve to it and pull the calibration variables from the 2nd case structure. I’m using a for loop for this so I can index the wave files and apply the correct calibration information to each one. The channels and sections will be inputs to this vi from the choose channel vi.
John I don’t know if this is better or worse than what you are suggesting. I will read the links you sent me.
Does anybody have any comments on what I’ve put together?
Thanks, Eric
10-30-2008 01:09 PM
Hey Eric,
Glad you were able to get this working. The links that I sent show how to use the DAQmx driver to scale the data with custom scales, which should be an easier and more maintainable method to do the same thing (with the exception of not being able to use logarithmic scales). Be sure to check them out to see if it is something you would be interested in.
If the code that you just posted works as you want it, I don't see any need to make changes--you might want to consider using an array of clusters for organization and clean up some of the wiring. As a minor point, the loop count terminal does not need to be wired on your first for loop since the input is auto-indexed. Personally, I would have used the DAQmx scaling functionality described in the links from my last post, but since you already have this working there shouldn't be any problems with using this method. If you have any questions or any specific issues come up please let us know.
-John