Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.
this is part of the code examples sticky: http://www1.tek.com/forum/viewtopic.php?f=8&t=1789
I checked the output and compared with a correct .wfm
So i've tweak abit so it save properly.
The data needs to be in binary and \n seems to create a new line in the data
Hope it helps anyone trying to find this
Code: Select all
%% variables samples = 262000; filename = 'O_262Kpts.WFM'; count = 1; %% create test waveform wave = -2.*rand(samples, 1)+1; sample_bytes = num2str(samples*5,'%d'); length_bytes = num2str(length(sample_bytes)); header = ['#' length_bytes sample_bytes]; %% file operations fid = fopen(filename, 'wt'); fwrite(fid, 'MAGIC 1000'); fprintf(fid, '\n'); fclose(fid); fid = fopen(filename, 'a'); fwrite(fid, header); while (count <= samples) fwrite(fid, wave(count), 'float'); fwrite(fid, ' '); count = count + 1; end fwrite(fid, 'CLOCK 1.10e+8'); fclose(fid); fid = fopen(filename, 'at'); fprintf(fid, '\n'); fclose(fid);
i define what is correct as what accomplishes your task. i'm glad you were able to find a solution and thank you for sharing.
Will it cause conflict if i run the file on a AWG?
I havent tested in on a physical AWG just checked with ArbXpress for verification.
Who is online
Users browsing this forum: No registered users and 3 guests