Summary:
When Shared Memory Module starts, if the input or output file already exists in the filesystem, Shared Memory does not read/write to the file. There is no warning or error reported to the user.
Root cause:
init runtime datastructures.vi is responsible for creating the input/output files in /dev/shm. If the file already exist, it uses Index Array/Replace Array Subset functions pair to update the content of outputs array in shared memory module runtime in object.
In situation described above, the outputs array is empty and therefore index supplied to Replace Array Subset is outside of otuput's dimension and function do nothing. outputs array remains empty after initialization.
This does not happen when the module is initialized when there is no file in the filesystem at the time of initialization, because another case extends the outputs array with Build Array at the first pass of the loop.
Note that using result of a search within filenames listed with List Folder as an index into outputs array may be not optimal unless one can guarantee that (a) there are no other files in the folder and (b) the order of filenames in List Directory results is preserved between when they were created and during initialization. This may lead to errors in the future when supporting more data types.
Steps to reproduce:
- Create a DCAF configuration with SharedMemoryModule channels (write to file type)
- Generate DCAF runtime project, deploy all to target and run the main RT vi in interactive mode.
- Stop the main RT vi execution with "Exit" button.
note that at this step /dev/shm/Standard Engine/input/Double file exists in the target filesystem as it is not removed from filesystem when engine stops
- Restart the main RT vi. Observe the engine starts with no errors reported.
- Observe the content of /dev/shm/Standard Engine/input/Double not being updated (not even counter value)
Workaround:
everytime one wants to stop and restart the DCAF engine,
rm /dev/shm/Standard Engine/input/Double
rm /dev/shm/Standard Engine/output/Double
Summary:
When Shared Memory Module starts, if the input or output file already exists in the filesystem, Shared Memory does not read/write to the file. There is no warning or error reported to the user.
Root cause:
init runtime datastructures.vi is responsible for creating the input/output files in /dev/shm. If the file already exist, it uses Index Array/Replace Array Subset functions pair to update the content of outputs array in shared memory module runtime in object.
In situation described above, the outputs array is empty and therefore index supplied to Replace Array Subset is outside of otuput's dimension and function do nothing. outputs array remains empty after initialization.
This does not happen when the module is initialized when there is no file in the filesystem at the time of initialization, because another case extends the outputs array with Build Array at the first pass of the loop.
Note that using result of a search within filenames listed with List Folder as an index into outputs array may be not optimal unless one can guarantee that (a) there are no other files in the folder and (b) the order of filenames in List Directory results is preserved between when they were created and during initialization. This may lead to errors in the future when supporting more data types.
Steps to reproduce:
note that at this step /dev/shm/Standard Engine/input/Double file exists in the target filesystem as it is not removed from filesystem when engine stops
Workaround:
everytime one wants to stop and restart the DCAF engine,
rm /dev/shm/Standard Engine/input/Double
rm /dev/shm/Standard Engine/output/Double