02-20-2014 05:18 AM
Hi Chao,
I cannot fully understand: after modifying the example to use AnalogMultiChannelWriter, did you try to call AnalogWaveform<double> waveform = AnalogWaveform<double>.FromArray1D(fGen.Data) with or without the square brackets?
Which error did you get?
Bye,
Licia
02-20-2014 05:42 AM
OK let me explain in this way:
I don't know how to handle this array (square brackets). If I just leave it without square brackets,
with error:
If I add square brackets like:
I got error as:
02-20-2014 10:14 AM
Hi Chao,
since you are addressing two analog output channels, you need to create an array of waveform of two elements, to be passed to function writer.WriteWaveform.
So, you could try to use AnalogWaveform<TData>[] AnalogWaveform<TData>.FromArray2D(TData[,]) in order to create an array of analog waveforms from a 2D array of data.
(TData is data type, so double in your case).
The 2D array can be composed by two signals (they can also differ) generated with FunctionGenerator.
I hope this helps!
Bye,
Licia
02-20-2014 11:05 AM
Hi Licia!
I think that would probably help, but I'm really not capable to deal with 2D array argument of FromArray2D(TData[,]).
Could you give me the help of that? Thank you in advance.
Chao
02-21-2014 02:31 AM
02-21-2014 05:55 AM
Hi Licia,
I modified the code of FunctionGenerator and got a 2D array as the argument for FromArray2D and got no more error. But when I run the program it always prompts me that I have Nullexception to handle with. After handling one there comes another. I've really no idea any more. I'd like to ask you if it's possible for you to fix the problems of my code? I mean could I send it to you? Thanks
Chao
02-21-2014 07:11 AM
Hi Chao,
unfortunately we don't have Visual Studio so I won't be able to run your code.
Bye,
Licia
02-21-2014 07:13 AM
OK I see. That's OK. Thanks anyway!
Chao