Discussion:
How can I selectively write data to a file programmatically?
(too old to reply)
somasudra
2008-07-16 22:10:08 UTC
Permalink
Hello, My VI controls one analog output voltage channel and one digital output voltage channel on the USB-6009.  At the moment I can save this information every time the loop exectutes, which also stores a timestamp.  My question is - can I somehow program Labview to save the output voltage only when the digital output voltage changes?  I'd also like to program the time it took for the digital output voltage to change, perhaps by subtracting the last timestamp from the current timestamp.  Is  this possible?  Or do I need to process the data after it is written using another computer language?Thanks a lot!-S
GovBob
2008-07-17 17:40:11 UTC
Permalink
Yes you can do this in LabView. I would suggest posing this question on the LabView board. If possible include your vi using the attachements button on the bottom of the message editor. Make sure you don't preview the message as you will lose the attachment when you post it. If you can't include the vi use the code capture tool located on this site to include a picture of the block diagram. Also include a detailed description of what you want to do and what version of LabView you are using.
somasudra
2008-07-17 19:40:11 UTC
Permalink
I'm new to Labview, so I'm not sure exactly what the Labview board is.  Is this a discussion forum or part of KnowledgeBase?  How and where exactly can I post my VI and my question?
GovBob
2008-07-17 20:10:08 UTC
Permalink
I meant the discussion forum located below. That is where you will post your question and vi. When you are asking your question there will be a browse/add addtional attachments where you can include your vi.


<a href="http://forums.ni.com/ni/board?board.id=170" target="_blank"> http://forums.ni.com/ni/board?board.id=170</a>

Sorry about the confusion. If you are really new to LabView many would suggest the free online tutorials located here.

<a href="http://www.ni.com/academic/lv_training/how_learn_lv.htm" target="_blank"> http://www.ni.com/academic/lv_training/how_learn_lv.htm</a>

The courses will get you familiar with the terminology and dataflow paradigm which is the basis of LabView. That way you can ask better direct questions and receive better&nbsp; advice on how to proceed. They are really worth the time. The people on the LabView forum are really great and are very helpful.

Hope this helps.

&nbsp;
RT4CY
2008-07-17 23:10:07 UTC
Permalink
Also, check out the link at the bottom of my signature.&nbsp; There are alot of resources online which you can use to familiarize yourself with LabVIEW.&nbsp; The functions you would use in LabVIEW to do what you ask are: (1) Tick Count (2) Case Structure.&nbsp; I have attached a VI which shows how to get the elapsed time.&nbsp; You need to use two Tick Count functions because the initial value corresponds to when you first boot up your computer.&nbsp; Thus, you need to subtract this initial value.&nbsp; A Case Structure is similar to an if...else statement in text-based programming.&nbsp; You can perform some operation depending on an input value you give the case structure.&nbsp; The LabVIEW Help also has more detailed information on using these functions.&nbsp; Go to Help»Search the LabVIEW Help.&nbsp; The functions are located here:VI and Function Reference»Timing VIs and Functions»Tick Count (ms)VI and Function Reference»Express VIs»Execution Control Express VIs»Case StructureAnother great resource is the NI Example Finder.&nbsp; Go to Help»Find Examples.&nbsp; You can find a great file I/O example here:Browse by Task to Fundamentals»File Input and Output»Write to Text File.viMessage Edited by RT4CY on 07-17-2008 05:45 PM


elapsed_time.vi:
http://forums.ni.com/attachments/ni/250/41641/1/elapsed_time.vi

Loading...