NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
JanK123
Posts: 9
0 Kudos

how to write measurement data from cRIO to drive on host-PC

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?

 

 

Active Participant
AdnanZ
Posts: 1,870
0 Kudos

Re: how to write measurement data from cRIO to drive on host-PC

Is it possible for you to post your code?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Member
JanK123
Posts: 9
0 Kudos

Re: how to write measurement data from cRIO to drive on host-PC

Here is my code.
Active Participant
AdnanZ
Posts: 1,870
0 Kudos

Re: how to write measurement data from cRIO to drive on host-PC

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. 

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Member
JanK123
Posts: 9
0 Kudos

Re: how to write measurement data from cRIO to drive on host-PC

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.

 

 

Active Participant
AdnanZ
Posts: 1,870

Re: how to write measurement data from cRIO to drive on host-PC

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:

Application Design Patterns: Producer/Consumer

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Member
JanK123
Posts: 9
0 Kudos

Re: how to write measurement data from cRIO to drive on host-PC

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.

 

Member
JanK123
Posts: 9
0 Kudos

Re: how to write measurement data from cRIO to drive on host-PC

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 :-( 

Active Participant
AdnanZ
Posts: 1,870

Re: how to write measurement data from cRIO to drive on host-PC

Exactly. Shouldn't the path reflect the directory structure of the cRIO? You might want to change that and you should see your file.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Active Participant
AdnanZ
Posts: 1,870
0 Kudos

Re: how to write measurement data from cRIO to drive on host-PC

Oh well it WAS supposed to be written to the cRIO. You will need to use FTP programs to transfer the files over to the host.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page