RadiSys 6200plus Series Manual de usuario Pagina 168

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 275
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 167
Sample
API Modules
Appendix B
B-10
/*****************************************************************************
*
* PURPOSE: This function will write to a PLC-5/40V’s A16 configuration or
* control register.
*
* INPUT: UWORD baseAddress will contain the base address of the
* PLC-5/40V.
*
* PLC540V_REGISTER_TYPE targetRegister will contain the
* particular PLC-5/40V register that will be written.
*
* UWORD registerValue will contain the value to be written
* to the specified target register.
*
* OUTPUT: PLC540V_STATUS_TYPE *status will contain the final status
* of requesting this function. This status could be and EPC
* or PLC-5/40V value.
*
* RETURNS: Nothing.
*
* EXAMPLE:
* UWORD regValue = 0x1234;
* PLC540V_STATUS_TYPE status;
* read_plc540v_register(0x0FC00,
* kPLC540V_OF_REG,
* regValue,
* &status);
*
* Copyright Allen-Bradley Company, Inc. 1993
*
****************************************************************************/
void write_plc540v_register(UWORD baseAddress,
PLC540V_REGISTER_TYPE targetRegister,
UWORD registerValue,
PLC540V_STATUS_TYPE *status)
{
/* Let’s initialize the status variable to success. */
memset((char *) status, 0x0, sizeof(PLC540V_STATUS_TYPE));
/* Let’s write the word to the PLC-5/40V’s register. */
status->epcStatus=EpcToVmeAm((BM_MBO|A16S), BM_W16,
(char far *) &registerValue,
baseAddress+targetRegister,
sizeof(UWORD));
if (status->epcStatus < 0)
{
status->statusCategory = kEPC_STATUS;
status->plc540vStatus = kPLC540V_WRITE_REGISTER_FAILED;
}
}
Vista de pagina 167
1 2 ... 163 164 165 166 167 168 169 170 171 172 173 ... 274 275

Comentarios a estos manuales

Sin comentarios