122
Rockwell Automation Publication 1789-UM002K-EN-P - January 2015
Chapter 7
Develop External Routines
// Set Error bit to zero if successful.
pERCtrl->ctrlWord.ER = 0;
}
else
{
// Some error
// Set Error bit to indicate error occurred
pERCtrl->ctrlWord.ER = 1;
pERCtrl->ctrlWord.ErrorCode = 1; // Set ErrorCode
}
// Set Done bit before exit of this XR.
pERCtrl->ctrlWord.DN = 1;
}
else
{
// Rung not enabled
pERCtrl->ctrlWord.DN = 0;
}
return itemp; // returns 0.0 if error
}
InlineExample.h
// Exported Functions:
extern "C" __declspec(dllimport
int SumArray(
EXT_ROUTINE_CONTROL* pERCtrl,
int Val[]);