EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: Smokey on November 26, 2015, 06:10:14 am
-
What's the fastest way to dump the full 24Mpoints sample memory to a PC? I'm up for using any interface, driver, and OS.
Using the python library and Ethernet, it takes about 65 seconds to transfer 12M. That's the best I have done so far.
https://github.com/pklaus/ds1054z
Can the labview drivers do better? Is USB faster than ethernet?
-
LV won't help you in this case, neither will USB. The SCPI communication protocol (not very efficient) sits on top of TCP, which also has a certain overhead. If the Rigol scope supports some sort of binary protocol over UDP, you might be able to get better results.
-
Last time I tried, DSRemote downloaded 24Mpts in 90 seconds (one channel).
-
Cool. I was not getting very good performance from dsremote but i was running it on a virtual machine so that might have had something to do with it. Dsremote uses the python library too. Dunno.
-
Dsremote uses the python library too.
No, it does not.
-
The python lib github listed dsremote and i just figured that it was under the hood. Ill have to see what the difference is between the two transfer functions.
-
maybe not that stellar and not your cup of tea, just for the sake of sharing, others may benefit. Windows environment, my testing construct program... 62.5 Seconds copying 24MB points... below is the code snip in VB, not your cup of tea again :P hmm, feel free to comment ... FWIW
'return data length given by visa/dso. dat must be preallocated with enough (lpLength) amount of memory
Public Function GetData(chId As Long, dat() As Byte, ByVal lpLength As Long) As Long
Const TMC_SIZE = 11 'base-0 array index value
Const MAX_BLOCK = 125000
Dim datPtr As Long
Dim datIdx As Long
Dim blockSize As Long
'multiple block read
Dim sta As Long
Dim enn As Long
Dim lft As Long
Dim req As Long
Dim fCancel As Boolean
If Not Connected Then Exit Function
'check index and send command
If chId < CH1_IDX And chId >= MATH_IDX Then Exit Function
'make sure dat is allocated
If lpLength <= TMC_SIZE Then Exit Function
datPtr = VarPtr(dat(0))
dat(0) = 0
'get the return value. older DS1000E FW (TMC_SIZE = 0)
If protocol = 1 Then
SendCommand ":WAV:DATA? CHAN" + CStr(chId)
viVScanf hWnd, "%t", datPtr
GetData = strLength(dat, lpLength)
Exit Function
End If
'newer DS1000Z FW. check if we are reading multiple block internal memory
If TrigStat = "STOP" Then
If Left(MemLength, 4) <> "NORM" Then
'can read at once
If lpLength <= MAX_BLOCK Then
SendCommand ":WAV:STOP " + CStr(lpLength)
'need multiple read
Else
SendCommand ":WAV:SOUR CHAN" + CStr(chId)
lft = lpLength
Do Until lft <= 0
sta = enn + 1
If lft >= MAX_BLOCK Then
req = MAX_BLOCK
Else
req = lft
End If
enn = sta + req - 1
SendCommand ":WAV:STOP " + CStr(enn)
SendCommand ":WAV:START " + CStr(sta)
SendCommand ":WAV:DATA?"
viVScanf hWnd, "%t", datPtr
blockSize = getTmcDataSize(dat(), datIdx)
'we have copied data
If blockSize > 0 Then
CopyMemory dat(datIdx), dat(datIdx + TMC_SIZE), blockSize
datIdx = datIdx + blockSize
datPtr = VarPtr(dat(datIdx))
'partial data copied, offset enn
If blockSize < req Then enn = enn - (req - blockSize)
lft = lft - blockSize
'callback for copy progress
RaiseEvent Downloading(blockSize, lpLength - lft, fCancel)
If fCancel Then Exit Do
'zero data copied, quit
Else
Exit Do
End If
Loop
'reset memory position
If sta > 1 Then
SendCommand ":WAV:START 1"
SendCommand ":WAV:STOP " + CStr(RIG_SCREEN_RES_V2)
End If
GetData = lpLength - lft
Exit Function
End If
End If
End If
'reading single block at once
SendCommand ":WAV:SOUR CHAN" + CStr(chId)
SendCommand ":WAV:DATA?"
viVScanf hWnd, "%t", datPtr
blockSize = getTmcDataSize(dat(), datIdx)
If blockSize > 0 Then CopyMemory dat(0), dat(TMC_SIZE), blockSize
GetData = blockSize
End Function
'send visa command to rigol, return -1 if not connected
Public Function SendCommand(cmd As String) As Long
SendCommand = -1
If Not Connected Then Exit Function
SendCommand = viVPrintf(hWnd, cmd + Chr(10), 0)
End Function
-
maybe not that stellar and not your cup of tea, just for the sake of sharing, others may benefit. Windows environment, my testing construct program... 62.5 Seconds copying 24MB points... below is the code snip in VB, not your cup of tea again :P hmm, feel free to comment ... FWIW
Hi
Just looking at this from the outside:
If it's running 100Mb ethernet, you get (at most) 6Gb in 60 seconds. With 100% efficiency ( no overhead) that comes out to 750 MB. If you get 24M points (and they are 2 bytes each) you are grabbing 48 MB of data. Either there is a lot more overhead (like 15X), or the LAN speed is not anywhere near your limiting factor.
Bob
-
sorry i didnt mention i thought its understandable. thats a USB2 connection using visa32.dll driver, no ethernet, i dont play ethernet. and its a plain 24 Mega Bytes, not 24 Mega Words... fwiw...