CSV Bulk Upload (/ui/connect/csv)
A screen for registering multiple OPCs + tags at once. Import a tag catalog defined in Excel or an external tool as-is. The fastest approach for sites with 50+ tags.
Home → Connect Protocol → top right 📥 CSV Bulk Upload, or go directly to /ui/connect/csv.
1. Screen Layout
📥 CSV 일괄 업로드 [← 뒤로] [💾 업로드]
⚠ 주의사항 패널 (빨강)
- CSV 형식 [,로 구분]
- 빈 공백 금지
- 1행 = 헤더 (절대 삭제 금지)
- OPC: 드라이버명/IP/포트 정확히
- TAG: PLC_ADDRESS 정확히 (잘못 입력 시 수집 실패)
- 이미 등록된 TAG_ID → 업데이트 안 함 (중복 무시)
📊 OPC
────────────────
[CodeMirror 에디터 — 150px]
헤더: OPC_ID,OPC_NAME,OPC_TYPE,OPC_AGENT_IP,OPC_AGENT_PORT,TIMECYCLE,ASYNC,AUTO_COLLECT,DESCRIPTION
🏷 TAG
────────────────
[CodeMirror 에디터 — 400px]
헤더: OPC_ID,TAG_ID,TAG_NAME,DATA_TYPE,PLC_ADDRESS,FORMAT,LINKED_ASSET_ID,ALIAS_NAME,DESCRIPTION
2. OPC CSV Columns (9)
| Order | Column | Meaning | Example |
|---|---|---|---|
| 1 | OPC_ID | Unique identifier (letters/digits/_) | OPC_LS_LINE1 |
| 2 | OPC_NAME | User-facing display name | 라인1 LS PLC |
| 3 | OPC_TYPE | Gateway code (LS / MELSEC / S7 / MODBUS / OPCUA / EIP / LOGIX / HTTP, etc.) | LS |
| 4 | OPC_AGENT_IP | PLC IP | 192.168.100.50 |
| 5 | OPC_AGENT_PORT | TCP port | 2004 |
| 6 | TIMECYCLE | Collection interval (ms) | 1000 |
| 7 | ASYNC | Asynchronous read | true / false |
| 8 | AUTO_COLLECT | Start collection automatically after boot | true / false |
| 9 | DESCRIPTION | Free-form note | 라인1 메인 PLC |
For the port / IP table by OPC_TYPE, see the comparison table in the Guide by PLC Type.
3. TAG CSV Columns (9)
| Order | Column | Meaning | Example |
|---|---|---|---|
| 1 | OPC_ID | Matches OPC_ID in the OPC table above | OPC_LS_LINE1 |
| 2 | TAG_ID | Unique ID (letters/digits/_) | TAG_LINE1_TEMP |
| 3 | TAG_NAME | User-facing display name | 라인1 온도 |
| 4 | DATA_TYPE | Integer / Long / Float / Double / String / Boolean | Integer |
| 5 | PLC_ADDRESS | Driver-specific address (e.g. D00309 LS, DB1.DBW0 S7, holding-register:1 Modbus) | D00309 |
| 6 | FORMAT | Format qualifier (DW / REAL / STR[10] / BIN[3], etc.) | DW |
| 7 | LINKED_ASSET_ID | (Optional) Asset mapping | ASSET_PUMP_01 |
| 8 | ALIAS_NAME | (Optional) Alias for external systems | temp_01 |
| 9 | DESCRIPTION | Free-form note | 라인1 메인 펌프 온도(℃) |
For exact entry of PLC_ADDRESS and FORMAT, see PLC Address Entry (Complete Guide to 44 Drivers).
4. Authoring Examples (Practical)
4.1 2 OPCs + 5 TAGs
OPC section (header + 2 rows):
OPC_ID,OPC_NAME,OPC_TYPE,OPC_AGENT_IP,OPC_AGENT_PORT,TIMECYCLE,ASYNC,AUTO_COLLECT,DESCRIPTION
OPC_LS_LINE1,라인1 LS PLC,LS,192.168.100.50,2004,1000,false,true,라인1 메인 PLC
OPC_S7_LINE2,라인2 S7 PLC,S7,192.168.100.60,102,1000,false,true,라인2 메인 PLC
TAG section (header + 5 rows):
OPC_ID,TAG_ID,TAG_NAME,DATA_TYPE,PLC_ADDRESS,FORMAT,LINKED_ASSET_ID,ALIAS_NAME,DESCRIPTION
OPC_LS_LINE1,TAG_LINE1_TEMP,라인1 온도,Float,D00450,REAL,,,라인1 메인 펌프 온도(℃)
OPC_LS_LINE1,TAG_LINE1_QTY,라인1 누적생산량,Integer,D00600,DW,,,32-bit 누적
OPC_LS_LINE1,TAG_LINE1_RUN,라인1 가동상태,Boolean,M02704,,,,
OPC_S7_LINE2,TAG_LINE2_PRESS,라인2 압력,Float,DB1.DBD0,REAL,,,bar
OPC_S7_LINE2,TAG_LINE2_FAULT,라인2 알람,Boolean,DB1.DBX2.0,,,,
,,, are empty columns — LINKED_ASSET_ID and ALIAS_NAME are unused.
4.2 Creating the File in Excel
- Paste the table above into Excel as-is (1 header row + data)
- Save As → CSV UTF-8 (Comma delimited) format (watch out for garbled Korean with the default
cp949) - Open the CSV file in a text editor and verify that commas inside cells are automatically quoted (
"...") - Paste the CSV body as-is into the OPC section or the TAG section
5. Upload Flow
| Step | Action |
|---|---|
| 1. Click 💾 Upload | POST /connect/csv-upload (body: the two {opcs, tags} texts) |
| 2. Server validation | Validates header / column count / types / OPC_ID matching |
| 3. DB registration | pe.app_opc + pe.app_tag upsert (existing TAG_IDs are not updated — skipped) |
| 4. Toast | "Once you restart the server, the OPC connections and tags you registered will begin to be created." |
After upload — a restart is recommended so the gateway cache (OPCAndTagsCache) picks up the new OPCs/tags (bin/restart.sh, ~6 s). OPCs registered with auto-start (AUTO_COLLECT=true) begin collection immediately after the restart.
6. Common Pitfalls
| Symptom | Cause / Resolution |
|---|---|
| 0 records after upload | Missing header / wrong column count / encoding (UTF-8 BOM) |
| Garbled Korean | Saved with Excel's default cp949. Force UTF-8 — Save As → CSV UTF-8 |
| The same TAG_ID is not updated | Expected behavior — duplicate TAG_IDs are skipped. To change one, use the Tag Registration screen or REST PUT /api/v1/tag/{tagId} |
| OPC registered but TAGs do not appear | OPC_ID in the TAG CSV does not exactly match OPC_ID in the OPC CSV. Check case and whitespace |
ASYNC and AUTO_COLLECT are treated as false | True / TRUE are both fine, but an empty cell yields false. Enter true explicitly |
| PLC_ADDRESS column registered empty | A comma inside a cell in the CSV split the row. Quote cells containing commas with "..." |
| Trailing space at end of a line → column mismatch | Excel → CSV conversion may add trailing spaces. Trim them all in a text editor |
| Upload succeeds but no values appear in charts | The OPC was registered with AUTO_COLLECT=false but Start was not pressed after the restart. Press ▶ Start in /ui/connect/list |
7. Learn More
- Single registration (interactive): Tag Registration
- Address notation: PLC Address Entry (Complete Guide to 44 Drivers)
- Real-time monitoring after registration: Connection List / Tag List
- Bulk changes (REST): repeat
PUT /api/v1/tag/{tagId}in the REST API