
The load in Figure 6 may be an alarm device, such as a warning light. By default, the alarm function is turned off, there is no upper and lower limit alarm, the two NPNs (equivalent to switches)
are in the open state, the load circuit is open, and no current flows. Turn on the alarm function, after setting the upper limit and lower limit of flow, when the flow value is higher than the upper limit or lower
than the lower limit, the corresponding NPN is closed, the current flows through the load, and then the alarm device can start to work. When the upper and lower limit alarms are turned on, an alarm will be
issued when the instantaneous flow value is higher than the upper flow limit value or lower than the flow lower limit value. For example, if the upper limit is set to 20 and the lower limit is set to 5, when the
instantaneous flow value is lower than 5L/min, the NPN open collector output port corresponding to external output 2 is closed, and when it is higher than 20L/min, the NPN open collector output
port corresponding to external output 1 is closed. closed, alarm.
www.aosong.com
The C language code for calculating the CRC code is as follows:
AFM0725 has 2 NPN open collector output ports, 2 NPN open collector output ports correspond to external output 1 and external output respectively
Output 2, external output 1 controls the upper limit alarm, and external output 2 controls the lower limit alarm. If the AFM0725 lead wire is purchased, the external output 1 (NPN1) corresponds to the
gray wire, the external output 2 (NPN2) corresponds to the brown wire, and the GND corresponds to the black wire and the orange wire. The wiring diagram is shown in Figure 6.
4.2 NPN open collector output
July 2022
crc ^=*ptr++;
for(i=0;i<8;i++){ if(crc &
0x1){ crc>>=1;
crc^=0xA001;
} else crc>>=1;
} return crc;
unsigned int crc= 0xFFFF;//initialize initial value
unsigned char i; while(len--) {
}
}
// *ptr communication send or receive data byte
array, // len send or receive data byte length (excluding
CRC code) // return the calculation result of CRC code,
high byte first unsigned int CRC16(unsigned char * ptr, unsigned char len) {
Figure 6. Schematic diagram of NPN control upper and lower limits
9/12