oscilloscope channel DrDAQ

Post your C and C++ discussions here
Post Reply
greyvvolf
Newbie
Posts: 0
Joined: Mon Sep 19, 2011 1:54 pm

oscilloscope channel DrDAQ

Post by greyvvolf »

Hi,
I have a problem with communication with oscilloscope channel in DrDAQ. I'm working with builder C++ and i use data collection in single mode.I don't have problems with other channels but channel nr 4 (oscylloscope) doesn't work. I use tutorial from pico website and documentation.

Hitesh

Re: oscilloscope channel DrDAQ

Post by Hitesh »

Hi grevvolf,

Does the oscilloscope channel work when you enable it in the PicoScope software?

Please send in your code and we can take a look.

Thanks,

greyvvolf
Newbie
Posts: 0
Joined: Mon Sep 19, 2011 1:54 pm

Re: oscilloscope channel DrDAQ

Post by greyvvolf »

Yes, oscilloscope channel work with picoscope. Function with streaming mode:

Code: Select all

bool TdrDaq::CollectStream(int nr_ch){
        unsigned int i;
        short nChannels = 1;    //1
        unsigned long nSamples = 100000;
        unsigned long nSamplesPerChannel = 100000;
        unsigned long nSamplesCollected;
        short samples[100000];
        unsigned long usForBlocks =100000;    //10000
        unsigned long triggerIndex = 0;
        short nLines=0;
        short isReady;
        int licznik = 0;
        USB_DRDAQ_INPUTS channel = USB_DRDAQ_CHANNEL_SCOPE;//(4)
        time_start = timeGetTime();
        m_statusDAQ = UsbDrDaqSetTrigger(m_handleDAQ,FALSE,0,0,0,0,0,0,0);   
        m_statusDAQ = UsbDrDaqSetInterval(m_handleDAQ,&usForBlocks,nSamples,&channel,nChannels);      
        m_statusDAQ = UsbDrDaqRun(m_handleDAQ,nSamples,BM_SINGLE);    

        isReady=0;
        while(isReady == 0){
                m_statusDAQ = UsbDrDaqReady(m_handleDAQ,&isReady);
        }
        while(licznik < 1){
                nSamplesCollected = nSamplesPerChannel;
                m_statusDAQ = UsbDrDaqGetValues(m_handleDAQ,samples,&nSamplesCollected,&m_overflowDAQ,&triggerIndex);
                if(nLines == 20) nLines = 0;
                else nLines++;

                for(i=0;i
for other channel it's work great.

Hitesh

Re: oscilloscope channel DrDAQ

Post by Hitesh »

Hi,

What is the specific error you are getting?

If you are looking to collect data in streaming mode, you need to change BM_SINGLE to BM_STREAM in the call to UsbDrDaqRun:

Code: Select all

m_statusDAQ = UsbDrDaqRun(m_handleDAQ, nSamples, BM_STREAM);  
Also, the channel variable might need to be declared as an array, even though it has a single element.

Best wishes,

Post Reply