LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write measurement to file slows data presentation

Hi Marti,

 

For some reason, writing to a TDM file will not work on my computer.  Even when I run the Write TDM File example, an error message says "LabVIEW cannot open the data storage file".

 

When I said the output data gets screwed up, I meant that the readings from the internal sensor of the piezo actuator don't match the signal I sent to it.  I attached a picture for clarification.  The chart labeled "Actuator Output" is the signal I send to the piezo actuator.  In this case, it is a ramp starting at 0 going to 0.5 volts in 0.5 seconds, followed by a constant for 10 seconds, followed by a ramp down to zero in 0.5 seconds.  The chart labeled "Sensor" is the data from the internal sensor of the piezo actuator.  Since I hadn't connected the actuator to anything, the "Sensor" chart should match the "Actuator Output" chart.  This is true when no write to data file blocks are in the block diagram.

 

Thanks,

Joel

0 Kudos
Message 21 of 29
(1,466 Views)

Hi Joel,

 

 

Is there an error number associated with this message?  Do you send the VI a file to write to? 

 

Also, as for the output, are you sure that this is actually what the sensor is reading, and not a file writing error?

 

Please go ahead and attach your code so others can view it. 

 

Thanks,

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 22 of 29
(1,448 Views)

Hi Marti,

 

I've attached a screenshot of the error message I get when I run the program.  I double click on the Open Storage block in the block diagram and specify the location of the file I want to save to.

 

I'm pretty sure about the validity of the sensor reading as I have wired the data to show directly on the waveform chart.

 

-Joel

0 Kudos
Message 23 of 29
(1,440 Views)

Hi Joel,

 

What settings do you have for the Open Storage VI?  Double click on the VI and make sure that you have "Open or Create" and that the file path and name are valid.  I was not able to reproduce the error on my side. 

 

Also, what hardware do you have and how is it set up?  Are you outputting to the piezo sensor on one channel and reading in from the other? Did you see this behavior before you started writing to file?

 

 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 24 of 29
(1,419 Views)

Hi Marti,

 

I have the Open Storage VI set at "Open or Create" and I specify a valid file path.  I am still getting the same error though.

 

I am using a PCI 6110 DAQ Card with a BNC 2110 Connector Board.  I have a triaxial load cell connected to analog input channels 0,1, and 2.  I have the voltage input of the piezo actuator connected to analog output channel 0 and the internal sensor of the piezo actuator connected to analog input channel 3. 

 

I am sending a signal to the voltage input of the piezo actuator via an analog output channel and reading the data from the internal sensor of the piezo actuator via an analog input channel.  The program runs fine without any "write to measurement file" blocks; the problem only occurs when I do introduce those blocks into the program.

 

-Joel

0 Kudos
Message 25 of 29
(1,408 Views)

sorry for the delay, didn't have this one marked for replies.

 

My problem with was basic usage of while loops, I just needed to pass my data out of the loop; it seems like the current discussion in this thread is much more useful/advanced.  Hope you got your answer.

 

 

 

veritas

 

0 Kudos
Message 26 of 29
(1,405 Views)

Hi Joel,

 

For how long are you wanting to acquire data?  Another option would be to use a shift register and write all of the data to file at the end of the acquisition.  However, if you have a longer test time, this would obviously not be possible.  

 

If this is not possible, then I'd like for you to try running the shipping example for the TDM file, and see if this works.  

 

Finally, we could try using another file format. 

 

 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 27 of 29
(1,390 Views)

Hi Marti,

 

I will probably need to acquire data for about 20-30 seconds but I would like to make the program as robust as possible.  I know how to create shift registers but how would I go about using them to write to a data file? 

 

By shipping example do you mean the default "Write to TDM File" example?  I tried running that and I get the same error as my previous post.

 

I'll look at the examples for the other file formats and let you  know if any of them work.

 

-Joel

0 Kudos
Message 28 of 29
(1,382 Views)

Hi Joel,

 

That is a good plan of action.   For saving with shift registers, you can just use a build array and then write to file at the end (see example VI). 

 

Please let me know if the other file formats work. 

 

 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 29 of 29
(1,367 Views)