I want to get data from a 5170R (4 channels at once). My project is to get the received data (reading the inputs), send them to the host program through DMA channels. Once the DMA channel is full, I stop the the acquisition and the host writes the data in a human readable format into a file such as: (so it can be easily used by another software)
channel1(t=0) channel2(t=0) channel3(t=0) channel4(t=0) channel1(t=1) channel2(t=1) channel3(t=1) channel4(t=1) channel1(t=2) channel2(t=2) channel3(t=2) channel4(t=2) channel1(t=3) channel2(t=3) channel3(t=3) channel4(t=3)
(However, I am still trying to read the inputs for now.)
My problem for now is the 5170R configuration. (I tried to look at example codes, but I did not found my answer)
I used the "Data Clock" clock domain, but after compiling, I have an error as it expects an external clock (I want to use the onboard one).
I found this page which describes the clocking system:
But I don't know how to configure the nodes that are described on the page: (especially open session)
I would be glad if someone could help me on this problem.
Here are my FPGA program:
And here is my host:
Solved! Go to Solution.
Your code is missing some Instruction Framework and FIFO Register Bus code that is necessary for device configuration.
I highly recommend that you start writing your application using one of our Oscilloscope Sample Projects as a starting point.
In LabVIEW, go to File->Create Project. Then, you should see "Oscilloscopes" as a category on the left. I suggest that you start with the Stream To Host example. Run the example and you should see some data from your device. Then, simply modify the host code to store the data into the format you need.
Thank you for your answer.
I modified the example code to get my data in the desired format. However, there is still a (small ?) issue:
When reading the output file, the signal are not synchronized (I checked the signals with a regular oscilloscope and they are synchronized) .Maybe all channels do not start to acquire the data simultaneously ?
Do you know a solution to this problem ? (I attached my .vi file and the output file)
Here is the result I get when I plot the file using an external script:
Could you let me know what project you modified? Also, in your code I see you're using the Fetch Binary 16 bit function. I was wondering why you chose that one over the regular fetch function. With the regular fetch function, you can fetch from all channels with 1 VI. That seems to be a better fit for what you're trying to do.
I simply did not know that function. It is indeed more convenient to use the fetch function you mentioned.
I modified the example that is located here:
Hardware Input and Output >> Modular Instruments >> NI-SCOPE (High speed Digitizers) >> Continuous acquisition >> niScope EX Stream to disk
However, I now face a new problem which is acquisition speed. I need to sample my signals at 40 MHz minimum. However, the computer (PXIe-8840) is not fast enough when writing into / reading from the queue. Therefore, after a period of time, the application fails, and I can have my file. However, I do not have enough points (it crashes too early).
Thus, I tried to make some changes to my program:
Do you know any way to speed up the process/collect more data (before failure) ? Like if I can increase the size of the queue, increase the amount of memory Labview can use on my PC, or even processing time ?
A strange thing is the fact that if I increase the number of points to fetch, I can get more data before it fails, but if this number is too high, it will be shuffled (Or some parts are missing, I do not know). For example, below is the result I get when using a number too high. The input signal was a triangle signal (I checked and the problem lies within the file I get from the program).
Do you know what is happening ?
I attached my program.