From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem writing data from analogue and current input

Solved!
Go to solution

Hi I have created a labview program which acquires 3 Analogue inputs (2 current and 1 voltage), crank angle encoder, and 4 temp sensors. The Analogue inputs record against crank angle of an engine once the engine has reached top dead centre simulateously in one file. In another file the temperature signals record since they are of a lower sampling rate. Both files record at the same time by using the flat sequence structure to time events from the TDC encoder pulse. The program works well with the simultaneous recording.

 

However, I find that in the analogue inputs file, the current readings are per crank angle but the voltage channel readings are not. There are loads of zeros inbetween voltage readings as if DAQ is not occuring for the voltage read. I cannot figure out why my program is doing this since the all analogue reads are through the same sample time and analogue read task.

 

I have tried a separate labview program using only the DAQ express function and have the same 3 channels, and recorded data to a lvm file - this works even at the same rate. I do not wish to use the express functions in my program since at fast data rates and writing, it will miss out values due to express functions opening and closing files (in write express) and creating the same physical channel (in daq express).

 

Please can someone help?

 

I have attached my program and a sample file write.

Many thanks

 

Notay

0 Kudos
Message 1 of 7
(2,597 Views)

bump

0 Kudos
Message 2 of 7
(2,584 Views)

bump - hi - can anyone please help me on this? thanks

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

Without the hardware, it will be hard to reproduce your setup and determine the problem. Why don't you run the VI and make sure you have data in those 1D and 2D dbl indicators? Then, go to Edit>Make Current Values Default. Save the VI and attach that.

 

Also, your text file formatting is inconsistent. Are you sure you read the tdms file correctly? Why don't you attach the origianl file?

Message 4 of 7
(2,553 Views)

@Dennis_Knutson wrote:

Without the hardware, it will be hard to reproduce your setup and determine the problem. Why don't you run the VI and make sure you have data in those 1D and 2D dbl indicators? Then, go to Edit>Make Current Values Default. Save the VI and attach that.

 

Also, your text file formatting is inconsistent. Are you sure you read the tdms file correctly? Why don't you attach the origianl file?



Hi Dennis. I have attached my vi with the values defaulted as requested. For some reason the pressure (voltage) DAQ is only reading 3 data points whereas the current DAQs are aquiring as often as the crank angle (even more actually).

 

I copied the vi excluding the queue, writing to files and temp DAQ in an attempt to understand this. I have also attached this separated vi (problem with AI.vi) and defaulted the values. It still does the same thing - which shows there is an issue with the voltage acquisition.

 

I cannot run a separate read task vi for the voltage since the current acquistion is done on the same device and hence the 'resources is reserved' error is recieved.

 

That text file I added was post processed. As you can see from the vi attached to this message, there are more AI signals than the crank angle when the engine speed is 800rpm. This is perfectly acceptable since at higher rpm I am still able to achieve a 0.125degree resolution. The post processing involves a separate vi to rewrite the array so that there is one analogue read per crank angle of 0.125deg. That is every 0.125degree I should have 2 current and 1 voltage signal. This works fine for the current but not the voltage as you can see.

 

I have attached the raw tdms file in the zip file since the forum doesn't allow me to attach a tdms file.

 

Any suggestions? Many thanks

 

Notay

 

 

0 Kudos
Message 5 of 7
(2,538 Views)
Solution
Accepted by topic author Notay

I think your whole problem is that you are indexing column 2 for the voltage instead of row 2. That is why you only have three elements in that array in the cluster.

Message 6 of 7
(2,527 Views)

you sir, are a genius. thank you. Smiley Happy

0 Kudos
Message 7 of 7
(2,513 Views)