Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem generated migrating from NI cDAQ-9174 to cDAQ-9184

We have been using NI cDAQ-9174 chassis for 2 years on the project I am currently working, and we decided to evaluate migration to model cDAQ-9184, which means that we only want to migrate from an usb chassis to an ethernet chassis.

The simplified version of what we have currently running on any of our stations is:

- cDAQ-9174 chassis with 2 modules 9425 connected and one module 9215. 

- 2 software applications: Application X reads data from one 9425 module and 9215 module. Application Y reads data from the other 9425 module.

- Each of the applications reads samples from its corresponding module at 10000 samples per second.

 

We changed de device to 9184 and configured it with an static ip inside our subnet. The device is recgonized and we can read data out of it, so it is working.

 

The problem we are having is that if we configure the device to read 10000 samples per second something strange happens and analog signal does not behave correctly.

If we read at 1000 and 2000 samples per second we have no problems (but we have a clearer signal if we read at 10000 samples per second).

If we disconnect one of the two running applications, the other one runs pefectly at 10000 samples per second.

 

The strange thing is that anything of this happens if we use 9174 chassis (USB version).

Is ethernet version of the chassis worst than usb version? What can we do to read at 10000 samples per second with the ethernet version of the chassis?

 

Thanks in advance 

 

 

 

0 Kudos
Message 1 of 6
(4,648 Views)

Hello!

Let's make some tests to try resolve your problem.

Please, disable you Firewall and your anti virus and see results.

Please tell me if the behavior continues the same if you apply this change.

Best Regards

Rita Souza
Engenharia de Aplicações
National Instruments Brazil

0 Kudos
Message 2 of 6
(4,513 Views)

Hello Rita, thanks for your response.

The computer has firewall disabled and does not have an antivirus installed yet. As we were testing the device we decided from the beginning not to enable them.

 

What other tests do you suggest? the strangest thing is that we do not have those problems if we use usb chassis...

0 Kudos
Message 3 of 6
(4,511 Views)

I need to take a look in your two applications, if you doesn't matter.

Can you send me your VI's? Wich is the version of your LabVIEW?

I'm waiting

Best Regards

Rita Souza
Engenharia de Aplicações
National Instruments Brazil

0 Kudos
Message 4 of 6
(4,509 Views)

It's important you send a print screen of your signal.
I'm waiting.
Best Regards

Rita Souza
Engenharia de Aplicações
National Instruments Brazil

0 Kudos
Message 5 of 6
(4,495 Views)

Rita, how are you? Sorry it took me too long to response, as I am currently in the middle of a software release.

Our software product uses National Instruments C language API to interact with the chassis, we do not use visual editor from national instruments. 

I will be going with my team to our testing place on thursday, I will take captures from NI labview in order to show you the signals we are reading and compare them with the ones our software produces.


This is the simplified version of what our software really does:

 

Application A:
This application reads data from chassis registering an event that raises every a certain number of samples
This is a simplified version of our code. In our main program we call pHW_IniciarAI and pHW_IniciarDI functions to create and start analogic and digital task

 

// Function that creates and starts AI task
//the original function does have error checking, i posted this one as a simplified version
int pHW_IniciarAI(struct tHW_Hardware *hw) {
	char  descripcion[2048]={'\0'};
	char  aux1[2048];
	int32 err;

	// create AI task.
	DAQmxCreateTask("ANA0_Tarea", &hw->ANA0_Tarea);
	DAQmxCreateAIVoltageChan(hw->ANA0_Tarea, 
							   aux1, 
							   "", 
							   hw->ANA0_terminalConfig, 
							   hw->ANA0_MinMagnitud[0], 
							   hw->ANA0_MaxMagnitud[0], 
							   hw->ANA0_units, 
							   "");
	
	DAQmxCfgSampClkTiming(
			hw->ANA0_Tarea,
			"", 
			10000, //sample adquisition speed
			DAQmx_Val_Rising, 
			DAQmx_Val_ContSamps, 
			1000));
	GetTerminalNameWithDevPrefix(hw->ANA0_Tarea, "ai/SampleClock", hw->TrigName));
	
	//the important part, we register an event that raises when buffer is full
	DAQmxRegisterEveryNSamplesEvent(
					hw->ANA0_Tarea, //analogic task
					DAQmx_Val_Acquired_Into_Buffer, 
					1000, 
					0, 
					EveryNCallback, //callback function
					hw);  //callback data to pass to the function
	return 0;		
}

// Function that creates and starts DI task
//the original function does have error checking, i posted this one as a simplified version
int pHW_IniciarDI(struct tHW_Hardware *hw) {
	// create digital input task
	DAQmxCreateTask("DIG0_Tarea", &hw->DIG0_Tarea);
	// create digital channel
	DAQmxCreateDIChan(hw->DIG0_Tarea, hw->DIG0_Lineas, "", DAQmx_Val_ChanForAllLines);
	//this is used to syncronize with analogic input
	DAQmxCfgSampClkTiming(hw->DIG0_Tarea,hw->TrigName,hw->ANA0_VelocidadMuestreo,DAQmx_Val_Rising,DAQmx_Val_ContSamps,hw->ANA0_MuestrasBuffer);
	return 0;
}

int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData) {
	struct tHW_Hardware *hw = (struct tHW_Hardware*)callbackData;
	DAQmxReadAnalogF64(hw->ANA0_Tarea,hw->ANA0_MuestrasBuffer,10.0,DAQmx_Val_GroupByScanNumber,hw->ANA0_Buffer2, hw->ANA0_MuestrasBuffer * hw->ANA0_Canales,&readAI,NULL);
	DAQmxReadDigitalU32(hw->DIG0_Tarea,hw->ANA0_MuestrasBuffer,10.0,DAQmx_Val_GroupByScanNumber,hw->DIG0_Buffer2,hw->ANA0_MuestrasBuffer,&readDI,NULL);
	//here we do stuff to read data from chassis buffer
	
}

 

 

Application B:
This application reads 1 sample each 1 milisecond using this function call from NI API:
DAQmxReadDigitalScalarU32()

 

We use a windows API timer that calls a callback function each 1 milisecond using:
timeSetEvent(1, 1, EVA_Reloj, 0, TIME_PERIODIC);

 

 //this is a simplified version of the callback function 
void CALLBACK EVA_Reloj(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2) {
	ULONG entrada;
	semaphoreLock();
	readDataFromHardware(hw, &entrada);
	releaseLock();
}

//this is the function that interacts with the chassis reading digital input
int readDataFromHardware(struct tHW_Hardware *hw, ULONG *entrada) {
	int err;
	if ((err = DAQmxReadDigitalScalarU32(hw->DIG0_Tarea,	//this is a TaskHandle, created earlier with a digital channel	
										 0,
										 entrada, 
										 NULL)) != 0) {
		Err_Imprimir(100, "ERROR: cannot read Digital input data.\n"); //this is used just to log error
		return(err);
	}
	return(0);
}

 

 

0 Kudos
Message 6 of 6
(4,461 Views)