Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Addition of another channel (task) of current generation

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

0 Kudos
Message 11 of 18
(3,517 Views)

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, Immagine.JPG

with error:

Immagine.JPG

If I add square brackets like:

Immagine.JPG

I got error as:

Immagine.JPG

0 Kudos
Message 12 of 18
(3,514 Views)

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

0 Kudos
Message 13 of 18
(3,510 Views)

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

0 Kudos
Message 14 of 18
(3,508 Views)

Hi Chao,

you can have a look here.

I hope this helps!

Bye,

 

Licia

0 Kudos
Message 15 of 18
(3,506 Views)

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

0 Kudos
Message 16 of 18
(3,504 Views)

Hi Chao,

unfortunately we don't have Visual Studio so I won't be able to run your code.

Bye,

 

Licia

0 Kudos
Message 17 of 18
(3,499 Views)

OK I see. That's OK. Thanks anyway!

 

Chao

0 Kudos
Message 18 of 18
(3,497 Views)