Importing Recorded Data (2.0-pr.7)

PolySync data can be recorded on a system with one or more hosts, and replayed on any other system with one or more hosts. The System Design File (SDF) is used to define the PolySync runtime that recorded the data, and its default location is: ```bash `/usr/local/polysync/db/psync.sdf` ``` Once defined, nodes can be toggled from enabled or disabled, and shouldn't be deleted from the SDF for replay. Node parameters, such as mount position and message-publish toggle, can be changed after the data has been recorded. It's important to note that the number of nodes that can run on a single host is determined by the memory and CPU capabilities of the ECU. ### 1. Copy the SDF The System Design File that was used to record the logfile session must be used during the replay session. The Dynamic Driver nodes reference their SDF Node ID to locate the appropriate `plog` file from the logfile session directory. Copy the `psync.sdf` file from the imported logfile session to the `PSYNC_HOME/db` directory. It's important to refrain from deleting any hosts or nodes until instructed to do so. ### 2. Define the PolySync runtime In this context, the PolySync runtime defines how many hosts are connected to the physical Gigabet Ethernet network and are expected to have one or more nodes replaying data. PolySync provides the SDF Configurator tool to modify and define the runtime. ```bash $ polysync-sdf-configurator ``` #### 3. SDF Configurator Host Wizard Using the Host Wizard tool, the SDF Configurator performs a host configuration check on startup. Once the local machine is configured, you can add any other hosts that will replay data. ![SDF Configurator Host Wizard]( #### 4. Adding additional hosts To add a new host to the SDF, start the SDF Configurator: ```bash $ polysync-sdf-configurator ``` Now, select the "+" in the bar at the top of the application (next to "Mule Laptop" in the image below). ![Add a new Host]( Each host has metadata associated with it that must be set before any nodes can be started. * Name * Custom name to reference this host * Interface address * The IP address in the network that needs to be connected to * This address **must** exist on the local host for PolySync nodes to run * License file * Optional absolute path to a physical license file * Typically the license is stored in trusted storage, and this is "(null)" * Record & Replay directory * Directory to write your logfile sessions to, as well as the directory to search for existing logfile sessions ### 5. Moving nodes Once all of the hosts have been defined, the _move_ feature in the SDF Configurator can be used to move runtime nodes from the original host to the desired host. Nodes can execute on any machine, but can be moved to a different host if it needs to execute on specific hardware. #### 6. Remove unused hosts With all the nodes moved to the appropriate hosts, use the **X** to delete the unused hosts. ### 7. Physical network configuration If there is more than one host defined in the SDF, now is the time to configure the physical network. Each host ECU must be connected to the same Ethernet Gigabit switch, and have a matching IP address subnet. ### 8. Copying logfile data The logfile session should be copied to each host ECU defined in the SDF. It's important that the directory name of the logfile session (default is the UTC timestamp of the record time) is the same on each ECU. ### 9. Synchronize the SDF Once the SDF has been updated through the SDF Configurator, the physical file `polysync/db/psync.sdf` should be synchronized to all hosts defined in the runtime. Copy the file to all hosts from the local machine: ```bash $ scp $PSYNC_HOME/db/psync.sdf @:/usr/local/polysync/db/ ``` It is necessary to know the absolute path to the destination directory on the remote host, since environment variables will not be parsed by `scp`. ### 10. Replay data The system is ready to replay data. The [Studio's Replay module]( can be used to initiate replay. ### Conclusion Congratulations! You have successfully imported recorded data for replay.