channel A and B

Post your C and C++ discussions here
Post Reply
fernandoluiz
Newbie
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

channel A and B

Post by fernandoluiz »

how to do acquisition in both channels A and B
i'm using picoscope 3000.

Hitesh

Re: channel A and B

Post by Hitesh »

Hi FernandoLuiz,

If you are looking to implement this in code, then please follow this sequence from the PicoScope 3000 series programmer's guide (you need to set both Channel A and B, and set the data buffers) and refer to the PS3000con.c example in the Software Development Kit:
  • Open the scope unit.

    Code: Select all

    unitOpened.handle = ps3000_open_unit ();
    
  • Set up the input channels with the required voltage ranges and coupling mode

    Code: Select all

    for (i = 0; i < unitOpened.noOfChannels; i++)
    	{
                 ps3000_set_channel ( unitOpened.handle, PS3000_CHANNEL_A + i, 
                 unitOpened.channelSettings[PS3000_CHANNEL_A + i].enabled,
                 unitOpened.channelSettings[PS3000_CHANNEL_A + i].DCcoupled,
                 unitOpened.channelSettings[PS3000_CHANNEL_A + i].range);
    	}
    
    Here the code sets up each channel - note that you must ensure that Channel A and B are enabled. Channel C and D only need to be enabled if you have a 4 channel Oscilloscope - this can be done via the channelSettings struct.
  • Set up triggering .

    Code: Select all

    // Disable trigger
    ps3000_set_trigger ( unitOpened.handle, PS3000_NONE, 0, PS3000_RISING, 0, auto_trigger_ms ); 
  • Start capturing data. (See Sampling modes , where programming is discussed in
    more detail.)

    Code: Select all

    ps3000_run_block ( unitOpened.handle, no_of_samples, timebase, oversample, &time_indisposed_ms );
    
  • Wait until the scope unit is ready.

    Code: Select all

    while ( !ps3000_ready ( unitOpened.handle ) )
        {
             Sleep ( 100 );
        }
    
  • Stop capturing data.

    Code: Select all

    ps3000_stop ( unitOpened.handle );
    
  • Copy data to the buffers.

    Code: Select all

    ps3000_get_values ( unitOpened.handle, unitOpened.channelSettings[PS3000_CHANNEL_A].values,  
                                   unitOpened.channelSettings[PS3000_CHANNEL_B].values, 
                                   unitOpened.channelSettings[PS3000_CHANNEL_C].values,
                                   unitOpened.channelSettings[PS3000_CHANNEL_D].values, 
                                   &overflow, no_of_samples );
    
    Note that the function writes data to all the buffers for Channels A, B, C and D.
  • Close the scope unit.

    Code: Select all

    ps3000_close_unit ( unitOpened.handle );
    
I hope this helps.

fernandoluiz
Newbie
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: channel A and B

Post by fernandoluiz »

i make this, but the program stay in loop while(!ps3000_ready ( unitOpened.handle ))

fernandoluiz
Newbie
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: channel A and B

Post by fernandoluiz »

when i call ps3000_get_timebase(unitOpened.handle,timebase,no_of_samples,&time_interval,&time_units,oversample,&max_samples);

the max_samples returns 0

Hitesh

Re: channel A and B

Post by Hitesh »

when i call ps3000_get_timebase(unitOpened.handle,timebase,no_of_samples,&time_interval,&time_units,oversample,&max_samples);
What values are you passing in for each variable? What is the output from the actual function? It's possible that this is causing the programme to stay in the loop as the unit will not be ready.

Regards,

fernandoluiz
Newbie
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: channel A and B

Post by fernandoluiz »

o already solutioned the problem with the function ps300_get_timebase()

Hitesh

Re: channel A and B

Post by Hitesh »

Hi,

Is your programme working now?

fernandoluiz
Newbie
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: channel A and B

Post by fernandoluiz »

yes, it works now

Post Reply