2015-09-22 15:27:23 +02:00
|
|
|
# OPAL-RT Asynchronous Process {#opal}
|
2014-06-28 20:56:59 +00:00
|
|
|
|
2016-06-08 23:21:42 +02:00
|
|
|
The communication between OPAL-RT models and VILLASnode is established by using asynchronous programs.
|
2014-07-16 09:34:04 +00:00
|
|
|
Asynchronous programs are are a feature of RT-LAB. They are used to exchange data between Simulink models and custom C programs.
|
2016-02-10 19:22:06 +01:00
|
|
|
There are two ways to exchange sample values with an OPAL-RT simulator:
|
2014-07-14 11:01:34 +00:00
|
|
|
|
2016-02-10 19:58:05 +01:00
|
|
|
1. Use our adapted version of OPAL-RT's AsyncIP example for asynchronous processes (see `clients/opal/` directory)
|
2016-06-08 23:21:42 +02:00
|
|
|
In this mode, OPAL will send sample data via UDP to VILLASnode. VILLASnode has to use the `socket` node-type.
|
|
|
|
2. Run VILLASnode as an asynchronous process itself. This is a highly experimental feature and implemented in the node-type `opal`.
|
|
|
|
It requires a 32-bit version of the `villas-node`. Data exchange is then handled using OPAL-RT's libOpalAsyncApi.
|
2016-02-10 19:22:06 +01:00
|
|
|
|
|
|
|
The following description applies only to the `opal` node-type:
|
2014-07-14 11:01:34 +00:00
|
|
|
|
2015-08-07 01:20:27 +02:00
|
|
|
## Configuration
|
|
|
|
|
2015-09-22 15:27:23 +02:00
|
|
|
Every `opal` node supports the following special settings:
|
2015-08-07 01:20:27 +02:00
|
|
|
|
2015-09-22 15:27:23 +02:00
|
|
|
#### `send_id` *(integer)*
|
2015-08-07 01:20:27 +02:00
|
|
|
|
2015-09-22 15:27:23 +02:00
|
|
|
#### `recv_id` *(integer)*
|
|
|
|
|
|
|
|
#### `reply` *(boolean)*
|
2014-07-14 11:01:34 +00:00
|
|
|
|
2015-10-12 15:29:47 +02:00
|
|
|
### Example
|
|
|
|
|
2015-12-11 19:20:50 +01:00
|
|
|
nodes = {
|
|
|
|
opal_node = { # The server can be started as an Asynchronous process
|
|
|
|
type = "opal", # from within an OPAL-RT model.
|
|
|
|
|
|
|
|
### The following settings are specific to the opal node-type!! ###
|
|
|
|
|
|
|
|
send_id = 1, # It's possible to have multiple send / recv Icons per model
|
|
|
|
recv_id = 1, # Specify the ID here.
|
|
|
|
reply = true
|
|
|
|
}
|
2015-10-12 15:29:47 +02:00
|
|
|
}
|
|
|
|
|
2014-07-14 10:47:26 +00:00
|
|
|
## Arguments for OPAL-RT block
|
|
|
|
|
2014-07-16 09:34:04 +00:00
|
|
|
RT-LAB already provides a block to establish simple TCP/IP communication: ???
|
|
|
|
This block is based on a more generic block used for aynchronous programs: ???
|
|
|
|
|
|
|
|
@todo Insert name of RT-LAB blocks.
|
|
|
|
|
2014-07-14 11:01:34 +00:00
|
|
|
| Param | Description | Example Value |
|
|
|
|
| :------------- | :------------ |:-------------- |
|
|
|
|
| FloatParam[0] | Protocol | |
|
|
|
|
| FloatParam[1] | RemotePort | 10200 |
|
|
|
|
| FloatParam[2] | LocalPort | 10201 |
|
|
|
|
| StringParam[0] | RemoteAddr | 192.168.0.10 |
|
|
|
|
| StringParam[1] | LocalAddr | 192.168.0.11 |
|
|
|
|
| StringParam[2] | InterfaceName | eth2 |
|
2014-07-14 10:47:26 +00:00
|
|
|
|
2014-06-28 20:56:59 +00:00
|
|
|
@todo Complete documentation for the OPAL-RT Simulink module.
|