> For the complete documentation index, see [llms.txt](https://nviasoft.gitbook.io/nviasoft-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nviasoft.gitbook.io/nviasoft-docs/documentation/c/7.-ezgem.md).

# 7. EZGEM 구동 전 주요 메서드 설정

{% stepper %}
{% step %}

### SetLogFile()

{% hint style="warning" %}
디렉토리 입력시 특수문자 및 한글은 사용하지 않는것을 권장합니다.
{% endhint %}

GEM로그를 남길 위치를 지정하는 함수입니다. 사용자가 직접 경로를 설정할 수 있으며 오류 파악 및 라이선스 유무, DLL버전 등을 로그를 통해 확인할 수 있습니다. 절대경로 상대경로 모두 사용 가능하며 경로는 역슬래쉬로 구분합니다.
{% endstep %}

{% step %}

### SetFormatFile() / SetFormatCheck()

EZGemPlus에서 FormatFile의 형식에 맞지 않는 메시지를 수신했을 경우 Error메시지(Stream9) 를 자동 응답하게 설정합니다.
{% endstep %}

{% step %}

### AddRemoteCommand()

AddRemoteCommand() 함수로 HOST의 명령을 등록해두면 HOST Command(S2F41) 시 OnRemoteCommand()함수로 들어와 편리하게 처리할 수 있습니다.
{% endstep %}

{% step %}

### AddVID() / AddCEID() / AddECID() / AddALID()

구동전 장비의 실시간상태 항목, 이벤트 항목, 상수 항목, 알람 항목 등을 미리 등록해줍니다.
{% endstep %}

{% step %}

### DisableAutoReply()

사용자가 직접 처리를 희망할 시 이 함수를 사용하면 GEM은 OnMsgReceived()로 해당 메시지를 보내주게 됩니다. 사용자는 Stream과 Function으로 구분하여 원하는 작업을 할 수 있습니다.
{% endstep %}
{% endstepper %}

이 외에도 EZGemPlus Dll은 사용자가 처리하지 않아도 MSG자동처리, 필요시 MSG직접 구성 및 핸들링, MSG자동 파싱으로 소스 간소화 등 다양한 고급 기능을 제공합니다. 전체 API 목록과 상세 사용법은 이어지는 페이지에서 확인하실 수 있습니다.

```csharp
m_gem.SetLogFile(@"TEST\GEM.LOG");

m_gem.SetFormatFile(@"TEST\FORMAT.SML");            //FormatFile의 경로를 설정
m_gem.SetFormatCheck(true);                         //Format.SML을 사용하도록 설정합니다.

//RCMD 등록
m_gem.AddRemoteCommand("START");                    //Start 명령을 미리 등록해줍니다.
m_gem.AddRemoteCommand("PP-SELECT");                //PPSelect 명령을 미리 등록해줍니다.

//VID등록
m_gem.AddVID(2001, "CONTROL_STATE", "U1", "");  //VID는 협의후 지정해줍니다.
m_gem.AddVID(2009, "PPID", "A", "");            //이벤트가 호출되었을때 SetVIDValue()
m_gem.AddVID(2101, "LOT_ID", "A", "");          //를 통해 실시간 값으로 갱신 후 보냅니다.
m_gem.AddVID(2102, "SVID.WAFER_ID", "A", "");
//CEID등록
m_gem.AddCEID(1091, "BARCODE_READ", "");    //장비에서 발생하는 이벤트를 ID별로 관리합니다
m_gem.AddCEID(1101, "LOT_START", "");            
//ECID등록
m_gem.AddECID(3, "T3", "SECOND", "U1");    //변하지 않는 항목들을 ID별로 관리합니다.
m_gem.AddECID(10, "ECID_ESTABLISH_TIMEOUT", "SECOND", "U2");
m_gem.SetECRange(3, "1", "200");            //각항목에 대한 Min Max 를 지정할 수 있습니다.
//AID등록
m_gem.AddALID(20001,"EMS#1_(Main_Panel)_On_Check_Alarm","6");        //6=중알람
m_gem.AddALID(20601,"Panel_Temp_35_Over_Warning","1");               //1=경알람

m_gem.DisableAutoReply(1, 3);      //Stream1 , Function3
m_gem.DisableAutoReply(1, 11);      //Stream1 , Function11
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nviasoft.gitbook.io/nviasoft-docs/documentation/c/7.-ezgem.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
