From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Current Waveform position Query with ArbWaveForm (niFgen)

I'm using NIFgen to setup an arbitrary waveform, load the file using CreateWaveformFromFileI16 then I start generating it. Is there a way to query for current position in the waveform or available space in waveform? I know I can query for available space in waveform when using the StreamingWaveform handle. Can a similar query be performed when using the ArbWaveformHandle? Thanks.

0 Kudos
Message 1 of 3
(5,364 Views)

Hi ravxmm,

 

Thanks for posting. You may be able to use the "Max Waveform Size" property to determine what space you have available in your memory. According to the NI Signal Generators Help, this attribute will return a value that will be affected by the amount of memory available on the card. Let me know if this property will work for you, thanks!

 

Regards,

Joe S.

0 Kudos
Message 2 of 3
(5,346 Views)

Hi ravxmm,

 

'Max Waveform Size' will tell you the maximum number of samples available in the device memory if you were to write new waveforms to it.

 

When you use CreateWaveformFromFileI16, NI-FGEN driver will allocate the waveform and write it to the device memory. The allocation size will be the number of samples in the file, which also means that once it writes the waveform, by the end of that function call, there will be no more space left in that waveform. In other words, the current 'write' position is at the end of the waveform. You can overwrite this write position by calling niFgen Set Wavefrom Next Write Position. I'm not sure if this is what you want to do though..

 

If you want to know the current position, as in which samples are being generated, you can use the markers. Please refers to the documentation on how to use them, or post back here if you have any questions.

 

Thanks!

0 Kudos
Message 3 of 3
(5,324 Views)