12-03-2025 12:15 PM
I have a project with user-defined variables as well as IO variables directly to the card.
In the realtime application when i hit "abort" my program crashes. but the IO (analog out and Digital out) for my slave NI 9145 remain the same.
I need the slave to revert back 0 for analog out and false for digital out, in the even that my program crashes. How can I implement such a feature? Do I need to use the or can i use something else? Is there a recommended way of doing so?
12-03-2025 12:31 PM
In the past 2 or 3 months, I've noticed numerous posts asking how to make the "abort" button work properly. The most common answer (by users who are even more experienced and knowledgeable than I) is "NEVER USE THE ABORT BUTTON" (some even go so far as suggesting you hide this Control).
When you detect a situation when an "Abort" seems to be necessary, you don't want to stop the computer from running, but want to perform an "orderly" (and programmed) series of steps. In your case, you need to tell the Real-Time side to go to a "Shut-down" routine that sets the hardware as you want it (A/D, D/A, and Digital I/O, plus perhaps others) and stop all the parallel loops in an orderly manner. On the Host, you need to do the same things, and also close any open files.
Bob Schor
12-03-2025 01:38 PM
Bob,
I am trying to simulate a crash, not safely abort the program. This is exactly why I need this logic to work with abort.
12-03-2025 08:05 PM
See shipping example Hardware Input and Output >> NI-Industrial Communications >> EtherCAT >> Advanced >> Safe Value with FPGA.lvproj
Make sure Watchdog is enabled.
When the EtherCAT crashes and stops sending datagram, the watchdog timeouts and the slave transitions to Safe-Op state.
12-04-2025 10:16 AM
ZYOng,
That will work for user defined variables. But I also have Real-Time Scan IO Variables. Not controlled by the FPGA. So I only have read access apparently. What can I do? They are not present as IO nodes to manipulate either.