물 관리를 위한 SCADA 시스템 업데이트
수처리 물관리 (Water & Waste Management)예제 - SVG 벡터 그래픽
벡터그래픽만을 이용한 그래픽 화면 구성
- SVG 그래픽 디자인 방법 : https://cafe.naver.com/hyperhmi/4375
- 파이프의 색변화 (하이퍼스카다의 파이프그리기 활용 : https://cafe.naver.com/hyperhmi/4709 )
- 벡터그래픽의 색변화
- 물방울이동 : 참고예제 --> https://cafe.naver.com/hyperhmi/4590
- 펌프와 믹서의 회전: 그룹으로 묶인 벡터의 회전
[물방울 이동 스크립트 코드]
While 1
iPumpState = Tag.GetValueInt("Pump12")
'펌프12번 태그의 값을 읽어 1이면 물방울 이동동작을 수행합니다
If 1 = iPumpState Then
x = 0
y = 0
x2 = 0
y2 = 0
iStepTime = 10 '<---- 물방울 이동 속도 조절 (빠르게하려면 작은수, 느리게하려면 큰수)
'물방울이 이동할 좌표정보를 PIPE 심볼에서 획등하여 이동합니다.
nPoints = Symbol.GetObjectPoint("PIPE",-1)
log.print "nPoints = " & nPoints
For n = 0 to nPoints -1
log.print "n => " & n
strPoint = Symbol.GetObjectPoint("PIPE",n) '<---- PIPE
point = split(strPoint," ")
IF 1 <= UBound(point) THEN
x = CInt(point(0))
y = CInt(point(1))
x2 = x
y2 = y
If n+1 <= nPoints -1Then
strPoint = Symbol.GetObjectPoint("PIPE",n+1) '<---- PIPE
point = split(strPoint," ")
x2 = CInt(point(0))
y2 = CInt(point(1))
End If
log.print "n= " & n & " x = " & x &" " & "y = "&y & "|" & "x2 = "& x2 & " " & "y2 = " & y2
iStep = 1
If x = x2 and y <> y2 Then
If y > y2 Then
iStep = -1
End If
For h = y to y2 step iStep
log.print "x = " & x & "," & " h = "& h
Symbol.MoveTo "WATERSPOT",x,h
System.Sleep(iStepTime )
Next
End If
if y = y2 and x <> x2 Then
If x > x2 Then
iStep = -1
End If
For h = x to x2 step iStep
log.print "h = " & h & "," & " y = " & y
Symbol.MoveTo "WATERSPOT",h,y
System.Sleep(iStepTime )
Next
End If
END IF
Next
End If
System.Sleep(1000)
Wend
예제 프로젝트 :
사용하기 쉽고 가성비 좋은 스카다 배우기 통신 관련 노하우 공유 PLC/DDC 교류
cafe.naver.com


