Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save measured analog data on the PC?

Solved!
Go to solution

Dear Rodzynek,

 

I'm sorry for the delay in getting back to you. Last week I had some courses which didn't gave me any time to look at your project.

 

Based on the mulichannel butterworth example (can be found with the example finder under cRIO) I made the example attached to this post. I didn't had the chance to test it (at this moment I don't have the hardware available) but this will give you a good starting point to work from. With the FPGA VI I implemented the pipelining principle.

I implemented your 10 second file requierment with the host VI; each 10 seconds the current file refrence will be closed and a new file refrence (based on a new file name; current time stamp) will be created. At this moment the c:\ path is used; you may want to change that to another directory of the cRIO's c drive (or you can use the USB drive capability for this).

 

I hope this will help you further, please let me know if you have any further questions.

 

Best regards,

Martijn S
Applications Engineer
NI Netherlands
0 Kudos
Message 11 of 16
(1,873 Views)

Dear Martijn,

 

Thank you for response. I implemented a save part of your program to my program and any file are saved. What I noticed that your vi is similar to mine which I left a post ago. Could you have a look at my vi and tell me why only the first file is saved? 

 

Thank you for any response.

 

0 Kudos
Message 12 of 16
(1,826 Views)

Dear Rodzynek,

 

first of all my best wishes for 2010. Thank you for your respond. I did had a short look at your VI and it seems that before a new file is created a file write will be done to a new file name. But I didn't do enough testing for that; you can use error clusters to determine why there is an error; the file write will not be executed because of an error.

I'm sorry to say that also my VI (I focused on this VI instead of fully testing yours) had some errors and it wasn't well thought through. Attached is the new version stripped to only the file write part. You can include this in the previous example (this was an example from the example finder). But first let us focus on this part of your VI and then go further and merging working examples with this principle. You can save this VI to disk and then add this VI in your project (right click on your cRIO controller and then add file).

In your example you are looking to two different time; do you only want to save data each x seconds? So do you want to write all data measured in x seconds to file or only the last measured values? If I understand correct; create file every 100 seconds (for example) and write to that file every 10 seconds?

 

Best regards,

Martijn S
Applications Engineer
NI Netherlands
0 Kudos
Message 13 of 16
(1,806 Views)

Dear Martijn,

 

Thank you for fast response and Happy New Year for you too. What I would like to do is to check a response of my system. I mean for characteristic frequencies of the system. I would like to put in the input a sinusoidal function with set amplitude but I want to change frequency between 0-7 Hz. Then I would like to save input/output data let's say every 100 seconds but I want to participate any noises because of changing frequency therefore I do not want to save data in first 10 seconds. I leave that time to stabilize the system. As you noticed I create a file every 100 seconds but save last 90 seconds.

 

Please check my vi. You can start it without real time system. Just have a look that it is working but I cannot understand why not with RIO system.

0 Kudos
Message 14 of 16
(1,803 Views)

Hello Rodzynek,

 

I did some further investigation on your VI. Please use error clusters en other debugging tools when you have problems in a VI. The error (inside the not time critical loop) cluster gave me error 1430; with this information I was able to find this KB . It will be most simple to replace the string to path function with the build path function. Please find the adjustments in your VI attached to this post.

 

Let me know if you have any further questions. Best regards,

Martijn S
Applications Engineer
NI Netherlands
Message 15 of 16
(1,785 Views)

Hello Martijn,

 

It works!!! Super! Thank you for your help and time.

0 Kudos
Message 16 of 16
(1,783 Views)