06-19-2007 09:32 PM
06-20-2007 12:32 PM - edited 06-20-2007 12:32 PM
Message Edited by cgifford on 06-20-2007 12:33 PM
06-20-2007
05:00 PM
- last edited on
04-15-2024
11:53 AM
by
Content Cleaner
Hi Chris -
I may not be able to answer all of your questions completely, but I can help with the architecture of your hardware setup. First, I'd like to know which PXI controller you're using. Is it a remote controller or an embedded controller?
1. The data retrieved from the digitizer is discrete analog data, not digital. Digital data is transmitted as an array of bits, but what the digitizer returns is an array of samples taken from your analog waveform. So each value exists at a finite moment in time (discrete), but carries a decimal value of the signal's amplitude (analog). This data can be recorded, manipulated, and viewed as-is. There is no need to try changing it to a "digital" format.
2. Which example program were you running? And what is "PXI2" supposed to indicate? From the constants on your block diagram, it looks like your PXI chassis is designated as "PXI1". This designation is used in conjunction with the slot number of a module to identify that specific module for a driver session, but it shouldn't be needed to designate the location of a log file. You simply need to provide a valid hard drive path for your log file, such as C:\log.bin or C:\Log Files\Test1\data.log. You can also provide a network path if you have write access to that folder, but I don't recommend it for streaming to disk. The high latency and low bandwidth of a common 100Mb network will be far too slow for most situations.
3. The best thing I can do for you here is point you to the NI High-Speed Digitizers Help file. This file contains a lot of documentation on our your digitizer works, including a full state model that describes how triggering and driver calls control your acquisition. You can find the file in your Start menu under Programs » National Instruments » NI-SCOPE » Documentation. Inside the file, browse to Devices » PXI-5124 » State Model. I recommend reading this article in depth to understand how records are acquired and transferred to the host.
I don't fully understand the design of your application. The code you posted does this: Generate a pulse train with a 6602 and route it to the PXI_Trig0 line. This signal is then used as the Reference trigger on your 5124, which tells the digitizer when to acquire each record of data. At the same time, your 5422 is using an undocumented external signal as a Start trigger, though the digitizer is permitted to start acquiring immediately. What signal is sending the Start command to the 5422? Is it desired for the 5422 and the 5124 to start asynchronously?
Both the 5124 and the 5422 use the PXI_Clk10 signal as a reference clock, but the 5422 has twice the sampling rate of the 5124. Since the sawtooth being generated is 1000 samples in length and each of the digitizer's records is 8192 samples, there are 16.384 sawtooths generated per record of acquired data. Is that the expected behavior?
When you say "the timestamp of the starting trigger", what are you referring to? I can only assume that you mean the timestamp of the Reference trigger for each record acquired by the digitizer. This value is returned in the wfm info output of the niScope Fetch VI. You can either use the timestamp of the first sample in each record (relativeInitialX) or you can calculate the timestamp of the trigger itself (absoluteInitialX - relativeInitialX). These timestamps are stored and returned for every record acquired, regardless of how many records you fetch at a time. (So if you fetch multiple records at once, they will be returned as an array of the wfm info cluster.) Writing this data to the binary file is a simple matter of adding another Write to Binary File VI in each iteration of the loop.
4. I don't understand the wording of the sentence, "I need to be able to acquire data to the extent of the sawtooth waveform generated...for each trigger." Can you reword that or elaborate to make it easier to understand?
To make the loop iterate faster, I recommend:
I hope this helps. I know it's a lot to digest at once.
06-20-2007 08:17 PM
06-21-2007 09:57 AM
06-21-2007 05:39 PM - edited 06-21-2007 05:39 PM
Message Edited by David S. on 06-21-2007 05:40 PM
06-21-2007 06:54 PM
06-22-2007
11:42 AM
- last edited on
04-15-2024
11:55 AM
by
Content Cleaner
Hi Chris -
What is used by default if no reference/sample clock is provided?
Your question is answered in part on page 41 of the 660x User Manual. You can find out what happens in your own program by reading the properties in question (instead of writing them) after the task has started. The values committed to the hardware will be returned to your indicators.
I currently get this error when I toy with...
Which error? Please post the error number and text.
2.) As I will be recording for a very long time...
First, I need you to read two articles on streaming data: Streaming Data to and from Disk and High-Speed Data Streaming: Programming and Benchmarks.
...The save operation is delaying things of course...fetching the records took a much longer time to catch up.
You can confirm this using the Tools » Profile » Performance and Memory option in LV 8.x. (In LV 7.x, you'll find it under Tools » Advanced » Profile VIs.) This will tell you exactly which VIs are taking so long. However, I'm certain that fetching and saving to disk are the bottlenecks, here. There are two things you can do to alleviate them:
1. Use a producer-consumer queue structure.
One of the articles I linked above explains the theory. You can study some code by opening the niScope EX Save to File - HWS Low Level - Single Channel Stream.vi
2. Fetch multiple records at a time.
Right now, you're only pulling one record from the device each time you call "niScope Fetch". If the call itself is a slow process, why not take advantage of the spent time and retrieve multiple records at once? Change the Fetch Number of Records property to a higher value. You'll also need to change the Fetch function to "Multi Waveform" so it pulls more than one record. (Yes, this is contrary to what I said in an earlier post.) The example niScope EX Multi Record.vi example in LV shows how to do this. Note that the example performs a continuous acquisition into one waveform, whereas you'll be doing a multirecord acquisition into several waveforms.
On that note, I also noticed that you're not creating a new waveform in the HWS file for each record. If you don't call niHWS New Wfm Reference in each iteration of the consumer loop, you'll accidentally overwrite the wavform properties with each new record. Here's an example of the method I'm describing. (This should be all the file writing code you need -- the gain and offset parameters in your program are unnecessary for scaled data.)
Message Edited by David S. on 06-22-2007 11:42 AM
Message Edited by David S. on 06-22-2007 11:45 AM
06-22-2007 07:56 PM
06-25-2007 06:15 PM