10월, 2020의 게시물 표시

[JAVA] Timer, TimerTask, Thread 이용하기

개요 10초 후에 A 값을 출력하고 B 값을 출력하고 싶을 때 프로그램 객체에서 이 코드를 사용할 수 있다. Using Timer and TimerTask  프로그래밍하기 전에 준비 import java.util.TimerTask Source code public void onExecute() {     setAOValue(new BStatusNumeric(100));      Timer tmr = new Timer(); TimerTask tmr_task = new TimerTask() {     public void run()     {          //do it code          setAOValue(new BStatusNumeric(200));     } } tmr.schedule(tmr_task,5000); //tmr.schedule(tmr_task,5000,2000) : Operative every two seconds, after 5 seconds. }// end of onExecute() 결과 이 코드는 출력 100을 먼저 작동하고 5초 후에 출력 200을 출력한다. 스레드 사용 프로그래밍하기 전에 준비 nothing special. Source code public void onExecute()    throws Exception {   setNormal(); } public void setNormal() {   // Create a new thread, with the starting point set as the current program  object.   Thread thread = new Thread(this, getProgram().getName());    ...

Webs8000 controller communicate with Niagara AX

이미지
개요 Web8000 controller 위에 Niagara AX 워크벤치를 통신하기위한 방법을 정리한다.  N4 컨트롤러를 AX와 통신하는 방법을 요약하겠습니다. 1. webs8000 컨트롤러에서 AX Supervisor 계정을 생성한다.  - I just made an 'ax' user.  - Change the authentication scheme "AX digest Scheme" 2. ax 사용자 역할을 만든다.  - I just made a role that name is "ax" for "ax" users.  - Any people say that role name must same as the user name.      ( I didn't check it is true) 3. NiagaraNetwork에 Niagara 장치를 추가한다.  - Using just made id "ax" for login. 4. 나이아가라 장치에 수동으로 포인트를 추가한다.    - It can not discovery.  - We must add points manually.   - We can use Ord for communicating.