Skip to main content

CSV Bulk Upload

Screen for registering multiple OPC + tags at once. Imports a tag catalog defined in Excel or external tools. The fastest method for sites with 50+ tags.

Home → Protocol Connection → top-right 📥 CSV Bulk Upload, or directly /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)​

OrderColumnDescriptionExample
1OPC_IDUnique identifier (alphanumeric/underscore)OPC_LS_LINE1
2OPC_NAMEUser display name라인1 LS PLC
3OPC_TYPEGateway code (LS / MELSEC / S7 / MODBUS / OPCUA / EIP / LOGIX / HTTP, etc.)LS
4OPC_AGENT_IPPLC IP address192.168.100.50
5OPC_AGENT_PORTTCP port2004
6TIMECYCLECollection period (ms)1000
7ASYNCAsynchronous readtrue / false
8AUTO_COLLECTStart collection after boottrue / false
9DESCRIPTIONFree memo라인1 메인 PLC

Refer to the comparison table in the PLC Type Guide for port/IP tables by OPC_TYPE.


3. TAG CSV Columns (9)​

OrderColumnDescriptionExample
1OPC_IDMatches OPC_ID in the OPC table aboveOPC_LS_LINE1
2TAG_IDUnique ID (alphanumeric/_)TAG_LINE1_TEMP
3TAG_NAMEUser display name라인1 온도
4DATA_TYPEInteger / Long / Float / Double / String / BooleanInteger
5PLC_ADDRESSDriver-specific address (e.g., D00309 LS, DB1.DBW0 S7, holding-register:1 Modbus)D00309
6FORMATFormat helper (DW / REAL / STR[10] / BIN[3], etc.)DW
7LINKED_ASSET_ID(Optional) Asset mappingASSET_PUMP_01
8ALIAS_NAME(Optional) Alias for external systemstemp_01
9DESCRIPTIONFree memo라인1 메인 펌프 온도(℃)

For precise PLC_ADDRESS and FORMAT input, see PLC Address Input (Complete Guide for 44 Drivers).


4. Example (Practical)​

4.1 2 OPC + 5 TAG​

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,,,,

,,, is an empty column — LINKED_ASSET_ID, ALIAS_NAME not used.

4.2 Creating from Excel​

  1. Paste the table above directly into Excel (1 header row + data)
  2. Save As → CSV UTF-8 (Comma delimited) format (default cp949 Korean character corruption warning)
  3. Open the CSV file in a text editor and check whether commas inside cells are auto-quoted ("...")
  4. Paste the CSV content exactly as-is into the OPC or TAG section

5. Upload Flow​

StepAction
1. Click 💾 UploadPOST /connect/csv-upload (body: {opcs, tags} two text fields)
2. Server validationValidates header / column count / type / OPC_ID matching
3. DB registrationpe.app_opc + pe.app_tag upsert (existing TAG_ID is not updated — skipped)
4. Toast"Once you restart the server, collection for the registered OPC connections and tags will begin."

After upload — restart recommended so the gateway cache (OPCAndTagsCache) reads the new OPC/tags (bin/restart-app.sh, 30–90 seconds). OPCs registered with auto-start (AUTO_COLLECT=true) will begin collection immediately after restart.


6. Common Pitfalls​

SymptomCause / Fix
0 records after uploadMissing header / column count mismatch / encoding (UTF-8 BOM)
Korean characters corruptedExcel default cp949 saved. Force UTF-8 — Save As → CSV UTF-8
Same TAG_ID not updatedNormal behavior — duplicate TAG_IDs are skipped. To change, use Tag Registration screen or REST PUT /api/v1/tag/{tagId}
OPC registered but TAGs not visibleTAG CSV's OPC_ID doesn't exactly match OPC CSV's OPC_ID. Case / whitespace
ASYNC, AUTO_COLLECT treated as falseTrue / TRUE are fine, but empty cells become false. Explicitly enter true
PLC_ADDRESS column registered emptyCommas inside cells in CSV split the line. If a cell contains a comma, quote it with "..."
Trailing space at end of line → column mismatchTrailing spaces may be added during Excel → CSV conversion. Trim in a text editor
Upload succeeds but no values on chartRegistered with OPC AUTO_COLLECT=false but Start not clicked after restart. Use ▶ Start in /ui/connect/list

7. Further Reading​