Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with saving data to the txt file

Solved!
Go to solution

Hello,

 

I have Labview 2009, Labview Real-Time 2009 and cRIO 3.3.0. I have also NI cRIO 9024 plus chassis cRIO 9112 and modules.

 

I would like to save measured data from modules into the txt files but I would like to do it in some time period for desire time. For example I want to save data of 60 seconds measurements and repeat it every one hour. I did project (in attachment vi file) and normally it is working nicely but I noticed that the saving data is not correct. I mean that it seams to save something which was in memory before. It is problem with XP Windows I check with another computer with Vista and it seems to be ok. It seems that on XP the buffer (refnum?)  is not clear and it keeps previous values.

 

Somebody can explain me why it is happened and how I can obey it on XP Windows? Or maybe exist any technics to clear buffer/refnum for the saving?

 

Thank for any help.

 

Regards,

Kamil

0 Kudos
Message 1 of 13
(4,896 Views)

Hello Kamil,

 

Can you upload the project (and the necesary files) so that I can have a complete overview?

Zipping the project folder could also be useful.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 2 of 13
(4,881 Views)

Thank you for answer. I put all files which I use.

 

I am reading again your course manual "CompactRIO and Labview development Fundamentals" and I am thinking if Clear Variable Forcing can help something.

0 Kudos
Message 3 of 13
(4,878 Views)

Hello Kamil,

 

I've taken a look at your project and I don't see any VI's running on your host computer (the "My Computer" target in the project).

Every VI is running on your real-time system (cRIO) and this system uses a Real-Time Operating System (see http://digital.ni.com/public.nsf/allkb/D85F9139AEB88F188625745700569E8D)

Your cRIO uses VXWorks as (Real-Time) Operating System.

 

 

Because you don't run any VI's on your PC itself, you are also not running your VI's on a Windows (XP, Vista,..) based Operating System.

Therefore having XP or Vista on your PC should not make a difference.

 

Is this explanation clear or do you need some further explanation on certain topics?

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 4 of 13
(4,852 Views)

Then could you tell me why on XP Windows I have wrong data? Why it does not save data at time that it is measuring? Can I somehow clear buffer of saving before? 

0 Kudos
Message 5 of 13
(4,850 Views)

Hello Karim,

 

With the code your currently using, you are saving your data to the "c drive" of your cRIO.

 

You are not saving anything  to the "c-drive" of your PC.

 

You should implement some kind of communiaction for your interface between the host pc (Windows XP,  Vista or 7) and the Real System.

 

One possibility is using  TCP/IP - communication: http://zone.ni.com/devzone/cda/tut/p/id/4905

You could also use ftp-communication to transfer the data from your cRIO (or vice versa): http://decibel.ni.com/content/docs/DOC-3032

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 6 of 13
(4,843 Views)

Thank you for answer. I know that I save my data to the c drive of cRIO. I check it by ftp:\\10.0.0.2 and there are my saved files such as test1.txt, test2.txt...This is working correctly but the problem is what is saving in the txt file. For example I have the sharing variable Flowmeter. And when I check by probe while Labview is running which values I have they are completely different than saving values. It means that something is in buffer/memory of the cRIO and save those values. What it is strange that I do not have that problem by using Vista. I need a help hand to solve this problem. Why my saving data are different than reading on XP 😕

0 Kudos
Message 7 of 13
(4,831 Views)

Hello,

 

Can you exactly explain what you mean with a different behavior of Vista compared to XP?

 

Your PC's Operating System  normally does not have an effect on the behavior of your cRIO (in tyour project the cRIO acts as a stand-alone system), only the code you run on your cRIO has an effect.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 8 of 13
(4,816 Views)

Hello,

 

I meant that I am reading let say Flowmeter and I see that I should have voltage 2.1023 V. In Vista this value is saved but in XP I have 1.8234 V or something different. What is interesting that if I stop Labview and start again I have again the same values, I mean 1.8234 V even if the flow is for example 1 V. As I said somewhere in XP buffer keeps data or something else and I cannot find explanation. I resintalled Labview, cRIO software but it did not change anything. I have still wrong values saving. There are any other possibility to check what cRIO is saving? What is passing by his memory/buffer while it is working? 

0 Kudos
Message 9 of 13
(4,807 Views)

Hello,

 

So you're looking with your ftp-client at the files you've saved on the cRIO?

Then you will read the same values with XP as with Vista.

Are you sure you're ftp-ing to the same file?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 10 of 13
(4,804 Views)