I've attached an adapted version of my not working VI so far (I've removed the analysis section that takes place after aquisition). Before attempting to implement rapid block mode, I had already modified the example to always use channel A as it's own trigger, and to only display the acquired waveforms after acquisition of a fixed number of waveforms was complete. This all worked fine until trying to implment rapid block mode.
Thanks for your reply. As far as I can tell I'm doing everything it says in the Programmer's Guide, although my understanding of C is poor so I'm finding it difficult to implement the C examples provided in the document as LabVIEW code.
One specific problem: the Programmer's Guide states to use ps4000BlockReady for Rapid Block Mode. I couldn't find this, and am instead using IsReady-2 (the function used in the LabVIEW block mode example). Is this OK? It works fine in bulk mode but hasn't been in rapid bulk mode (although this could be caused my something else).
I've attached an updated version of the VI, saved for version 8.2, although it did give me 33 warnings when it saved so not sure if it will open.
Why is it that you have executed getvaluesbulk one time for each waveform (in the for loop) and not just once so that it retrieves all the waveforms at once as suggested in the programmers guide, where it sets the from segment index and to segment index differently?
I only ask because I am trying to use GetValuesTriggerTimeOffsetBulk64 so that I can measure the time elapsed between each trigger. I have tried it two ways:
1) the same way that you implemented getvaluesbulk (in a loop, once for each waveform) (see loop.jpg attached)
2) without a loop, executing once for all memory segments from zero to numberofcaptures-1 (see noloop.jpg attached).
With both methods, I only get a single time value, presumably for the first memory segment, in the first element of the array. Do you know what I'm doing wrong?
Thanks again for your help, much appreciated.
Christian.
christianbaker wrote:Why is it that you have executed getvaluesbulk one time for each waveform (in the for loop) and not just once so that it retrieves all the waveforms at once as suggested in the programmers guide, where it sets the from segment index and to segment index differently?
Good question! I just did it like this because it seemed to be the easiest way to modify the existing example. But you are right, it is only necessary to call it once with the appropriate segment indicies.
Regarding ps4000GetValuesTriggerTimeOffsetBulk64, you are calling it correctly but there is a bug in the driver. I have attached a fixed version to this post. Bear in mind that this is not a official fully-tested release. However, it should work fine.
Thanks alot. I'm having a few problems still though
Is the new ps4000.dll supposed to entirely replace the old ps4000.dll?
If I only use the new ps4000.dll for GetValuesTriggerTimeOffsetBulk64, and keep the rest of the functions loading from the old ps4000.dll and ps4000wrap.dll (I had to rename the new ps4000.dll to get labview to do this), then GetValuesTriggerTimeOffsetBulk64 gives me error C (invalid handle).
If I replace the old ps4000.dll with the new one, so that all functions (except those from ps4000wrap.dll) are loaded from the new ps4000.dll, then the program never gets passed the IsReady loop (which is from ps4000wrap.dll).
The third thing I tried was to change all the functions from ps4000wrap.dll so that they were also loaded from the new ps4000.dll (this meant using functions with a slightly different name, e.g. 'ps4000RunBlock' from ps4000.dll instead of 'RunBlock' from ps4000wrap.dll). However, IsReady only seems to exist in ps4000wrap.dll, so couldn't be changed (even though the documetation states to use a function called ps4000BlockReady from ps4000.dll which doesn't exist). As above, the program never gets passed the IsReady loop.
Do you know which of the above is the correct approach and why it isn't working? Also, almost all functions seem to have two versions, one with a '-2' appended to it and one without. Do you know which I should be using?
Sorry for the long reply but I hope more detail makes it easier for you to help.
The new version of ps4000.dll should be used to replace the existing one. You say that when you do this, the VI is not exiting the isReady loop. The wrapper DLL also calls ps4000.dll and it could be that LabVIEW and the wrapper are using different copies of ps4000.dll. Make sure your VI and the two DLLs are in the same folder.
Process Explorer is a useful tool for seeing which DLLs are loaded:
ps4000BlockReady is not a driver function, it is a function that the user provides (by passing a function pointer to ps4000RunBlock) and the driver calls when it is ready. LabVIEW doesn't support function pointers, which is why we use the wrapper DLL. The source code for the wrapper is included in the SDK (ps4000wrap.c).
Thanks that's cleared things up. I managed to get some numbers out of GetValuesTriggerTimeOffsetBulk64 using the new DLL, but I'm not sure how to use them. Some of them are negative and they seem to change randomly between timeUnits.
I implemented it like this, can you see what's going wrong?:
Not sure I really understand timeUnits, and I think that might be the problem. Thanks for all your help so far, I'm getting there slowly!
GetValuesTriggerTimeOffsetBulk64 returns the time difference between the first sample in your block and the actual trigger event (crossing of the threshold) using linear interpolation.
This can be positive or negative as the first sample in your block will always be the one closest to the trigger event.
Time units gives you the units for the offset time returned.
0: Femtoseconds
1: Picoseconds
2: Nanoseconds
etc.
Hi,
I have been trying to speed up the Rapid Block Mode example provided by Pico. In their example, the ps4000GetValueBlock is called for each segment. Since this API call allows for selecting fromSegmentIndex and toSegmentIndex, it seems possible to obtain all the data in a single call instead of calling the API as many times as there are segments/captures.
Has any one tried this? Could Pico provide an example for this?
Thx.
Laurent.