@WSAR1-V1@W@COMMENT@calculate CRC-16@DPS@ 2)b[:Us_~bSvPy& tY:-KBd_M=Y *ks[M=Y *krSͽpٍ!|YD:-K\`Q}mPy& yR}@umPuCuY޽@NOTE@CRC_df1 *** Target : Target 1: I-8417/8817/8437/8837 , I-7188EG , I-7188XG call: NUM_ : integer byte array No. (1-24) , each array has 256 bytes ADR_ : integer starting address to calculate in this array (1 ~ 256) SIZE_ : integer total byte count to calculate return: CR_ACCUM_ : integer notes: refer to the useage of array_r() and array_w() ICP DAS , Taiwan Aug.11,2004 @PARAM@*#ACR_ACCUM_ @SRC@/* function block name: CRC_16 */ #include #include typedef struct { } str_data; uint16 FBINIT_crc_16 (uint16 hinstance) { return (sizeof (str_data)); } void FBACT_crc_16 (uint16 hinstance, str_data *data, str_arg *arg) { } #define BOO_VALUE ((T_BOO *)value) #define ANA_VALUE ((T_ANA *)value) #define REAL_VALUE ((T_REAL *)value) #define TMR_VALUE ((T_TMR *)value) #define MSG_VALUE ((T_MSG *)value) void FBREAD_crc_16 (uint16 hinstance, str_data *data, uint16 parno, void *value) { } ABP fbldef_crc_16 (char *name, IBP *initproc, RBP *readproc) { sys_strcpy (name, "CRC_16"); *initproc = (IBP)FBINIT_crc_16; *readproc = (RBP)FBREAD_crc_16; return ((ABP)FBACT_crc_16); } @DEFS@/* function block interface name: crc_df1 */ typedef long T_BOO; typedef long T_ANA; typedef float T_REAL; typedef long T_TMR; typedef char *T_MSG; typedef struct { /* CALL */ T_ANA _num_; /* CALL */ T_ANA _adr_; /* CALL */ T_ANA _size_; } str_arg; #define NUM_ (arg->_num_) #define ADR_ (arg->_adr_) #define SIZE_ (arg->_size_) #define FBLPNO_CR_ACCUM_ 0 @END@