int16_t read_AI2(NiFpga_Session* session, NiFpga_Status* status)
{
	int16_t value;

	NiFpga_MergeStatus(status, NiFpga_ReadI16(*session,NiFpga_FPGA_read_ai_ao_IndicatorI16_Connector1AI2,&value));
	return value;
}
Beispiel #2
0
int16_t FPGA_GetCRIOVLineRead() {
    int16_t retval;
    NiFpga_MergeStatus(&FPGA_Status,NiFpga_ReadI16(FPGA_Session,NiFpga_mainFPGA_IndicatorI16_cRIOVMonitormV,&retval));
    if (NiFpga_IsError(FPGA_Status))
    {
            LOG.ERR("Get cRIOV Line Read Failed.");
    }
    return retval;
}
Beispiel #3
0
int16_t FPGA_GetVersion()
{
	int16_t version;
	NiFpga_MergeStatus(&FPGA_Status,NiFpga_ReadI16(FPGA_Session,NiFpga_mainFPGA_IndicatorI16_FPGAVersion,&version));
	if (NiFpga_IsError(FPGA_Status))
	{
		LOG.ERR("Get FPGA Version Failed.");
	}
	return version;
}
Beispiel #4
0
int16_t FPGA_GetYawRef()
{
	int16_t value;
	NiFpga_MergeStatus(&FPGA_Status,NiFpga_ReadI16(FPGA_Session,NiFpga_mainFPGA_IndicatorI16_YawRefmV,&value));
        if (NiFpga_IsError(FPGA_Status))
	{
		LOG.ERR("Get Yaw Ref Failed.");
	}
	LOG.DATA("YawRef = %d",value);
	return value;
}
Beispiel #5
0
// Returns the velocity of the left motor
float FPGA_GetLeftMotorVelocity()
{
	int16_t ticks;
	NiFpga_MergeStatus(&FPGA_Status,NiFpga_ReadI16(FPGA_Session,NiFpga_mainFPGA_IndicatorI16_LeftMotorVTicksPerDt,&ticks));
	if (NiFpga_IsError(FPGA_Status))
	{
		LOG.ERR("Get Left Motor Velocity Failed.");
	}
	float Speed =  ticks /leftWheelConversionConstant;
	LOG.DATA("LMV = %f",Speed);
	return Speed;
}
Beispiel #6
0
bool nifpga::ReadI16(uint32_t indicator, int16_t* value) {
	if (sessionOpen) return HandleStatus(NiFpga_ReadI16(sessionHandle, indicator, value));
	return false;
}