Skip to main content

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)

OrderColumnMeaningExample
1OPC_IDUnique identifier (letters/digits/_)OPC_LS_LINE1
2OPC_NAMEUser-facing display name라인1 LS PLC
3OPC_TYPEGateway code (LS / MELSEC / S7 / MODBUS / OPCUA / EIP / LOGIX / HTTP, etc.)LS
4OPC_AGENT_IPPLC IP192.168.100.50
5OPC_AGENT_PORTTCP port2004
6TIMECYCLECollection interval (ms)1000
7ASYNCAsynchronous readtrue / false
8AUTO_COLLECTStart collection automatically after boottrue / false
9DESCRIPTIONFree-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)

OrderColumnMeaningExample
1OPC_IDMatches OPC_ID in the OPC table aboveOPC_LS_LINE1
2TAG_IDUnique ID (letters/digits/_)TAG_LINE1_TEMP
3TAG_NAMEUser-facing 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 qualifier (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-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

  1. Paste the table above into Excel as-is (1 header row + data)
  2. Save AsCSV UTF-8 (Comma delimited) format (watch out for garbled Korean with the default cp949)
  3. Open the CSV file in a text editor and verify that commas inside cells are automatically quoted ("...")
  4. Paste the CSV body as-is into the OPC section or the TAG section

5. Upload Flow

StepAction
1. Click 💾 UploadPOST /connect/csv-upload (body: the two {opcs, tags} texts)
2. Server validationValidates header / column count / types / OPC_ID matching
3. DB registrationpe.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

SymptomCause / Resolution
0 records after uploadMissing header / wrong column count / encoding (UTF-8 BOM)
Garbled KoreanSaved with Excel's default cp949. Force UTF-8Save As → CSV UTF-8
The same TAG_ID is not updatedExpected 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 appearOPC_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 falseTrue / TRUE are both fine, but an empty cell yields false. Enter true explicitly
PLC_ADDRESS column registered emptyA comma inside a cell in the CSV split the row. Quote cells containing commas with "..."
Trailing space at end of a line → column mismatchExcel → CSV conversion may add trailing spaces. Trim them all in a text editor
Upload succeeds but no values appear in chartsThe OPC was registered with AUTO_COLLECT=false but Start was not pressed after the restart. Press ▶ Start in /ui/connect/list

7. Learn More