UDP Communication with Unity in Simulink Destkop Real-time Kernel Mode
7 views (last 30 days)
I have a desktop real-time system executing on a single PC using kernel mode. I would like to be able to send to and receive data packets from unity through UDP. The unity program is also running on the same PC. The data in collected from a DAQ (NI PCI 6229). This is the block layout I'm using, which is similar to the one here. Note that the sine block is for testing; it will be replaced with the input source block
However, whenever I build the model in kernel mode, I get the following error:
### Writing source file rtGetNaN.c
### Writing header file DCMotor_Test_PWM_LF_Unity_private.h
### Writing header file rtmodel.h
### Writing source file DCMotor_Test_PWM_LF_Unity_data.c
### Writing header file rt_defines.h
### TLC code generation complete.
### Generating TLC interface API.
### Creating data type transition file DCMotor_Test_PWM_LF_Unity_dt.h
Warning:Matching "From" for "Goto" 'DCMotor_Test_PWM_LF_Unity/Goto3' not found
Top model targets built:
Model Action Rebuild Reason
DCMotor_Test_PWM_LF_Unity Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 6.582s
Error: Dot indexing is not supported for variables of this type.
Running the model in connected I/O mode works and the data is sent and received; however, it's not real-time (around 1-2 secs of delay) despite the present of the real-time sync block.
Jan Houska on 20 May 2022
the interface blocks are target-specific. So you cannot use block from Simulink Real-Time library with Simulink Desktop Real-Time. Please see the sldrt_packetio shipping example to learn how to use UDP with Simulink Desktop Real-Time.
Good Luck, Jan