[참조: https://github.com/osisoft/PI-AF-SDK-Basic-Samples/tree/master/ExamplesLibrary/WriteValuesExample ]
PIServers piServers = new PIServers();
PIServer piServer = piServers[piServerInfo]; //piServerInfo : PI 서버 IP 또는 도메인 정보
IList<PIPoint> points = PIPoint.FindPIPoints(piServer, new[] { "cdt158"});
PIPoint floatingPIPoint = points[0];
IList<AFValue> valuesToWrite = new List<AFValue>();
for (int i = 0; i < 10; i++)
{
AFTime time = new AFTime(new DateTime(2017, 1, 1, 0, 0, i, DateTimeKind.Local));
AFValue afValueFloat = new AFValue(i, time); //값, 시간
afValueFloat.PIPoint = floatingPIPoint;
valuesToWrite.Add(afValueFloat);
}
piServer.UpdateValues(valuesToWrite, AFUpdateOption.InsertNoCompression, AFBufferOption.BufferIfPossible);
'4차산업혁명 > PI System' 카테고리의 다른 글
Windows Service 등록 방법 (0) | 2018.01.19 |
---|---|
[PI Vision] PI Web API 경로 변경 (0) | 2018.01.19 |
[PI System] Softbank 투자 (0) | 2017.11.14 |
PI 서버 보호를 위한 7가지 (0) | 2017.10.25 |
AF의 MSSQL 접속 정보 수정 (0) | 2017.10.25 |