03-20-2011 07:28 PM
Hi
I am working with the pxi 6542.I am currently using a start trigger from 1st clock cycle when pattern matches and pause trigger at the end of the 32nd clock cycle when pattern does not match.
However, I would like to acquire data from 16th clock cycle until 32nd clock cycle. Right now, with the current setup of start and pause trigger that I have, I am acquiring all 32 samples which I would not like to do.
Please suggest me some way by which I could read from 16th clock cycle to 32nd clock cycle.
I have attached the timing diagram for better understanding.
Thanks in advance for your help!
03-21-2011 09:29 AM
Testough,
Have you tried the "fetch offset" property? This will still acquire the 32 samples and store them into on board memory but if you set the offset to 16, the fetch vi will return an array that starts on the 16th sample.
Short Name: FetchOffset
Property of niHSDIO
Specifies the offset in samples to start fetching acquired waveform data. The offset is applied relative to the Fetch Relative To position. Offset can be a positive or negative value.
If the specified offset would cause the fetch to occur before the start of the waveform or exceed the end of the waveform, NI-HSDIO returns a data overwrite error.
This property is valid only for acquisition sessions.
The following table lists the characteristics of this property.
Datatype | |
Permissions | Read/Write |
High-level VIs | N/A |
Channel-based | No |
Resettable | No |
03-21-2011 11:18 AM
Hi Ryan
Thanks for your reply!
I tried using the fetch offset property but still it acquires only 32 samples. Any thoughts on this?
03-21-2011 11:27 AM
Hey testough,
Have you tried changing the number of "Samples to Read" input into the Fetch Waveform VI?
Regards,
DJ L.
03-21-2011 11:34 AM
I am trying to read 32 samples (based on my trigger configuration), but I would like to transfer samples 16 - 32 to the PC memory.
03-21-2011 11:45 AM
Hey testough,
You can set up the HSDIO device to read 1000 samples into the onboard memory of the device, but when you Fetch them off of the device into the PC memory, you can configure which samples you want to fetch. So if you want to fetch samples 8 - 16, you can set the fetch offset to be 8, and the number of samples to fetch to also be 8. This does not mean that the HSDIO device will only acquire 8 samples, it will still acquire all 1000 samples, but it means that you are deciding how many samples to fetch from the HSDIO device into PC memory. Let me know if you are still confused by this. Thanks.
Regards,
DJ L.
03-21-2011 12:04 PM
Thanks for your help DJ.I am clear with your explanation but when I change the samples to read to 8 and fetch offset also to 8, am not able to get the data out from the fetch.vi.The data array is empty.
03-21-2011 03:11 PM
Hey testough,
Can you send me your sample code so I can take a look at it?
Thanks,
Brandon G
Applications Engineering
03-21-2011 04:24 PM
Hey Brandon
I figured out the problem of empty array and fixed it.
When I make the block transfer as 1 for my data, fetch offset works as expected.But,if I have my block transfer as 128, offset by 16 only offsets first 16 bits. So how can I use fetch offset with block transfer?
My aim is to offset first 16 bits in every sample of the block transfer.
Thanks in advance for your help.
03-22-2011 10:03 AM
Hi testough,
I am a little unclear of your explanation. Are you trying to offset the samples you're fetching from the onboard memory, or are you trying to bit shift each sample by 16 bits? Can you send me your snippet of code so I have a better understanding of what we're trying to do? Also, have you by chance seen the Dynamic Acquisition with Fetch Options.vi example in NI Example Finder? This maybe a good starting point to see if your code is structured similarly.
Thanks!
Brandon G