LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create arbitrary waveform with PXI-5412 Arbitrary Waveform Generator in LabVIEW VI?

So I tried using the DBL instance of the UtilCreate function and I was able to generate the signal successfully in the VI with 1048576 samples. However, when I attempt to read from the .dat binary file which also has 1048576 samples, I still get the error, 

"Requested waveform length is invalid, because the number of samples is not an integer multiple of the waveform length increment.

Requested Value: 2
Waveform Length Increment: 4

Status Code: -200400"

I can't seem to find what that error means online.

0 Kudos
Message 11 of 17
(928 Views)

Hi Trekkie,

 

how are you creating this binary file?

Can you attach the VI used for creation as well as the created file? (All put into just one ZIP file!)

 


@Trekkie123 wrote:

Status Code: -200400"

I can't seem to find what that error means online.


No need to search online when you can simply get an explanation from the error indicator!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 17
(923 Views)

Here is the VI I used to get the binary file as well as the csv and binary file.

0 Kudos
Message 13 of 17
(901 Views)

Hi Trekkie,

 

did you ever checked the filesize of your dat file?

 

The way you created this file it contains just one single DBL value, showing a filesize of just 8 bytes!

The error was: your CSV files uses the comma as separator, but you forgot to set this in the ReadDelimitedSpreadsheetFile function!

 

When I set the delimiter char correctly the file is created correctly, showing a filesize of 8388608 bytes (or exactly 8MiB)!

 

Please do the same and then test your FGEN routine again…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 17
(888 Views)

Aah, you were right it generated correctly now, though after setting the delimiter, now I receive this error (see attached screenshot). Though I know that all the data in the csv was within -1 to 1, I'm not sure what caused a value of 1.173827e204.

0 Kudos
Message 15 of 17
(882 Views)

Hi Trekkie,

 

change the endianness to use LabVIEW default when creating the binary file…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 17
(870 Views)

That worked for the most part, although now it gives the same error except the value that is too large is 1.033500. Though if I have to I'll just subtract .0335 from every value in the data set to compensate.

0 Kudos
Message 17 of 17
(866 Views)