当前位置:网站首页>On the software of express delivery cabinet and deposit cabinet under Windows
On the software of express delivery cabinet and deposit cabinet under Windows
2020-11-08 12:11:00 【osc_id7cvef1】
Recently, someone asked about the software development of express cabinet again . When you're free, you'll think about it . First understand the composition of the electronic part of the express cabinet .
The brief function of the hardware is that the main control computer interacts with the outside through the display touch screen , Capture and record images by monitoring , Communicate with the server through the network module , Through the lock control board to unlock and detect the lock switch status .
Now it's mainly the software of the main control computer , The main control computer can run for the industrial motherboard windows Or other operating systems .
The main functions of the software are as follows :
One 、 User port
1、 By express mail 2、 Express delivery 3、 Personal center
Two 、 Courier port
1、 Express storage 2、 Express delivery
3、 ... and 、 Management port
It doesn't look complicated . But the hardware part of the lock control board has not been used before , I searched the Internet , There is not much information . I searched the e-commerce platform , Some manufacturers sell this stuff . Read the introduction , Basically, they send commands through the serial port , The lock control board will unlock the lock or check the opening and closing conditions of the lock , There are also commands sent to the lock control board through the network port , But the form is the same . The price of netport should be high .
Next, study the driver programming of the lock control board .
Send and receive data through serial port , I did it a few years ago , Collect a meter data to the computer . Remember to use Vb Development , The interface is very well designed , Serial communication uses a control mscomm. Just set the parameters , Open the serial port , You can send and receive data , Analyze the data according to the protocol , Turn off the serial port when not in use . stay MFC Serial communication has not been used in . First look at the lock control panel . After comparison, this kind of lock control board was selected .
The models are all right ,8、12、16、20、24 All the doors have . Some treasure link https://item.taobao.com/item.htm?id=581917013199
Unlock and query the lock status through serial communication . I searched the Internet about VS Serial communication related articles . There are many ways , There are by ActiveX Control communication , Have call Windows Of API Functions encapsulate classes to operate . call Windows Of API The method of function encapsulation class is more flexible , Combined with other people's code on the Internet is more convenient . Let's look at the command form of the lock control board , It can be simplified as sending a string of hexadecimal data , The format is as follows 
The address of the lock control board here is generally 1. When there are many pieces , The hardware can be set to other values through the dial switch 2,3 etc. , Fill in here N Set the hardware to N The circuit board sends instructions . The lock number is the channel number of the lock control board , fill M Just go M Lock No , The last two bytes of data are checks . This makes it clear that , adopt 《 Lock control board address 》 Distinguish between different boards , Re pass 《 Lock number 》 Distinguish the different locks connected to the lock plate . In this case, if it is 60 The cupboard of the door , use 5 block 12 Door lock control panel , It's easy to send instructions , First determine the number of the board to which the door lock is connected , Reset the number on the board to which the lock is connected , Fill in the data frame in the above format , Update the verification data after calculating the verification , Send through serial port , Answer the door and open it .
Use VS2010 MFC Programming , Using the method of button control group , The view is as follows 
The code is as follows
void CrockdemoDlg::OnButton(UINT nID)
{
DWORD rtlen;
BOOL fright=TRUE;
UINT CrcCheck,temp1;
BYTE rbuf[100]={0};
BYTE sbuf[] = {0xAA,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x0A};
if(f_common)
{
UpdateData(TRUE);
sbuf[1]=setadd;// The address of the lock control board
sbuf[3]=nID-IDC_BUTTON1+1; // How many locks to unlock the control panel
CrcCheck=Crc16(sbuf,7);
sbuf[7]=BYTE(CrcCheck%256);
sbuf[8]=BYTE(CrcCheck/256);
serial.SendData(sbuf,9);
}
else
{
MessageBox(_T(" Data reception error , Please check if the cable is connected properly "),_T(" Tips "), MB_OK);
}
}
After testing, it can unlock the lock smoothly . After the above test , The driver of the control panel has been unlocked , The whole software development is more aware of .
About serial communication , There are some good materials on the Internet , You can refer to it
Windows Simple example of serial communication
https://blog.csdn.net/horizons_kong/article/details/54412339
VC++ Realize the application program design of serial communication
https://blog.csdn.net/crjmail/article/details/91043991
Well, let's write about it today .
版权声明
本文为[osc_id7cvef1]所创,转载请带上原文链接,感谢
边栏推荐
- 一文剖析2020年最火十大物联网应用|IoT Analytics 年度重磅报告出炉!
- 2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
- Bccoin tells you: what is the most reliable investment project at the end of the year!
- How to deploy pytorch lightning model to production
- 如何将 PyTorch Lightning 模型部署到生产中
- 一文读懂机器学习“数据中毒”
- 2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
- Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
- 分布式文档存储数据库之MongoDB基础入门
- The young generation of winner's programming life, the starting point of changing the world is hidden around
猜你喜欢

The young generation of winner's programming life, the starting point of changing the world is hidden around

Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom

第二次作业

维图PDMS切图软件

What can your cloud server do? What is the purpose of cloud server?

Adobe media encoder / me 2021 software installation package (with installation tutorial)

原创 | 数据资产确权浅议

Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom

适合c/c++新手学习的一些项目,别给我错过了!

啥是数据库范式
随机推荐
It's 20% faster than python. Are you excited?
Flink从入门到真香(6、Flink实现UDF函数-实现更细粒度的控制流)
Suitable for C / C + + novice learning some projects, do not give me to miss!
From a friend recently Ali, Tencent, meituan and other P7 Python development post interview questions
吐血整理!阿里巴巴 Android 开发手册!(附网盘链接)
Service architecture and transformation optimization process of e-commerce trading platform in mogujie (including ppt)
next.js实现服务端缓存
最全!阿里巴巴经济体云原生实践!(附网盘链接)
用科技赋能教育创新与重构 华为将教育信息化落到实处
优化if-else代码的八种方案
Learning summary (about deep learning, vision and learning experience)
啥是数据库范式
Get PMP certificate at 51CTO College
Is software testing training class easy to find a job
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
Xamarin deploys IOS from scratch Walterlv.CloudKeyboard application
值得一看!EMR弹性低成本离线大数据分析最佳实践(附网盘链接)
你的云服务器可以用来做什么?云服务器有什么用途?
华为云重大变革:Cloud&AI 升至华为第四大 BG ,火力全开
The young generation of winner's programming life, the starting point of changing the world is hidden around