RadiSys 6200plus Series Bedienungsanleitung Seite 172

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 275
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 171
Sample
API Modules
Appendix B
B-14
/* The PLC-5/40V’s command/control register WRITE-READY bit
indicates when it is ready to accept a new command. We
will poll this bit until it is set or we timeout.
*/
poll_plc540v_cmdctrl_bits(baseAddress, kCMDCTRL_WRDY, status);
if (status->plc540vStatus == kPLC540V_SUCCESS)
{
/* The PLC-5/40V command word is 32 bits wide. However, the VME
interface to the command word is only 16 bits wide so we must
write the command word as two 16 bit chunks. These words must
be written MSW and then LSW.
*/
write_plc540v_register(baseAddress, kPLC540V_CH_REG,
HIWORD(command), status);
write_plc540v_register(baseAddress, kPLC540V_CL_REG,
LOWORD(command), status);
poll_plc540v_cmdctrl_bits(baseAddress, kCMDCTRL_WRDY, status);
if (status->plc540vStatus == kPLC540V_SUCCESS)
{
/* The PLC-5/40V has now started processing the command word.
We will chech the command control register’s ERROR bit to
see if this command word caused any PLC-5/40V errors. If
so, we will extract the 8 bit error code from the command
control register.
*/
read_plc540v_register(baseAddress, kPLC540V_CC_REG,
&cmdctlReg, status);
if (status->plc540vStatus == kPLC540V_SUCCESS)
{
/* Determine if the bit is set. */
if (cmdctlReg & kCMDCTRL_ERR)
{
/* Extract the error code. */
status->plc540vStatus = cmdctlReg & 0x00FF;
status->statusCategory = kPLC540V_STATUS;
}
}
}
}
}
Seitenansicht 171
1 2 ... 167 168 169 170 171 172 173 174 175 176 177 ... 274 275

Kommentare zu diesen Handbüchern

Keine Kommentare