@WSAR1-V1@X@COMMENT@ReadCJC temperature with offset@DPS@ 2)b[:Us_~zSpٍ!uTM=Y *kcDumPy& qS`mPy& yR:-K\~_M=Y *kr@q]ͽpٍ!|Y]|UͽpTcDy:@NOTE@CJC2 Read Cold-Junction Compensation(CJC) temperature of module I-7018 & I-87018 with Offset *** Target : I-8417/8817/8437/8837 , I-7188EG , I-7188XG *** call: REMOTE_ : boolean must be a constant value , not a variable If REMOTE_ is TRUE, it means I-7018 and I-87018 are used as remote I/O . If REMOTE_ is FALSE, it means I-87018 is plugged in Main Control Unit. ADR_ : integer must be a constant value , not a variable If REMOTE_ is TRUE, ADR_ means the remote I/O module's address (1 ~ 255) If REMOTE_ is FALSE, ADR_ means slot No. , 0 - 7 SET_ : boolean start to set CJC temperature offset if TRUE W_OFFSET : integer CJC temperature offset in decimal format,from -4096 to +4096 each count is 0.01 degree Celsius return: Q_ : boolean work ok.: TRUE " IF Q_ IS FALSE , IT MEANS COMMUNICATION IS BAD, THE FOLLOWING RETURN VALUE HAS NO MEANING. " CJC_ : integer the Analog input value (2's complement formate) temperature : -45 ---> 0 ---> +130 (degree Celsius) val: -11340 ---> 0 ---> 32767 (dec.) D3B4 ---> 0000 ---> 7FFF (hex.) R_OFFSET : integer Read CJC temperature offset notes(Very Important): If the I-87018 is plugged in the Main Control Unit, please connect the 87018 or 87018A I/O board first. "CJC2" function block can work. before connection please .... on I/O module side, please using "7000 utility" : 1.Set "address" to a unique No. (1~255) 2.Set configuration table with "checksum disable" and "2's complement" 3.Set communication parameter to a "baud rate" and "8,N,1" 4.Set "Input range" on I-8xx7/I-7188EG/I-7188XG side: 1.Connect I/O complex equipment "bus7000" and set its "baud rate" equal to the setting "baud rate" of I/O module 2.max to 64 remote I/O modules can be connected 3.use each i_7*** function block to connect to I/O modules ICP DAS , Taiwan Sep.01,2004 @PARAM@I#BQ_ #A>CJC_ #A>R_OFFSET @SRC@/* function block name: cjc */ #include #include typedef struct { } str_data; uint16 FBINIT_cjc (uint16 hinstance) { return (sizeof (str_data)); } void FBACT_cjc (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_cjc (uint16 hinstance, str_data *data, uint16 parno, void *value) { } ABP fbldef_cjc (char *name, IBP *initproc, RBP *readproc) { sys_strcpy (name, "CJC"); *initproc = (IBP)FBINIT_cjc; *readproc = (RBP)FBREAD_cjc; return ((ABP)FBACT_cjc); } @DEFS@Y/* function block interface name: cjc2 */ typedef long T_BOO; typedef long T_ANA; typedef float T_REAL; typedef long T_TMR; typedef char *T_MSG; typedef struct { /* CALL */ T_BOO _remote_; /* CALL */ T_ANA _adr_; /* CALL */ T_BOO _set_; /* CALL */ T_ANA _w_offset_; } str_arg; #define REMOTE_ (arg->_remote_) #define ADR_ (arg->_adr_) #define SET_ (arg->_set_) #define W_OFFSET_ (arg->_w_offset_) #define FBLPNO_Q_ 0 #define FBLPNO_CJC_ 1 #define FBLPNO_R_OFFSET 2 @END@