LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How would you apply different calibrations to multiple channels

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 5
(3,176 Views)
For the multiple channel solution I have a vi that allows me to choose the channels I want to collect data on. I could choose from 1 to 4 channels any combination. The vi outputs the channels and the corresponding sections for the initial file where the calibration information is stored. I think my solution works for one channel but I have no ideal how to implement the multi-channel solution. Thoughts.Thanks, Eric

 

Download All
0 Kudos
Message 2 of 5
(3,175 Views)

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 

John Passiak
0 Kudos
Message 3 of 5
(3,134 Views)

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

0 Kudos
Message 4 of 5
(3,117 Views)
Solution
Accepted by topic author Knoebel

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 

John Passiak
0 Kudos
Message 5 of 5
(3,102 Views)