10-07-2009 06:13 AM
Hi,
I want to log the data that I get from my cRIO on my computer.
I set up a simple system using a cRIO-9073 that has a modul with a AI.
I managed to show the signal on a scope. So I used the the write measurement date to file - box (functions --> programming --> file I/O --> writing measurement data to file) and connected it to the same signal that feeds the scope.
The problem I have now is that the file has not been created after I run and stop the application.
Does anyone know what I do wrong?
10-07-2009 06:35 AM
10-07-2009 06:43 AM
10-07-2009 07:01 AM
Is a file not created when you implement this? What exactly goes on? Try to test this in a blank VI with a random number generator as input to the Write to Measurement File.
Also, this is not the right way to implement your code. You need to use the producer/consumer architecture. You can find a template by navigating to File -> New.. in the LabVIEW environment and looking in Design Patterns. Also, you should always collect data and then write them together in a file at regular intervals. Accessing the hard disk at every iteration is not the best implementation.
10-07-2009 07:26 AM
There is no file created when i implement this.
With the test in a blank VI it works and data is written to the file.
Is the producer/consumer architecture really needed? I don't exactly understand what it does.
10-07-2009 08:22 AM
Just a thought, what's the path you provide for the file?
You should use the producer/consumer architecture since writing to the file at every iteration will take up more cycles and slow the loop down. Have a look at the following:
10-07-2009 09:00 AM
The path is the normal windows user directory (i.e. "C:\Users\Username\Documents\LabVIEW Data")
The producer/consumer loop seems to be a good thing to do once I got the basic functions running.
Isn't there a simple example somewhere that explains how to log the data that is measured? One would expect that this kind of task is performed every day witht he cRIO.
I found the "cRIO Embedded Data Logger" example which seems to save the data on the cRIO modul itself. This could be helpful if on saves small portions of data there and then transfers it to the host but I can't get it running to save data neither on the host nor on the target.
10-07-2009 09:17 AM
Correction: I set the path to "C:\Users\Username\Documents\LabVIEW Data" but it seems that the files are stored on the cRIO itself. I looked for them with a ftp-programm and the files exist on the cRIO in a LabVIEW Data subfolder.
It seems that I understood the whole concept wrong. I thought the host code is executed on the host and so the file dialog is pointing to the host (just like the scope is shown on the host) but it seems that LabVIEW puts the data to the targer (i.e. the cRIO) ... although this still does not allow me to write directly on the host computer 😞
10-07-2009 09:17 AM
10-07-2009 09:18 AM