Test and Measurement Forum

channel A and B

Post your C and C++ discussions here

channel A and B

Postby fernandoluiz » Mon Dec 12, 2011 3:30 pm

how to do acquisition in both channels A and B
i'm using picoscope 3000.
fernandoluiz
Newbie
 
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: channel A and B

Postby Hitesh » Mon Dec 12, 2011 5:07 pm

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.
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: channel A and B

Postby fernandoluiz » Wed Dec 14, 2011 11:07 am

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

Postby fernandoluiz » Wed Dec 14, 2011 1:21 pm

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

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

Re: channel A and B

Postby Hitesh » Wed Dec 14, 2011 2:41 pm

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,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: channel A and B

Postby fernandoluiz » Thu Dec 15, 2011 1:25 pm

o already solutioned the problem with the function ps300_get_timebase()
fernandoluiz
Newbie
 
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: channel A and B

Postby Hitesh » Mon Dec 19, 2011 1:31 pm

Hi,

Is your programme working now?
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: channel A and B

Postby fernandoluiz » Wed Feb 01, 2012 5:27 pm

yes, it works now
fernandoluiz
Newbie
 
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm


Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests