Test and Measurement Forum

usb connection

Post your C and C++ discussions here

usb connection

Postby fernandoluiz » Mon Feb 21, 2011 6:14 pm

sometime my picoscope lock your connection with the PC and i would like of know if exixsts any sample in C/C++ that cut the this connection of usb port and after reset this connection

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

Re: usb connection

Postby ziko » Tue Mar 01, 2011 2:31 pm

Hi what device are you using and is does this happen when using our software?

Kind regards
Ziko

Technical Specialist
ziko
Zen Master
Zen Master
 
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Re: usb connection

Postby fernandoluiz » Wed Mar 02, 2011 2:02 pm

i'm using pico3205 e pico3206, sometimes its broke your connection with the pc when i used my software and the software picoscope6.because i would like developing a software that cut the connection and after restart that connection
fernandoluiz
Newbie
 
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: usb connection

Postby Chris » Fri Mar 25, 2011 2:21 pm

If you can let us know what you are doing when the connection gets broken, we can look into the issue.
Chris
Site Admin
Site Admin
 
Posts: 169
Joined: Tue Aug 17, 2010 9:00 am
Location: St. Neots

Re: usb connection

Postby fernandoluiz » Tue Jun 21, 2011 7:48 pm

when the broken, i disconnect the hardware and then i put again, and the hardware return the work.but the hardware should not stop.
fernandoluiz
Newbie
 
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: usb connection

Postby Martyn » Fri Jul 15, 2011 11:08 am

Without further details of exactly what is happening when the unit stops responding to your software it is difficult to offer a solution to your problem.

If you wanted to create a workaround you may be able to add a watchdog to your application which will call CloseUnit to close the connection to the device and then create a new handle to the device by calling OpenUnit.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: usb connection

Postby fernandoluiz » Fri Nov 11, 2011 5:45 pm

how i do this
fernandoluiz
Newbie
 
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: usb connection

Postby Martyn » Mon Nov 14, 2011 1:18 pm

Periodically ask the scope for some simple information, for example device serial number, and if you don't get any data back just close the unit before opening it again. I can't be more specific without more details of your software so can't guarantee that this would work.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: usb connection

Postby stefanwiesner » Wed Nov 16, 2011 8:52 am

I have the same problem with my picoscope 2203. It sometimes (it is hard to reproduce and find a pattern, sometimes after 10 minutes, sometimes after 2 days) looses the connection to the PC, meaning the picoscope is not found by any application (picoscope 6 software, or my own little app) anymore. In order to get it back, i have to unplug the usb connection and plug it again, or restart the PC.

My little app, that causes the crash does the following:

Code: Select all
// activate wave generator
ps2000_set_sig_gen_built_in (...)

ps2000_set_channel(m_handle, PS2000_CHANNEL_A, true, false, rangeps)
ps2000_set_trigger(m_handle, PS2000_NONE, 0, 0, 0, 0)

// start streaming
m_samplingInterval = 1;
m_localBufferSize = 250000;
ps2000_run_streaming_ns (m_handle, m_samplingInterval, PS2000_US, m_localBufferSize,  0, 1, 150000)

// read data
while (ps2000_get_streaming_last_values(m_handle, ps2000FastStreamingReady) == 0)
{
     // copy data from the buffer and do some stuff
}


It basically streams the whole time data from the picoscope and does some anlysis on the data.

Are there some known issues with USB 1.0, 2.0 or 3.0? Do I have to set something special when i do long time streaming?

Thanks already in advance for your help, best
Stefan
stefanwiesner
Newbie
 
Posts: 0
Joined: Sat Feb 27, 2010 1:51 pm

Re: usb connection

Postby fernandoluiz » Thu Nov 17, 2011 11:27 am

in my program i use run_block() and i have the some problem
fernandoluiz
Newbie
 
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: usb connection

Postby Martyn » Fri Nov 18, 2011 12:53 pm

Stefan, Do you know where your application gets stuck ?

Fernando, I have replied through our helpdesk ticketing system.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: usb connection

Postby fernandoluiz » Fri Nov 18, 2011 4:23 pm

yes i already see your email
fernandoluiz
Newbie
 
Posts: 0
Joined: Wed Dec 15, 2010 6:13 pm

Re: usb connection

Postby stefanwiesner » Mon Nov 21, 2011 3:13 pm

Unfortunately I cant see where and when the program gets stuck and it is hard to reproduce. What basically happens, is that I lose the usb connection to the picoscope and the call to get_streaming_last_values_ns gets stuck. When I then restart the PC I sometimes get the windows message, that the picoscope could not be initialized. After switching off and on the PC a second time the picoscope is detected again.

Is it possible, that streaming with one microsecond sampling interval over a longer period of time is too much for the picoscope?
stefanwiesner
Newbie
 
Posts: 0
Joined: Sat Feb 27, 2010 1:51 pm

Re: usb connection

Postby Martyn » Mon Nov 21, 2011 3:53 pm

Streaming at that rate shouldn't cause an issue for the device, so the problem is more likely to reside with the use of resources by the driver and/or the application, particularly if other applications/services are running on the PC. One suggestion would be to disable as much as possible, including removing unused USB hardware and see if the time before lock up changes significantly.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to C and C++

Who is online

Users browsing this forum: No registered users and 1 guest