深圳市宁远电子大骆驼DLT3288C-韦根输入接口说明

DLT3288C 板卡上有一组韦根接口,位置如下图所示: 
注意:韦根与 RS485 是同时使用一组 Pin 脚,功能二选一。板子默认是 RS485,需要韦
根功能的,需跳电阻。
 
1、设备控制节点:”/dev/wiegand”;
2、跳电阻方法
焊接两个 100 欧电阻: 
 
3、获取数据方法
使用 read 函数获取卡的信息。
4、参考代码
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main()
第 1 页{
int fd = 0;
char dst[12] ={ 0};
int result =0;
fd = open("/dev/wiegand", O_RDWR);
if(fd < 0)
{
printf("file open error ! \n");
return -1;
}
printf("start:read card\n");
while(1)
{
result=read(fd, &dst, sizeof(dst));
printf("dst0 is %s, size=%d\n", dst,result);
printf("start:read card\n");
sleep(1);
}
close(fd);
return 0;

猜你喜欢

转载自www.cnblogs.com/daluotuo188/p/11322991.html