02-14-2008 09:19 PM
02-15-2008 05:28 PM - edited 02-15-2008 05:28 PM
02-15-2008 06:00 PM
Hello Darren,
The fastest file to write to in LabVIEW is a binary file. The specific file type used by LabVIEW is the Technical Data Management (TDM) file. The TDMS file is a version of this file specifically designed for streaming applications. You can find several examples of writing to this file in the NI Example Finder (Click Help -> Find Examples). By using the search tab, you can use the keyword “TDMS” to search for all of the examples that use the TDMS file type. The example Cont Acq&Graph Voltage - Write Data to File (TDMS) can be found from the search tab, or by using the path Hardware Input and Output -> Analog Measurements -> Voltage. While the data acquisition part of this example pertains to analog input, the same file input structure can be used with your counter input tasks.
What do you mean that the encoder and frequency measurements are not fast enough? Each rising edge of the sample clock source will latch the current value of the measurement into the FIFO and transfer this value into the buffer. At this point, how quickly you can read the buffer will affect how quickly the user is updated with the newest measurement information. Since you have specified the number of samples to read in your buffered example, the read VI will wait until that many samples are available in the buffer before returning a measurement (this could slow down the update rate for the user). By specifying -1 as the number of samples to read, you will read all available samples in the buffer. If there are no samples available, nothing will be returned, but the VI will continue to execute. Hope this helps.
02-17-2008 09:45 PM
02-17-2008 10:17 PM
02-26-2008 04:43 PM
02-27-2008 11:28 AM
Hello Darren,
It is possible to change the input pins for your position measurement or for your frequency input to be another PFI line in your device. By default the PFI lines used for the encoder Z index on counter 0 and the frequency input on counter 1 are both PFI2. Using a DAQmx property node you can change the PFI line to be any of the other PFI lines for the device. The properties are CI.Encoder.ZInputTerm to change the Z Index input (found in the DAQmx channel property node in the path Counter Input -> Position -> Z Input -> Terminal) and CI.Freq.Term (in the path Counter Input -> Frequency -> Input Terminal). This way you will not have to use software for your frequency measurement. I did some searching and found this knowledgebase on how to use the property nodes to do this. There is even a link in this knowledgebase that shows you how to ensure that a certain route is available in your device.
02-27-2008 06:55 PM
02-28-2008 04:17 PM
Hello Darren,
I am not quite sure what you mean. Are you looking to measure your encoder position and measure the frequency of your z-index at the same time? If this is the case, as long as the frequency of the z-input is relatively low, you can use one counter for the encoder, and another counter for the frequency measurement. A high frequency measurement will require two counters. From your previous post, you mentioned that you were having issues with the fact that the encoder and frequency tasks shared a PFI line. PFI stands for programmable function interface. These lines are designed to be reconfigurable depending on the counter task. For each counter task each PFI line will have a different default value. These default values can be changed using the property nodes I discussed in my last post. I tried using PFI2 for my z-index input for counter0 and PFI2 for my frequency input on counter1. This did not throw and error and allowed me to use a single PFI line for two different counter inputs. You can also configure different each counter to use different PFI lines and externally route the z-index input into two different inputs. Hope this helps.
02-28-2008 06:38 PM