## Primary ## msys2.org Server = http://repo.msys2.org/mingw/i686 Server = http://downloads.sourceforge.net/project/msys2/REPOS/MINGW/i686 Server = http://www2.futureware.at/~nickoe/msys2-mirror/i686/
mirrorlist.mingw64
1 2 3 4 5 6 7 8 9 10 11
## ## 64-bit Mingw-w64 repository mirrorlist ##
Server=http://mirrors3.ustc.edu.cn/msys2/REPOS/MINGW/x86_64 ## Primary ## msys2.org Server = http://repo.msys2.org/mingw/x86_64 Server = http://downloads.sourceforge.net/project/msys2/REPOS/MINGW/x86_64 Server = http://www2.futureware.at/~nickoe/msys2-mirror/x86_64/
## Primary ## msys2.org Server = http://repo.msys2.org/msys/$arch Server = http://downloads.sourceforge.net/project/msys2/REPOS/MSYS2/$arch Server = http://www2.futureware.at/~nickoe/msys2-mirror/msys/$arch/
for (index = 0; index < ptbl_data->point_size; index++, tag++) { // other stuff // ...
if (tag->flag == E_EMPTY_TAG) continue;
// tests the string, validating it as a fully qualified eDNA point name if (DNAGoodPointFormat(tag->name) == 0) { tag->flag = INVALID; continue; }
// check point name is exist if (!DoesIdExist(tag->name)) { tag->flag = NOT_EXIST; continue; }
// retrieves the value, time and status in their raw formats ret = DNAGetRTFull(tag->name, &tag->value, szValue, EDNA_LEN, &ptTime, tag->ts, EDNA_LEN, &pusStatus, szStatus, EDNA_LEN, szDesc, EDNA_DESC_LEN, szUnits, EDNA_LEN);
PI(Plant Information System)是由美国 OSIsoft 公司开发的一套基于 Client / Server 结构的商品化软件应用平台,是过程工业全厂信息集成的必然选择。作为工厂底层控制网络与上层管理信息系统网络连接的桥梁,PI 在工厂信息集成中扮演着特殊和重要的角色。更详细的介绍,可参考百度百科或者官方网站
登录数据库
要访问数据库,有两种方法,一种是通过用户名和密码登录,另一种是通过 PI Trust。官方是不建议使用密码登录的,所以在开发应用的时候,尽可能使用 PI Trust,但是国内的情况比较混乱,很多生产环境都还是使用第一次方式。
下面分别介绍两种登录方法的使用
用户名 / 密码登录
这种方式比较简单,Server 端几乎不需要任何配置,只要简单添加一个用户即可。
涉及到的 API 函数:
piut_setservernode 设置 PI Server 节点,一般就是 Server 的 IP 地址
if (piut_isconnected() == 0) { // retrieves the version number of the PI-API. if (piut_getapiversion(version, sizeof(version)) == 0) { ftrace_log(log_tag, "PI-API version %s", version); }
// sets the active PI Server node where the data for the subsequent // PI-API calls will be resolved result = piut_setservernode(server->server_ip);
if (result) { ftrace_log(log_tag, "piut_setservernode: can not connect to %s", server->server_ip); return E_CONNECT_FAILED; }
if (server->usr_name != NULL && strlen(server->usr_name) > 0) { // establishes a user's access to PI System data based on a login to a configured user database result = piut_login(server->usr_name, server->usr_pwd, &valid);
if (result == 0) { ftrace_log(log_tag, "piut_login: connect to %s successful, valid=%d", server->server_ip, valid); return E_SUCCESS; }
ferror_log(log_tag, "piut_login: connect to %s failed, ret=%d", server->server_ip, result); }
//sets the global process name to the passed string piut_setprocname(pro_name); result = piut_connect(server->server_ip);
if (result) { ferror_log(log_tag, "piut_connect: connect to %s failed, ret=%d", server->server_ip, result); return E_CONNECT_FAILED; } }