Hello,
>
if(X(var1)=='1')>
Y(var1)=1;>
if(X(var1)=='0')>
Y(var1)=0;This code will work as well, but it will be much less efficient than the code I posted. Also, you need an "end" statement at the end of each if statement.
I don't think I understand the problem you are asking about. Everything looks good to me. In the MathScript node, you have Fs (a real number), ts (a real number), Tb (a real array), and Fm (a real number coming from a DBL input). In computing s1, you take the sine of a real array which produces a real array. Then you output this real array from the MathScript node and convert it to a complex array. When you split this complex array into real and imaginary parts, you see that the real part is the same as your original real array and the imaginary part is all zeros. This is by definition what happens when you convert a real array to a complex array.
Then it seems like you send the complex array to the FPGA and examine the real and imaginary parts. You note again that the real part is the same as the original real array and the imaginary part is all zero. This is not a mistake. This is expected behavior when converting a real number to a complex number.
Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments