Discussion:
why my "write to measurement file" did not work in my program?
(too old to reply)
roxylat
2008-08-04 09:40:26 UTC
Permalink
hi ,
       pls kindly see the attached file that is my project. In my project, the "write to measurement file" didn't work that means didn't save in the .lvm file. :smileysad:Could you give some advices for it ? Thank you so much. I am looking forward your kindly reply.
 
With Respect,
Roxy


NI 9233.zip:
http://forums.ni.com/attachments/ni/170/346238/1/NI 9233.zip
StevenH
2008-08-04 10:40:24 UTC
Permalink
Hi Roxy,
Are you trying to write to the CompactRIO locally? If so try writing to the C: drive instead of the D: drive, as that is the local storage for the cRIO.
Regards
Steve
 
roxylat
2008-08-05 03:10:06 UTC
Permalink
hi ..
i have tried ur suggestion but it doesn't save the data yet . Do you have any other idea ? Thank you .
roxy
StevenH
2008-08-05 10:10:10 UTC
Permalink
Hi Roxy,
 
When you say that the file is not saving, where and how are you looking for the file that is being created?
Are any error codes being generated when you are running the host vi (create an indicator from the "error out" ternimal of the "Write to Measurement File"vi)?
Which cRIO controller are you using for your project?
 
Just to clarify that this method of creating a file will save the file to the cRIO's flash memory and not your computers D: drive.
 
I have attempted to replicate your issue using your original code and it worked successfully by creating a folder in the cRIO's memory called "d" and the text file was stored within this folder.
 
Regards
 
Steve
roxylat
2008-08-05 14:10:06 UTC
Permalink
hi        i am using the NI 9101 chassis, NI 9012 controller and NI 9233 processor for my project. the way i do was i creat the empty excel one file under C: or D: first and i change the extension to .lvm. And in the properties of the write to measurement file, i select the path where i create the .lvm file. then i run it.when i run there shows no error except not saving in the lvm file.what does it mean you said "by creating a folder in the cRIO's memory called "d" and the text file was stored within this folder" ? Could you explain me more details about it as i don't understand? i will try to save in cRIO's flash memory as well.thank you so much for your time. i am looking forward your kindly reply.With Respect,Roxy
StevenH
2008-08-05 16:10:07 UTC
Permalink
Hi Roxy,
To clarify, your cRIO controller (NI cRIO-9012) has 128MB of nonvolatile storage where it is able to store data. So when you use the "Write to Measurement File" VI within the "NI 9233 (Host)" VI it is automatically storing data to the memory within your cRIO controller.
This data can be viewed by

- Navigating to Start>>Run

- Typing <a href="ftp://ipaddressofrthost/d" target="_blank">ftp://ipaddressofrthost/d</a> in the command field eg <a href="ftp://192.168.0.52/d" target="_blank">ftp://192.168.0.52/d</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (This should launch Internet Explorer)

- Select View&gt;&gt;Open FTP Site in Windows Explorer

This should bring up the folder containing the data file. You should then be able to access the data file from there.
&nbsp;
However, this is not an ideal way of storing data as the nonvolatile memory is used for storing the software as well as any information which may be stored during aquisition. By writing data files to this memory it could potentially fill up the controllers memory.
A much better method would be to create network communications between the "NI 9233 (Host)" and a Windows Host. This can be done by TCP, Shared Variables, UDP or VI server&nbsp;communication. This will allow you to write measurement files directly to your computers hard drive from the Windows host rather than the RT host. This will aid in keeping the memory free in the RT Target (cRIO).
An example of this can be&nbsp;found in the NI Example Finder within LabVIEW, under the headings Real-Time&gt;&gt;Network Communication as shown in the .jpeg file I have attached.
Hope this helps
Regards
Steve
&nbsp;
&nbsp;


RT Network Communication.JPG:
http://forums.ni.com/attachments/ni/170/346768/1/RT Network Communication.JPG
roxylat
2008-08-06 08:40:05 UTC
Permalink
hi,
&nbsp;&nbsp;&nbsp;&nbsp;Thank you so much. It works. Now i would like to ask something about the displayed waveform. pls kindly see the two attached files. The difference between these two is with and without "build waveform". actually i want&nbsp;waveform&nbsp;to be shown&nbsp;from the start to the end of the running&nbsp;time(time'x axis') like without build waveform.vi&nbsp;But i need to use the "build waveform" for my project like with build waveform.vi as well. So how should i do? Thank you so much for your time.
&nbsp;
With Respect,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Roxy


with build waveform.vi:
http://forums.ni.com/attachments/ni/170/346976/1/with build waveform.vi


without build waveform.vi:
http://forums.ni.com/attachments/ni/170/346976/2/without build waveform.vi
StevenH
2008-08-06 16:10:09 UTC
Permalink
Hi Roxy,
I've had a look at your example VIs&nbsp;as well as your project, and have written (and attached) two example VIs which should illustrate a solution to your query.
Hope they help
Regards
Steve


Original Implementation.vi:
http://forums.ni.com/attachments/ni/170/347139/1/Original Implementation.vi


Suggested Implementation.vi:
http://forums.ni.com/attachments/ni/170/347139/2/Suggested Implementation.vi
roxylat
2008-08-07 09:40:09 UTC
Permalink
HI
&nbsp;&nbsp;&nbsp;&nbsp; Thank you so much for your answers. i would like to ask you about the timing for x axis for charts. i would like to make the x axis as real time (show in second 's') just like a stop watch.
At the X-axis----&nbsp;When i press the run button, i want it to start counting from 0&nbsp;second and when i press stop button, the counting will be stoped at that time in the chart.
&nbsp;
Secondly, In the&nbsp;labView programme, is the default&nbsp;time of the X-axis millisecond&nbsp;OR second ?
Is it the real time counting ?&nbsp;
&nbsp;
with regards,
Roxy
StevenH
2008-08-07 14:40:06 UTC
Permalink
Hi Roxy,
I've written another simple example VI for you and attached a few .jpeg files which should help illustrate my following explanation.
Firstly, the scaling of the x-axis will depend on the timing implemented in the code of the VI, for example if there is no timing the units of the x-axis will be milliSeconds, in the example&nbsp;I've written I have stated for the code to execute every 100mS&nbsp;so each increment on the x-axis corresponds to 0.1second.&nbsp;&nbsp;&nbsp; To convert into seconds you will need to go into the chart's properties dialog box, go into the "Scaling" tab&nbsp;and then configure the "Multiplier" field based on the code timing (as shown in ChrtProp Dialog Box - Scales.JPG).
To format the chart to display time similar to a that of a stopwatch display&nbsp;you will have to go into the chart Properties dialog box and configure the scaling tab similar to that in ChrtProp Dialog Box - Display Format.JPG.
In order for the chart to display all the data from&nbsp;t=0 to finish just right-click on the x-axis and select "AutoScale X".
Hope this answers your questions
Regards
Steve


ChrtProp Dialog Box - Display Format.JPG:
http://forums.ni.com/attachments/ni/170/347544/1/ChrtProp Dialog Box - Display Format.JPG


Chart Scaling.vi:
http://forums.ni.com/attachments/ni/170/347544/2/Chart Scaling.vi


ChrtProp Dialog Box - Scales.JPG:
http://forums.ni.com/attachments/ni/170/347544/3/ChrtProp Dialog Box - Scales.JPG
roxylat
2008-08-11 09:10:16 UTC
Permalink
hi
&nbsp;Thank u very much for ur reply.Whenever i put the NI_MABase.lvlib.Sine&nbsp;Waveform.vi, i have encountered a problem that the RT target connection has been lost. Is there any other way for time setting at x-axis?
Can i write the program like counting from 0 second(start running) &nbsp;to infinity(until when i stop) for x-axis?&nbsp;The&nbsp;time column&nbsp;could be&nbsp;&nbsp;0s, 1s, 2s,....it doesn't need to show the current detail timing(08:23:45 pm).
hope to get ur reply soon .
Thank you&nbsp;
roxy
StevenH
2008-08-13 09:10:06 UTC
Permalink
Hi Roxy,To display the time ass 0s..1s...2s.... all you need to do is to go into the graphs properties and into the Display Format tab and set the Type (having selected the x-axis from the pull down menu) and select floating point, then if necessary you can change the number of digitts of precision.Hope this helpsSteve
roxylat
2008-08-11 09:40:13 UTC
Permalink
&nbsp;hi ..
This is what i modified but there is the problem in data saving as lvm file . The file saves only at 0,0.21,0.42,0.63. After that it start to save from 0 again . Actually what i want to get is 0, 0.21, 0.42, 0.63, 0.84 , etc. until i press the stop button . how should i do for that ? thank you so much for your help.
With Respect,
Roxy


NI 9233.zip:
http://forums.ni.com/attachments/ni/170/348181/1/NI 9233.zip
Loading...