'insert'에 해당되는 글 2건

  1. 2017.12.20 PI Data Insert
  2. 2017.10.24 [MSSQL] For 문으로 데이터 넣기
2017. 12. 20. 18:09

[참조: 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
Posted by 까망후니
2017. 10. 24. 17:33

DECLARE @count INT

SET @count = 1


WHILE @count <= 1000


BEGIN

INSERT INTO T_TAGS (id, timeStamp, value) VALUES ('TEST', DATEADD(SECOND, @count,'2017-10-01 00:00:00') , @count)

SET @count = @count+1

END



'DB > MSSQL' 카테고리의 다른 글

기본 문법 중 자꾸 까먹는것들 위주로..  (0) 2017.12.01
외부 접속 허용  (0) 2017.10.23
Try Catch 예제  (0) 2017.09.05
오전오후 -> datetime 변환  (0) 2017.03.28
index 방법  (0) 2017.02.23
Posted by 까망후니