LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Errors

I'm storing the values from the strip chart in the text file using Fmtfile function. Now I need to retrieve the data back and plot it on the stripchart again. Pls help me in solving this.
0 Kudos
Message 1 of 7
(4,809 Views)

The complicated point is probably retrieving data, but you can simply use the reverse of FmtFile which is ScanFile: with simple adaptations of the format string you should be able to read back your data and plot them to the strip chart. CVI comes with several examples for ScanFile: see in the function help and look at Using the Formatting and Scanning Functions topic.

 

BTW, in the future try to give your posts a meaningful title: "Errors" means really nothing here since you are not reporting us any error you are receiving. Even if you were actually getting some error, it should be better to add some detail more in the discussion title (a simple "Errors in ScanFile" could be a more meaningful alternative).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 7
(4,772 Views)
Yeah sorry about that this is the first time I'm raising a question in this forum. Actually I'm using ReadFile function and plotting it on stripchart. But it is throwing an error like "dereference of out of bound pointer" so thought of asking it.
0 Kudos
Message 3 of 7
(4,765 Views)

No problem for that: we all here have learned making and correcting errors Smiley Happy Simply keep this in mind for your future posts,

 

Depending on your choices, ReadFile can read up to the entire file so you'll have to properly dimension the variables into which extracting file content. Alternatives are using ScanFile as I told you before or using ReadLine if your file is an ASCII one organized in lines.

The error you are finding means you are trying to write data to a wrong variable or a shorter array than is required: it's difficult to say without knowing the code you are using.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 7
(4,753 Views)
I tried ScanFile. Its throwing error as reference parameter expected.
ScanFile (file1, "%f", OutX1);
PlotStripChartPoint (panelHandle, PANEL_STIPCHART, OutX1);
0 Kudos
Message 5 of 7
(4,736 Views)

This is a common error while reading/scanning a value from a source: you need to pass the pointer ti the variable. If you see the examples of ScanFile in the help you'll understand how.

 

A list of run-time errors can be found in CVI help: see Run-Time Errors and Warnings topic (a online version can be found here for CVI2012, you may have a different release).

 

It seems you are quite new to CVI and to C language in general: you should take some time to approache the language and the development environment; this time will save you hours of doubts and trials in the future. For what refers to CVI you could start reading the Getting Started documentation that ships with the product (it is linked in CVI Help page: Guide to documentation and in product Welcome page too)



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 7
(4,708 Views)
Yeah you are right sir. I'll consider your advice and I'll work on it. Thank you very much!
0 Kudos
Message 7 of 7
(4,703 Views)