From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data logging

I am currently building a robot for a school project with the recently released new myrio. 
This robot will have numerous sensor's to collect data as it walks around.  I have already written the code for the sensor's, but I am kind confused on how to data log /storing data to the onboard rio through charts. 

The following is an analog input that is connect to a humidity sensor's with the following adjustments for calibration. 
The question is How can I save theses input readings into an excel sheet on board the rio when it's not connected to a home station?

 

jakes

temp.png

0 Kudos
Message 1 of 4
(2,296 Views)

Hi billjake,

 

First of all, you can write your data in a text file or in the excel like the example shown in the following links: 

https://decibel.ni.com/content/docs/DOC-3052

https://decibel.ni.com/content/docs/DOC-34907

 

You'll need to convert that DBL numeric data format into string by using Format into String function: http://zone.ni.com/reference/en-XX/help/371361J-01/glang/format_into_string/ before writing it to the .txt file

 

You can use string constants like tab constant (http://zone.ni.com/reference/en-XX/help/371361H-01/glang/tab_constant/) and end of line constant (http://digital.ni.com/public.nsf/allkb/5A5A050A3019A573862575F30061D49B) to assist you in creating a customized spreadsheet in .txt file.

 

Once done, you can drag the .txt file (if you create a .txt file) to the excel and you should get a table of data 

 

Just take note of the file path as mentioned in this following links:
http://www.ni.com/tutorial/14669/en/

https://decibel.ni.com/content/docs/DOC-34907

 

Warmest regards,

Lennard.C

 

 

Learning new things everyday...
0 Kudos
Message 2 of 4
(2,247 Views)

Lennard,

 

Hey thanks for the response, but i've tried the format to string path and it doesn't work for me.  I got nothing can you take a look?

I used the code I had for my BMP sensor that I had on hand and it didn't run, I checked the file path and I got nothing.

Below is the code I ran(i've included it in the attachments as well). 

 

 

datalogging question.png

 

 

 

 

As upon cheching the directory i went to save nothing was there.

 

 

datalogging question1.png

 

 

 

As shown I set my file path to new and exhisting and file and forders.  I named the file as a .txt(text file)

 

datalogging question 3.png

0 Kudos
Message 3 of 4
(2,226 Views)

Hi billjake,

 

Sorry, there are a lot ofn subVIs that are missing and therefore I can't see much from there. I will pressume the upper portion of your VI is correct and thus I'll focus on the writing the data part. 

 

There are a few noticable mistakes I can find in your code and I'm not sure if you have read the links which i have provided in my previous post. Perhaps you can try the following and see if that works. Presuming that you are doing a stand alone application of your myRIO:

  1. First and foremost, if you want to access the internal storage of the myRIO, you'll need to specify the path using File Path constants with the specified values like below:
    file path.JPG
    This was mentioned in the following links that I have provided to you earlier:
    http://www.ni.com/tutorial/14669/en/
    https://decibel.ni.com/content/docs/DOC-34907
  2. Second, your Format into String should specify the file format it needs to convert and you need to add end of the line constant as shown below:
    format into string.JPG

 

When you mentioned that it is not connected to the home station, we usually create 2 different sets of VI. One is the host VI which extract data from myRIO when it is connected to the myRIO. The other is the client.vi which usually does not have front panel user interface if it is to be stand alone, does the datalogging, acquiring data, controlling and sometime analyzing data.

 

Warmest regards,

Lennard.C

 

Learning new things everyday...
0 Kudos
Message 4 of 4
(2,218 Views)