Fastest way to get sample memory out of Rigol scope???....... - Page 1
Forum section: electronics / projects

author: Smokey
author_rank: Super Contributor
timestamp: November 26, 2015, 06:10:14 am
content: 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/ds1054zCan the labview drivers do better? Is USB faster than ethernet?

author: Gribo
author_rank: Frequent Contributor
timestamp: November 26, 2015, 12:38:00 pm
content: 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.

author: Karel
author_rank: Super Contributor
timestamp: November 26, 2015, 12:47:18 pm
content: Last time I tried, DSRemote downloaded 24Mpts in 90 seconds (one channel).

author: Smokey
author_rank: Super Contributor
timestamp: November 26, 2015, 05:33:46 pm
content: 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.

author: Karel
author_rank: Super Contributor
timestamp: November 26, 2015, 06:38:27 pm
content: Quote from: Smokey on November 26, 2015, 05:33:46 pmNo, it does not.

author: Smokey
author_rank: Super Contributor
timestamp: November 26, 2015, 07:49:36 pm
content: 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.

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 06, 2016, 03:26:48 pm
content: 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 againhmm, feel free to comment ... FWIWCode:'return data length given by visa/dso. dat must be preallocated with enough (lpLength) amount of memoryPublic Function GetData(chId As Long, dat() As Byte, ByVal lpLength As Long) As LongConst TMC_SIZE = 11 'base-0 array index valueConst MAX_BLOCK = 125000Dim datPtr As LongDim datIdx As LongDim blockSize As Long'multiple block readDim sta As LongDim enn As LongDim lft As LongDim req As LongDim fCancel As BooleanIf Not Connected Then Exit Function'check index and send commandIf chId < CH1_IDX And chId >= MATH_IDX Then Exit Function'make sure dat is allocatedIf lpLength <= TMC_SIZE Then Exit FunctiondatPtr = VarPtr(dat(0))dat(0) = 0'get the return value. older DS1000E FW (TMC_SIZE = 0)If protocol = 1 ThenSendCommand ":WAV:DATA? CHAN" + CStr(chId)viVScanf hWnd, "%t", datPtrGetData = strLength(dat, lpLength)Exit FunctionEnd If'newer DS1000Z FW. check if we are reading multiple block internal memoryIf TrigStat = "STOP" ThenIf Left(MemLength, 4) <> "NORM" Then'can read at onceIf lpLength <= MAX_BLOCK ThenSendCommand ":WAV:STOP " + CStr(lpLength)'need multiple readElseSendCommand ":WAV:SOUR CHAN" + CStr(chId)lft = lpLengthDo Until lft <= 0sta = enn + 1If lft >= MAX_BLOCK Thenreq = MAX_BLOCKElsereq = lftEnd Ifenn = sta + req - 1SendCommand ":WAV:STOP " + CStr(enn)SendCommand ":WAV:START " + CStr(sta)SendCommand ":WAV:DATA?"viVScanf hWnd, "%t", datPtrblockSize = getTmcDataSize(dat(), datIdx)'we have copied dataIf blockSize > 0 ThenCopyMemory dat(datIdx), dat(datIdx + TMC_SIZE), blockSizedatIdx = datIdx + blockSizedatPtr = VarPtr(dat(datIdx))'partial data copied, offset ennIf blockSize < req Then enn = enn - (req - blockSize)lft = lft - blockSize'callback for copy progressRaiseEvent Downloading(blockSize, lpLength - lft, fCancel)If fCancel Then Exit Do'zero data copied, quitElseExit DoEnd IfLoop'reset memory positionIf sta > 1 ThenSendCommand ":WAV:START 1"SendCommand ":WAV:STOP " + CStr(RIG_SCREEN_RES_V2)End IfGetData = lpLength - lftExit FunctionEnd IfEnd IfEnd If'reading single block at onceSendCommand ":WAV:SOUR CHAN" + CStr(chId)SendCommand ":WAV:DATA?"viVScanf hWnd, "%t", datPtrblockSize = getTmcDataSize(dat(), datIdx)If blockSize > 0 Then CopyMemory dat(0), dat(TMC_SIZE), blockSizeGetData = blockSizeEnd Function'send visa command to rigol, return -1 if not connectedPublic Function SendCommand(cmd As String) As LongSendCommand = -1If Not Connected Then Exit FunctionSendCommand = viVPrintf(hWnd, cmd + Chr(10), 0)End Function

author: uncle_bob
author_rank: Unknown
timestamp: February 06, 2016, 06:24:09 pm
content: Quote from: Mechatrommer on February 06, 2016, 03:26:48 pmHiJust 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

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 06, 2016, 07:49:51 pm
content: 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...