Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO data logging help needed

All, 

 

This may seem like a really simple problem, but I'm new to Labview (used it ~10yrs ago) and am trying determine the best and easiest way to complete a data logging project.  Part of my problem may be I have extensive experience with dSpace and Matlab XPCTarget!

 

Most examples I have found are either much too complicated OR do data logging over TCP-IP.  Here is my "simple" setup/problem:

 

-take ~12channels of data from a 9205 module at 250Hz

-save the data to either a 9802 or a USB drive

-time stamp the data

-noncontinuous connection with a laptop (I want to start the logging application, disconnect the ethernet, then reconnect to stop the logging and then ftp the data) 

 

 

I am using a cRIO 9024 with a 9205 input module.

 

I modified an example that will take the data, but it does not log (having issues with that, too) and stops working once communication is lost (9205IO attached).

 

 

There is another program that I modified based on an in-vehicle data logger, but requires communication with a laptop also (and is much more complicated than what I believe is necessary) (cred_iv_1.1.zip attached).

 

I would be OK with using the simple scan engine (I know I can't use the 9802, though) if I could also be certain I could drop the communication link and still have data acquiring.

 

Thanks for your help in advance...

 

Michael 

 

Download All
0 Kudos
Message 1 of 10
(7,096 Views)

Hey Michael,

 

Check out page 50 of the cRIO dev guide:

http://www.ni.com/compactriodevguide/

 

It shows how to build an embedded logging task with scan mode.

 

Kurt 

Message 2 of 10
(7,077 Views)

mjc2010,

 

Your cRIO datalogging system should continue to log data if you disconnect the ethernet cable unless:

 

1.) You have the "Halt system if TCP/IP fails" checkbox checked in MAX. This makes your program stop if TCP/IP communication fails.

2.) You have anything in your code that is doing TCP/IP based communication such as Network Shared Variables, Data Sockets, etc. They will fail out and cause error messages that can halt your program.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Message 3 of 10
(7,074 Views)

Kurt,

 

Thanks for the link.  I looked at this but am I supposed to be able to interact with the front panel (Top Level.vi)?  Do I need another toolbox to do so?

 

Also, if I add my target to this project, how can I move the 'cRIO' folder over to my new device?  Dragging and dropping won't work.

 

 

Thanks!

Michael 

0 Kudos
Message 4 of 10
(7,070 Views)

Kurt,

 

I have modified this example and it will run, but I cannot get the create file.vi to work.  Error code 6, which is "Generic File I/O error".  I took this vi to a new blank project, but I cannot get it to work by itself.  I am specifying the internal disc of the rio, "C:\" to create the file.  Any particular filename does not work, with or without the .tdms extension.

 

What am I missing here?

 

Thanks,

Michael 

0 Kudos
Message 5 of 10
(7,049 Views)

mjc2010

 

Are you using a string constant rather than a file path constant? If so, your issue is that your controller is running VxWorks, which has a unix file system or "/c/" as the root, not "C:\".

 

If you put "C:\" in a file path constant, then it will handle that conversion for you.

 

Also, try c:\ rather than C:\ (use lower case) because this used to cause an error... not sure if it still does.

 

Hope this helps!

 

Kurt 

 

0 Kudos
Message 6 of 10
(7,032 Views)

Kurt,

 

Thanks for the info.  Using /c/dataA works but c:/dataA does not.  Prior to your answer I had found a work around using a pathname input then converting to a string, then back again.

 

However, the code can create a file, but now it won't save data.  -2515 is the error in the write data to file section.  Can't figure that one out.  And I would think that even with an error that I would see the newly created file when I ftp to the crio, but it is not there.  Does it not create it if there is an error?

 

Thanks,

Michael 

0 Kudos
Message 7 of 10
(7,028 Views)

Looks like there is a KB on that: http://digital.ni.com/public.nsf/allkb/E298ABC4A5272D47862573850060E307

 

Found it by searching "error 2515". You have to remove the "-" (negative sign) or ni.com returns all results that do NOT include 2515  😐

0 Kudos
Message 8 of 10
(7,014 Views)

Hi, It has been almost 3 years you guys discussed this problem.  Incidentally, today I solved this kind of problem with my cRio 9074.  I created a project and ran Host.vi on cRio controller and FPGA.vi on the chasis.  My computer and cRio are connected to the same subnet in my lab.  In the Host.vi, I pulled the "write to the spreadsheet" from FileI/O.  Before I ran the Host.vi and click on my case structure control to start to save data, I did the following things:

(1) use web browser to get access to my cRio using IP address of the cRio  http://xxx.xxx.xxx.xxx and a setup screen shows.  You may set up security access here.  Also, there is an icon on the left edge for file and folder management.  I create a root folder called  \labdata.  By doing so, I created a folder  c:\labdata on the cRio controller, not the computer!!!

(2) Enter file path  c:\labdata\demo.txt (demonstration text file, or whatever file name of your choice) to the "file path" control that I created for the Write to Spreadsheet.  The data (from my instrument or simulation) will enter the demo.txt file on the cRio controller (or chasis,not sure)

(3) Then, open http://xxx.xxx.xxx.xxx and find the data file just created and download it to your computer.  You will then dump the file from the cRio if you wish.

 

I don't know if this is the best approach.  But it works for me.  If anyone could tell me how to automatically send the file from cRio to my computer, I would appreciate it very much.

Larry

0 Kudos
Message 9 of 10
(5,447 Views)

Hi lbp007

 

I found a forum with a program that can send the file from the cRIO to the computer programmatically, here is the link.

 

Regards

Esteban R.

0 Kudos
Message 10 of 10
(5,434 Views)