High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming NI5105 According to my requirement

I want to let my NI5105 start sampling with some trigger on one of the channels and then sample a specified number of samples and then again wait for trigger to happen and this process continues upto depth of memory.

 

With Regards:

 

Ahsan Shehzad

0 Kudos
Message 1 of 16
(8,734 Views)
It sounds like you are describing "multi-record acquisition". 

The idea is that the digitizer takes the specified number of samples to create a "record", each time a "reference trigger" occurs. You can specify how many records total you would like to take. 

Note that you are not limited by the amount of memory on your board.  You can fetch more records than you can fit in memory by setting a property and fetching while the board is acquiring.  Otherwise you can calculate the number of records that will fit in memory given your desired record length, using the formula provided in the Waveform Specifications section of your specifications document.

To get you started there are many example programs that ship with the NI-SCOPE driver.  Assuming you are working with Windows, go to your Start Menu and select All Programs>>National Instruments>>NI-SCOPE>>Examples and select your programming environment to see a list of available examples.  Look for a Multi-Record example to get started.  There should also be a Multi-Record Fetch More than Available Memory example if you are interested in the option.

Best of Luck



0 Kudos
Message 2 of 16
(8,718 Views)
Hello Jennifer,
 
        Thanks for your reply. I have found the example written in C-language named "MultiRecordFetchMoreThanAvailableMemory". But perhaps i could not put the device number and faced the error as is.
 
  "Insufficient location information or the device or resource is not present in the system"
 
The attachement contains print screen of error occured.
 
        I am sending you the two examples found by installing NI-Scope. Can you guide me that how can i put the corret model, device, PCI and Slot number while my measurement and automation explorer snapshot is attached here with. I am also confused in the matter that the available example's Readme files seems to be not supporting my device PCI-5105 as no one contains Device Name as 5105.
 
Again i am very thankfull to you. I am anciously waiting for your reply. Kindly do help me.
 
With Regards:
Ahsan Shehzad.
0 Kudos
Message 3 of 16
(8,704 Views)
Hello Jennifer,
 
        Thanks for your reply. I have found the example written in C-language named "MultiRecordFetchMoreThanAvailableMemory". But perhaps i could not put the device number and faced the error as is.
 
  "Insufficient location information or the device or resource is not present in the system"
 
The attachement contains print screen of error occured.
 
        I am sending you the two examples found by installing NI-Scope. Can you guide me that how can i put the corret model, device, PCI and Slot number while my measurement and automation explorer snapshot is attached here with. I am also confused in the matter that the available example's Readme files seems to be not supporting my device PCI-5105 as no one contains Device Name as 5105.
 
Again i am very thankfull to you. I am anciously waiting for your reply. Kindly do help me.
 
With Regards:
Ahsan Shehzad.
0 Kudos
Message 4 of 16
(8,704 Views)
Ahsan,

I looks like in you are not correctly addressing your device. In the Measurement and Automation Explorer configuration your device name is configured as "Dev3". When you run the code you are entering "NI 5105, Dev3, PCI6Slot2". Try just entering just "Dev3".
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 5 of 16
(8,687 Views)
Good advice Chris. 

This can be a common confusion, so here are a few more details to explain what is going on:

In Measurement and Automation Explorer (MAX) you have the ability to give your card a name or Alias. In this case, PCI-5105 is the card's model number.  However you can name it as you wish.  Typically I use something like "5105" as it describes the hardware and I can remember it easily.  Another common choice is to name it for what it will be used for. 

Currently your PCI-5105 is named Dev3.  This is the default name as Dev1 and Dev2 were already taken.  To change it, simply right-click on your card under DAQmx Devices in MAX and you should see an option to Rename it.

Now run the example again typing only the name you have given it.  This should resolve the error.  If you wish to leave your device as Dev3, you can simply run the example and when prompted, type Dev3 as Chris suggested.

One thing you will want to note is that this example is set up for triggering on channel 0, so you will need to have a signal connected which crosses 0V multiple times to trigger the records.  If you do not, the board will timeout waiting for the trigger.

Finally, thank you for the feedback regarding supported devices listed in the readme.  The NI-5105 is one of our newest digitizers.  It is supported by most of the example programs, and I have filed a corrective action request (CAR# 4IE8C5MI) to get the readme files updated.

Hope this helps.
0 Kudos
Message 6 of 16
(8,684 Views)

Hello Jennifer,

 

            Thank you, you helped me a lot and now I am able to acquire data onto board and then to system. In the example of “MultiRecordFetchMoreThanAvailableMemory” I have added the code for writing the fetched data onto a file, but now I am facing an error that is not very much clear. The error print screen file is attached here with. I think that may be due to data overwritten on board’s memory before fetching. But my requirement is to acquire data to more than the onboard memory.

           

            I am telling you the current situation in which I am acquiring data.

 

The trigger is a pulsed waveform of 10 Khz with 10 percent duty cycle. In time domain the pulse of 10 microseconds comes after every 90 microseconds. The negative edge causes a trigger and digitizer acquires 900 samples at the rate of 10MSPS for the 90 microseconds of the pulse. I am sending you the code of the project as well.

 

An important thing is that if I give a signal of such kind that the period is very large and trigger comes after a long time then this error never occurs a large file can be made.

 

Now I am not able to exactly figure out what the problem is and how can I remove it. Can you help me in this regard that how can I do this? I am confused in the matter that is this limitation of operating system or the board or board memory is not able to give data during writing? Another thing is that I want to know the mechanism of recording on board in case of multiple channels as I am not able to at least get the data approximately equal to on board memory.

 

Kindly do help me and tell me that how can I make a file of 2 or 3 GB on my Hard Drive. I am anxiously waiting for your reply.

0 Kudos
Message 7 of 16
(8,619 Views)
The error that you are seeing is caused by the data filling up the memory on the card faster than you are able to fetch it.  This is likely due to the slow down caused by writing to disk.

The first thing to note is that the memory on the NI-5105 is shared amongst the enabled channels.  For example if you have 16MB of memory, this is  8MB per channel if you are using two channels or 2MB if you are using all eight.  Note that for the NI 5105 each sample takes up 2 bytes, so the number of samples is half of each of these numbers.  So first make sure the unmodified example works at the rate you desire with the number of channels you require.  This will ensure that the PCI/PXI bandwidth can handle the transfer of your data to PC memory.

The next part of your application - writing a large amount of data quickly is commonly called "streaming to disk".  There is a great number of resources to help you with this at ni.com/streaming.  I will summarize a few points to help you get started.

1.  The rate at which you can stream is determined by the slowest component in your system, the "bottleneck".  This could be the PCI/PXI bus, your PC, your hardrive etc.  You can benchmark/test your system to find out what this rate is.  First test how fast you can fetch your data, then test separately how fast you can write data to your hardrive.  For really high data rates a RAID solution may be required.
2.  It is best to use a producer/consumer architecture if working with LabVIEW to allow the fetching and the writing to disk to occur independently.  This can give priority to fetching the data off the module to ensure that an overflow does not occur.
3. For the most efficient way to write to file and fetch from the digitizer, you will want to use the binary format.  This returns and stores unscaled data which has the least overhead.  On the streaming page we have provided some specialized file I/O VIs which have been optimized for streaming.  They are included in the link below (point 4).
4.There are some examples already set up for you to test this, at least with a single channel here: NI SCOPE Stream to Disk ussing Win32 File I/O.

Hope this helps.
0 Kudos
Message 8 of 16
(8,611 Views)

Thanks Jennifer

                      You have helped me a lot. Now i can focus on my limitations. But i have only support for C-language. So i am thinking to use thread for the two process of fetching and streaming to hard drive.

With Regards:

Ahsan Shehzad

0 Kudos
Message 9 of 16
(8,598 Views)
 
 
Hello Jennifer,
 
            N ow i have done all my work but i am facing a problem in the 16-bit binary values fetching. If i set the maximum input span of 2V and apply signal of greater than 2V then i could not see the signal to be cutted or limited. i.e. 16 bit values resolution seems to be only for 6Vp-p signal in any case.
 
Same is the case if i set input allowed span of 0.05V or any other and apply signal of amplitude greater than this.
 
Thanking in advance.
 
With Regards:
Ahsan Shehzad 
0 Kudos
Message 10 of 16
(8,441 Views)