LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I save data from a cRIO 9102/9004 to an excel sheet?

I'm using a compact RIO 9004 realtime module with a 9201 analogue input module to collect data over a network. My VI is based on the one here (http://zone.ni.com/devzone/conceptd.nsf/webmain/8E999A74E43AC76186256F5E0068CFAC), modified to run with my hardware. When I try to add a simple "export data to spreadsheet file" control (or any other save to file dialogue), I get an "Error 43 occurred at File Dialog". Is this because it's trying to save a file on the realtime controller as opposed to the host PC? If so, how can I get the VI to try and save the data to the host PC so I can look at the data in excel (for example)?

thanks
0 Kudos
Message 1 of 7
(4,648 Views)

Hi

 

I would suggest writing to file with a shared variable from the RT back to the host. Easy to set up and by the sound of it, it will do exactly what you want.

 

Make sure you have the network variable engine and variable client engine installed on the cRIO

 

I have attached a little VI which will do the write to file bit witch needs placing under My Computer in your project. You also need to create a shared variable (in the project right click My Computer >> New >> Variable I have called it WriteToFile) the format for the shared variable is array of I16s

 

You will have to place the shared variable in the Buffered DAQ (RT).VI and change it to write, and wire the input data (synchronous display) [] in to the shared variable (see.jpg attachments)

 

Run the WriteToFile VI attached enter a file path and it will log the file to a speed sheet (you might need to re add the shared variable to this VI)

 

I hope this helps

 

Tim

 

Tim M | Applications Engineer | National Instruments UK & Ireland

Message Edited by TimM(AE) on 06-14-2006 05:13 AM

Download All
0 Kudos
Message 2 of 7
(4,623 Views)
Dear TimM(AE)
 
that looks like exactly what i want - but I can't open your vi because I'm using labview 7.1. Any chance of a 7.1 version?
 
thanks
0 Kudos
Message 3 of 7
(4,611 Views)

Hi

 

Really sorry but no. You can’t use data sockets with LabVIEW 7. You will have to use TCP IP I will have a look for some examples, I will get back to you as soon as I have some thing working

 

Regards

 

Tim

 

Tim M | Applications Engineer | National Instruments UK & Ireland

0 Kudos
Message 4 of 7
(4,607 Views)

Hi

 

I have found some links that I think will sort you out which use date sockets. Have a look at these and follow the instructions. There are also some examples in NI example finder in LabVIEW. (Help >> Find example>>toolkits and modules >> Real-Time>>communication)

 

Using Datasocket in LabVIEW Real-Time

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DED156A4E034080020E74861&p_...

 

How to Allow Remote Systems to Create and Write to DataSocket Items?

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/7050ef266e88afac86256ad300716282?O...

 

Regards

 

Tim

 

Tim M | Applications Engineer | National Instruments UK & Ireland

 

0 Kudos
Message 5 of 7
(4,600 Views)
Hi

Apparently my installation doesn't have the examples you mention (it lists them, but says it can't find them - this is on two separate installations on two separate computers). I followed the instructions in the simple sample but I don't see how I can start something running on the RT and then start something running on the host. a) the simple writer runs and then stops, and charging targets closes the writer and b) when i run the reader I get no data being displayed on the graph. Am I missing something here?
0 Kudos
Message 6 of 7
(4,595 Views)

Hi Aae,

 

LabVIEW RT has the capability that you can download and set a VI running on a target PC, then exit that VI leaving it running on the target and then open LV with a different target eg your host PC.

You cannot however have front panels from multiple targets open simultaneously.

 

LV RT capabilities and instructions regarding the above can be found in Chapter 2, “Connecting to a Real Time Target” of the “LabVIEW Real Time User Manual”.

I would strongly suggest reading through this as you need to follow a specific set of steps in order to close your writer VI and change to your reader VI without stopping the writer execution. This is what I suspect is currently the cause of your current lack of data.

 

An electronic copy of the manual can be accessed if you click “Help” on the toolbar of the LabVIEW splash screen> choose “Search the Real Time module book shelf” from the drop down menu. This should bring up a PDF file with a web link to the “LabVIEW Real Time User Manual”.

 

Can you describe the procedure you are currently using?

 

Emma Rogulska

NIUK & Ireland
0 Kudos
Message 7 of 7
(4,576 Views)