Solution
When developing applications with Scan Interface, the Scan Engine does not load instantly on the target. If the Real-Time application tries to access inputs or outputs before the Scan Engine is running,
error -65536 or
error -65589 will be thrown and the application will close.
There are several ways to overcome this:
- Introduce a fixed delay in the initialization stage of the application which will wait up to 10 seconds before trying to access any inputs or outputs.
- Develop a simple VI that will read an input variable and check the error coming out from the I/O node in a while loop. Only stop the while loop if error code is simultaneously not equal to -65536 or -65589, or a defined amount of time has passed (to avoid iterating indefinitely). An example of this implementation is attached below.