提交 | 用户 | age
|
5dd1b7
|
1 |
//#include <STC15Wxx.h> |
Q |
2 |
#include "STC15F2K60S2.H" |
|
3 |
|
|
4 |
typedef unsigned char uint8; |
|
5 |
typedef unsigned int uint16; |
|
6 |
typedef unsigned long uint32; |
|
7 |
|
|
8 |
extern uint8 sendCount; |
|
9 |
extern uint8 receCount; |
|
10 |
extern uint8 sendPosi; |
|
11 |
|
|
12 |
extern int outvalue[4]; |
|
13 |
extern int ZeroPara[4]; |
|
14 |
extern int RatePara[4]; |
|
15 |
extern int maxCurrentValue[4]; |
|
16 |
extern int LedOn[4]; |
|
17 |
extern bit needstore; |
|
18 |
extern bit needstorePC; |
|
19 |
|
|
20 |
|
|
21 |
extern uint8 idata sendBuf[64],receBuf[64]; |
|
22 |
extern uint8 idata checkoutError; // ==2 |
|
23 |
extern uint8 idata receTimeOut; |
|
24 |
extern uint32 dwTickCount; |
|
25 |
|
|
26 |
void beginSend(void); |
|
27 |
void checkComm0Modbus(void); |
|
28 |
void readCoil(void); |
|
29 |
void readRegisters(void); |
|
30 |
void forceSingleCoil(void); |
|
31 |
void presetSingleRegister(void); |
|
32 |
void presetMultipleRegisters(void); |
|
33 |
void forceMultipleCoils(void); |
|
34 |
uint16 getRegisterVal(uint16 addr,uint16 *tempData); |
|
35 |
uint16 setRegisterVal(uint8 addr,uint16 tempData[]); |
|
36 |
uint16 lightControl(uint16 addr,uint16 tempData); |
|
37 |
uint16 getCoilVal(uint16 addr,uint16 *tempData); |
|
38 |
uint16 setCoilVal(uint16 addr,uint16 tempData); |
|
39 |
|