Ten-minute first run
In ten minutes you confirm that the package you received communicates. You run two programs on the same computer and connect them over the loopback address (127.0.0.1), so you don’t need any equipment.
Step 1: Prepare the package
Section titled “Step 1: Prepare the package”-
Compare the SHA-256 hash of the file with the value you received:
터미널 창 shasum -a 256 <package file> # macOSsha256sum <package file> # LinuxIn Windows PowerShell, use
Get-FileHash <package file> -Algorithm SHA256. -
Extract it into a new folder whose path has no spaces. Install the SDK describes the folder layout and the environment setup.
Step 2: First exchange
Section titled “Step 2: First exchange”bin/pdcomm-tutorial in the SECS/GEM package is a prebuilt example. Run it as equipment in one terminal and as host in another, and the two establish an HSMS connection and exchange equipment information and variable values.
-
On Linux, go to the package folder in each terminal and set the library path. On Windows, run
$env:PATH = "$PWD\sdk\lib;$env:PATH"instead.터미널 창 export LD_LIBRARY_PATH="$PWD/sdk/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"The example uses the SDK, so it needs a license. In both terminals, set the path of the evaluation license file you received. On Windows, use
$env:PDCOMM_LICENSE_FILE = "<file path>". Install and check a license has the details.터미널 창 export PDCOMM_LICENSE_FILE="$HOME/pdcomm/pdcomm.license" -
In terminal 1, start the equipment in passive mode. It waits for a connection on
127.0.0.1:5000.터미널 창 bin/pdcomm-tutorial equipment passive 127.0.0.1:5000 --auto -
In terminal 2, start the host in active mode:
터미널 창 bin/pdcomm-tutorial host active 127.0.0.1:5000 --autoWith
--auto, the host sends the establish-communication (S1F13), equipment-identity (S1F1), and variable-value (S1F3) requests on its own and then exits. Both terminals end withPASS tutorial …and exit code 0:PASS tutorial host active
If another program uses port 5000, change both commands to the same free port.
bin/pdcomm-modbus-headless in the Modbus package is a simulator driven by JSON commands on standard input. Run one as a server and one as a client.
-
In terminal 1, start the server and type these two lines one after the other. The server runs until its input ends.
터미널 창 bin/pdcomm-modbus-headless{"action":"configure","config":{"transport":"tcp","role":"server","address":"127.0.0.1:1502","port":"","unit":1,"baud":19200,"parity":"even","stop_bits":1,"timeout_ms":1000}}{"action":"connect"}When the second reply contains
"connected":true, the server is waiting on127.0.0.1:1502. -
In terminal 2, start the client and type these four lines. They write 42 to holding register 0 and read it back.
터미널 창 bin/pdcomm-modbus-headless{"action":"configure","config":{"transport":"tcp","role":"client","address":"127.0.0.1:1502","port":"","unit":1,"baud":19200,"parity":"even","stop_bits":1,"timeout_ms":1000}}{"action":"connect"}{"action":"request","pdu":"060000002A"}{"action":"request","pdu":"0300000001"}You succeeded if the last reply looks like this.
sourceiswire, so the values crossed a real TCP connection.{"ok":true,"result":{"response":[3,2,0,42],"source":"wire","status":"success"}} -
Press Ctrl+D in both terminals (Ctrl+Z and then Enter on Windows) to end them.
Check that the headless simulator of the OPC UA package (apps profile) runs:
printf '%s\n' '{"action":"capabilities"}' | bin/pdcomm-opcua-headlessA reply that starts with {"ok":true,"result":{"actions":[… means it works. OPC UA connects through certificate-based secure channels, so follow the OPC UA quickstart for your first connection.
Step 3: Product quickstarts
Section titled “Step 3: Product quickstarts”After the first exchange works, connect a program you build yourself to a simulator in the product quickstart:
| Product | Next page |
|---|---|
| SECS/GEM | SECS/GEM quickstart |
| Modbus | Modbus quickstart |
| MQTT | MQTT quickstart |
| OPC UA | OPC UA quickstart |
| Virtual serial ports | Tools quickstart |