LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

write in a text file

okay...there was an error returned via the file handler when i wanted to add the TimeStr() to the file name. Do you know how to parse the time that timeStr() returns and replacing each HH:MM:SS as HH_MM_SS ? it's a simple conversion...but what string function is used to manipulate that?
0 Kudos
Message 31 of 44
(2,718 Views)

The simplest:

char  string[10];

strcpy (string, TimeStr ());
string[2] = 95;
string[5] = 95;

It seems to me that you are weak in some vary basic C questions: you should consider investing some time in studying a good language manual,

Message Edited by Roberto Bozzolo on 02-26-2007 11:56 PM



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 32 of 44
(2,719 Views)
hi Roberto,

I'm sorry about that...you are right, I have to learn a lot . I apologize for bothering you with these trivial issues. thanks for your patience
0 Kudos
Message 33 of 44
(2,712 Views)

nadster

I don't want you feel discouraged to post your questions here. But since CVI is built on top of C language, I encourage you to consider that a good knowledge of this language constitutes a fundamental in your present and future activity; with this perspective, the time spent in learning the language is effectively an investment with its "costs" and its valuable benefits. You know the proverb: "Give a man a fish..." Smiley Wink



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 34 of 44
(2,711 Views)

For an easy reading intro to C, I like a quite old book that came with Microsoft's QuickC 2.5 eons ago (~1988-1990). It is called "C for Yourself". It is a bit dated in that it is focused on a 16-bit compiler, but it is so much more readable than the comprehensive C reference manuals. 

The first third of the book is full of examples and pictures, and covers the essential concepts of C. With that under your belt, you'll be in a great position to really put the power of CVI to work for you.  In fact, a slightly modified version of "Part 1" of the book would be a great addition to the CVI documentation to help beginners get started. (Got that, NI?)

It has no ISBN number, but the document number in my book is SY10423-0290.  (Right now there are a few used ones listed on Amazon.)

Hope this helps.

0 Kudos
Message 35 of 44
(2,688 Views)
Hi Roberto,

This is not relatd to writing text in a file..i have a question..i'm acquiring data from a device and it always shows the no. of samples acquired on the x axis and it's magnitude on the y axis...i instead want to display seconds instead of no. of samples...do you know what command i need to use?

thanks
0 Kudos
Message 36 of 44
(2,624 Views)
i'm using PlotStripChart as the command...i need to change it to accomodate seconds on the x axis instead of no. of samples
0 Kudos
Message 37 of 44
(2,613 Views)
You are probably simply plotting measures array on your graph (PlotY): this generates a diagram with measure vs. no. of samples. To plot vs. time you must add time information to your acquisition.
 
Normally an acquisition device does not return a timestamp for its measures. If you are in such a situation you will need to create your own time array synced with measures array and plot measures against time in your graph.
 
Two possible scenarios are possible:
  • Slow rate, asyncronous acquisition (e.g. an acquisition on a serial device a few times per second or per minute): in this case usually computer clock precision is enough to timestamp acquired measures. You may use timer () value to add a time reference to your acquisition
  • Fast rate, syncronous acquisition (e.g. a daq board used to acquire 1000 sample/sec timed with internal oscillator): in this case the oscillator guarantees sampling precision and you can build time array in post processing simply multiplying for every sample the acquision period by sample index in measures array

After you have completed your acquisition with time refrence, you can plot measure vs. time (plotXY)



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 38 of 44
(2,615 Views)
Your second message on strip chart arrived when I was writing my answer and I didn't noticed it before...
 
In general terms, consider that a strip strip chart is not the best option if your acquisition rate is not constant, since you cannot add points to a strip chart at irregular x position. On the other end, if your acquisition is regular and you want to display some time value on the x axis you could try using arbitrary labels for the X axis, but you will need to handle x axis update as long as the strip chart rolls during acquisition.
 
An alternative way could be the use of a a CWgraph instead of standard strip chart as suggested in this thread but I never used it so I cannot. Consider also that you will need a separate licence to use and distribute this control.


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 39 of 44
(2,598 Views)
hi roberto,

i tried your suggestion, but unfortunately i don't seem to have the CWGraph option available ...i tried searching for it in the help options but it's not there..

i'm instead trying a round about method of just putting in values for the user to see on the display...though i'd prefer using the timestamped version of StripChart i.e. CWGraph
0 Kudos
Message 40 of 44
(2,586 Views)