Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

ReadSingleSample() does not work when ni box is connected via lan to usb

Hey there!

 

I have my NI Box connected to my PC via a LAN to USB box from silex.

Now I am trying to read out the analog channels with the method ReadSingleSample from the AnalogMultiChannelReader class.

This call never returns I call the method inside of a task which has an endless timeout.

Is this a known issue? Is there any workarround?

I use the C# API

 

Thank you very much

Phil

0 Kudos
Message 1 of 5
(5,578 Views)

NI box?

What is that?

0 Kudos
Message 2 of 5
(5,569 Views)

Hi Phil,

 

I would have the same question: What kind of NI hardware are you using?

It is always helpful if you provide us with a bigger portion of the source code or even the project as a attachment.

 

Best regards,

Christoph

Staff Applications Engineer
National Instruments
Certified LabVIEW Developer (CLD), Certified LabVIEW Embedded Systems Developer (CLED)


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved
0 Kudos
Message 3 of 5
(5,551 Views)

Hey

Here is my configuration:

I use the NI Box USB6009 OEM which is connected with a Lan to USB box from silex (SX-3000GB) to the PC.

 

My Code is very simple no big deal I thought

AnalogMultiChannelReader reader = new AnalogMultiChannelReader(analogRead.Stream);
analogRead.Control(TaskAction.Verify);
double[] data = reader.ReadSingleSample(); // TODO: This read is not working via lanToUSB

 analogRead is an instance of the class NationalInstruments.DAQmx.Task

And the application does not return from the last call reader.ReadSingleSample()

 

I hope that helps you to understand my problem

 

Thanks

Phil

0 Kudos
Message 4 of 5
(5,540 Views)

@schlaug wrote:

Hey

Here is my configuration:

I use the NI Box USB6009 OEM which is connected with a Lan to USB box from silex (SX-3000GB) to the PC.

 

My Code is very simple no big deal I thought

AnalogMultiChannelReader reader = new AnalogMultiChannelReader(analogRead.Stream);
analogRead.Control(TaskAction.Verify);
double[] data = reader.ReadSingleSample(); // TODO: This read is not working via lanToUSB

 analogRead is an instance of the class NationalInstruments.DAQmx.Task

And the application does not return from the last call reader.ReadSingleSample()

 

I hope that helps you to understand my problem

 

Thanks

Phil


Have you verified that this set-up works?

Are you able to makethe readings using NI-MAX?

Sounds like you may have a problem with your LAN to USB adapter.

 

 

0 Kudos
Message 5 of 5
(5,521 Views)