Web-based pallet pattern editor that communicates with a SIMATIC S7 PLC (or PLCSIM Advanced) at 192.168.0.10 via the SIMATIC S7 WebServer API.
Before running the editor, ensure your PLC or PLCSIM Advanced instance is configured correctly:
-
Reachability: The PLC must be reachable at
192.168.0.10from your development machine. Verify with:ping 192.168.0.10
-
Web Server: In TIA Portal, enable the Web Server and Web API for the PLC project:
- Open the PLC device properties
- Enable "Web server" and "Web API" features
-
User Credentials: Create a user (e.g.
Admin/12345678) in the PLC web server configuration. The app uses these defaults; change them insrc/services/auth.services.tsif needed. -
Browser Access: Open
https://192.168.0.10in a browser and accept the self-signed certificate. This helps avoid TLS warnings when the editor connects. -
Data Block: The PLC program must define a data block
DB_WebPalletEditorwith the structure expected by the editor (header, boxes array, command flags). Seesrc/services/pallet-editor.services.tsfor the PLC path mappings.
npm install
npm run devThe app runs at http://localhost:5173. In development, a Vite proxy forwards /api requests to the PLC to avoid CORS. Set VITE_PLC_TARGET to a different IP if needed:
VITE_PLC_TARGET=192.168.8.10 npm run devnpm run buildOutput goes to dist/palletEditor/. Deploy this folder to your PLC web server or any static host.
- Start PLCSIM Advanced and load your TIA Portal project.
- Run the PLC (ensure
DB_WebPalletEditoris present and the Web API is enabled). - Run
npm run devand openhttp://localhost:5173. - Connect: The status bar should show "Connected" after login.
- Load: Click "Load" to read the current pattern from the PLC.
- Edit: Move, rotate, add, or delete boxes. Status shows "Unsaved".
- Save: Click "Save" to write the pattern to the PLC. Status should show "Saved".
- Error cases: Stop the PLC or use a wrong IP to verify error messages appear in the status line.