VILLASframework
Modular co-simulation framework
Lab 7: Read samples from file and send them to node

Easy way (non real-time)

villas_pipe_file2.svg
Send and receive samples from files to simulator
$ villas pipe lab3.conf udp_node1 < file_send.dat > file_recv.dat

Note: In this lab all samples of file.dat will be sent immediately to udp_node1. Usually, this is not the desired behaviour. We will show later how to stream the samples in real-time to a destination node.

Better way (real-time)

1 nodes = {
2  file_node1 = {
3  type = "file",
4 
5  uri = "file_send.dat"
6 
7  in = {
8 
9  }
10  }
11 }

In order to stream the samples in real-time from a file, we will use the File node-type with the following configuration file (lab7.conf):

villas_pipe_file3.svg
Stream samples in real-time from file
$ villas pipe lab7.conf file_node1 | villas pipe lab3.conf udp_node1 > file_recv.dat

Go to [lab 8] =>(node-lab-8)