Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ6024E to acquire miliVolts to covert to temp and pressure

Dear People,

 

I am using the DAQ 6024E card with LabView 2012 which I connect (for testing purpose) to a board CB 68LP. Normally the DAQ card will be connected to the same board but inside a gasifier to be able to collect voltage readings from 8 thermocouples type K and 4 pressure plates. Regarding the thermocouples we have to increase the range of the mV we get because the signal is to low as there is no Cold Junction Compensation inside them. 

 

I have tried multiple ways to acquire the data without any success ( the voltage readings we get are correct but the output when trying to use DAQAssistant or the thermo linear module are completely wrong). Thus I am doing this in low level programming

 

I have attached the vi I have build so far. I will like to ask for some help to solve the error I get inside the formula node I have. 

 

The error is "Formula Node: Array indexing expected". There is multiple solutions on the forum but I can not make this work. I know that I have to index the variable v. I don't understand this as I have already "cut" my array input of voltages in the beginning with a "Index Array" module.

 

Can somebody see any solution?

 

The numbers you see after the "Index Array" module are the subtraction of the offset and division of the intensification we have given to signal for each channel and then I just add the theoretical Cold Junction Voltage (for 25C ambient temp for thermocouple type K is 1mV). The channels 8 9 10 11 are there to measure pressure thus I am passing the voltage readings from a linear equation of the type (T = mV+b).

 

I will appreciate any kind of help

Kind Regards

Alex

0 Kudos
Message 1 of 7
(3,155 Views)

I was able to take out the first error i got by writing inside the formula node 

 

int32 i, N;
N = sizeOfDim(v,0);
for(i=0;i<N;i++)
if (v[i]<=20.644)
t[i] = 0 + (2.508355*10^1)*v[i] + (7.860106*10^-2)*v[i]^2 + (-2.503131*10^-1)*v[i]^3 + (8.315270 * 10^-2)*v[i]^4 + (-1.228034 * 10^-2)*v[i]^5 + (9.804036 * 10^-4)*v[i]^6 + (-4.413030 * 10^-5)*v[i]^7 + (1.057734 * 10^-6) *v[i]^8 + (-1.052755 * 10^-8 )*v[i]^9;
else
t[i] = (-1.318058 * 10^2) + (4.830222 * 10^1)*v[i] + (-1.646031)*v[i]^2 + (5.464731 * 10^-2)*v[i]^3 + (-9.650715 * 10^-4)*v[i]^4 + (8.802193 * 10^-6)*v[i]^5 + (-3.110810 * 10^-8)*v[i]^6 + 0*v[i]^7 + 0*v[i]^8 + 0*v[i]^9;

 

But now I get the error

"Formula Node: Array type required"

 

Kind Regards

0 Kudos
Message 2 of 7
(3,150 Views)

Hello Nikolian,

 

The reason you were getting the error "Formula Node: Array indexing expected" is because each waveform has an array of Y data in it, so even though you indexed the 1-D array of waveforms, you still needed to index the array of Y values before passing it to the formula node.

 

After that was taken care of I looked through the formula.The operator for "to the power of" is **, not ^. I was unaware of this too actually and it took some digging to figure this out.

 

I made some modifications you might like. Please see the attached code, it takes advantage of loops and autoindexing to take care of a lot of the repetitive stuff you were doing.

 

Thanks,

Joel C

National Instruments

0 Kudos
Message 3 of 7
(3,136 Views)

Dear Joel,

 

Thank you so much for this. My .vi works perfectly correctly and now it looks also good 🙂

 

I just have one small issue. The names we have given in the "Signal names" do now appear in the "Write to Measurement File" created (when I open it with excell). They are still in the format Dev1:/ai0 Dev1:/ai1 e.t.c. even if we have specify it in the signal name array. 

 

Do you know what I could do to fix this.

 

Thank you

Alex

0 Kudos
Message 4 of 7
(3,107 Views)

Hello Alex,

 

I was afraid that might happen. I'm not very good at working with Dynamic data. It's a very unwieldy datatype that I don't fully understand (I avoid express VIs like the plague). We can avoid using the express VIs (and therefore the dynamic data type) all together with the lower level File I/O functions. This will make your program perform better and be easier to troubleshoot as well.

 

Please see the attached. It uses the TDMS file format, which I feel is more appropriate for your application. You can open TDMS files in excel, though you may need to install a TDMS file plugin for excel for this to work.

 

I've set the code to display the data in the TDMS File Viewer before exiting. You can delete that VI if you just want to save the data to a file and look at it later with Excel.

 

Cheers,

Joel C

National Instruments

0 Kudos
Message 5 of 7
(3,098 Views)

hello Joel

 

I can see what you are doing and I understand it.

 

But I think there is a more easy way to do this but  as I am new to LabView I can not find the appropriate modules. I have done some research without any good results. Maybe you can help me more.

 

What if we use the old set-up we had and we add a new element to our final array where the first one will go and get the time (Relative) from a separate module. But it will have to synchronize with the different rates we specify in the beginning. While also include another input of the absolute time (date and real time) and include this at the end of our array ( this is something that need to be done in the final file I have to create).

 

What do you think of this?Do you think there is possibility to do this? (e.g.. using time stamp module or tick count module). I tried to make it work without any success

 

Thank you

Alex

0 Kudos
Message 6 of 7
(3,067 Views)

Hello Alex,

 

I don't really understand what you want to do. The waveform data type has a t0 and a dt value. This makes it such that every data point has a time value associated with it.

 

Thanks,

Joel C

National Instruments

0 Kudos
Message 7 of 7
(3,060 Views)