04-23-2020 02:56 AM
If PXI is turned off during communication with PXI and MXI, the program will stop.
Is there any way to fix it?
Any advice is appreciated.
04-23-2020
06:24 AM
- last edited on
12-18-2024
11:02 AM
by
Content Cleaner
You have provided almost no details here, but I'll just guess. I presume you are running a DAQmx data acquisition task that acquires data from a PXI chassis over an MXI connection to your PC. If you turn off the PXI chassis, the DAQmx task will throw an error. I'm guessing your program is not handling this error well, and so it is stopping abruptly (probably with a nasty-looking LabVIEW unhandled error dialog).
You need to handle any error coming out of your DAQmx VI's without killing your application. You also need to close any data files you might be creating, or file access violations may prevent you from moving or deleting partial files.
As for the PXI chassis, it is connected via MXI. This means it is an extension of the PCI Express bus of the PC, and as such it must have its resources discovered by the PC during boot up. Therefore, you must restart the PC (with the PXI chassis powered on) for the PXI resources to appear in the available devices list in MAX.
So the bottom line is you cannot automatically recover from PXI power outage when using the chassis through an MXI connection. You would have to have an integrated PXI Controller (and probably some fancy code) to automatically resume data acquisition on startup.
04-23-2020 11:37 AM
The real question is why is the PXI being turned off?
Is it someone doing that intentionally or accidentally? Or is it a power outage situation.
If the former, slap people on the wrist and/or figure out a way to prevent them from doing that if they won't listen.
If the latter, get a battery backup system to plug the PXI and the PC into. Better ones I've bought from APS will communicate with the computer and I've used LabVIEW drivers to read their status. If it detects it has AC power, you can programmatically shut your application down nicely without errors. Perhaps even allow it to continue running for X amount of time or you detect the battery life remaining has dropped below a threshold.
04-23-2020 01:10 PM
"If I turn off my computer, the program stops. Can I fix that?"
Yes: do not turn off the computer.
04-23-2020 06:26 PM - edited 04-23-2020 06:49 PM
This is when the PXI is powered off due to a power outage or a special situation.
It is natural that communication stops.
However, the Labview program is interrupted and the PC freezes.
As the program stopped, I was asking how to fix the PC freeze.
In the case of DAQ, if communication is lost, an error appears in the Labview program and if there is an error, the program can be terminated.
However, when PXI is lost, the Labview program freezes and the PC freezes.
Is there any way to fix PC freeze?
04-23-2020 06:28 PM - edited 04-23-2020 06:49 PM
APS cannot be installed due to circumstances.
It is natural that communication stops.
However, the Labview program is interrupted and the PC freezes.
As the program stopped, I was asking how to fix the PC freeze.
In the case of DAQ, if communication is lost, an error appears in the Labview program and if there is an error, the program can be terminated.
However, when PXI is lost, the Labview program freezes and the PC freezes.
Is there any way to fix PC freeze?
04-23-2020 06:31 PM - edited 04-23-2020 06:50 PM
I know I need to restart my PC to restore communication with PXI.
When PXI loses power, the PC freezes.
Just hope the PC doesn't stop.
It is natural that communication stops.
However, the Labview program is interrupted and the PC freezes.
As the program stopped, I was asking how to fix the PC freeze.
In the case of DAQ, if communication is lost, an error appears in the Labview program and if there is an error, the program can be terminated.
However, when PXI is lost, the Labview program freezes and the PC freezes.
Is there any way to fix PC freeze?
04-23-2020 08:11 PM - edited 04-23-2020 08:14 PM
So the PXI bus is an extension of your PCI bus in your computer. When the PCI bus powers down, it's similar to yanking a PCI card out of your computer with no power-down. Crashing your computer is unfortunate, but an expected behavior. See this thread:
https://forums.ni.com/t5/PXI/restart-computer-is-requred-after-switch-ON-OF-NI-PXI-1033/td-p/851051
The blue username is an official NI rep who said the same thing.
Another thread with the same info:
https://forums.ni.com/t5/PXI/PXIe-1065-Cards-won-t-initialize-on-restart/td-p/1518872
Unfortunately it doesn't seem you can recover from this without rebooting your computer. Initialization of the PXI/PXIe bus happens during BIOS setup, and cannot be done once the PC is on. Since rebooting the PXIe chassis requires a new setup, there doesn't appear to be a way to recover from this, as it's not a "software" problem. It's literally the computer not knowing how to respond when it loses a device (or more) on the PCI bus, which is not hot-swappable like the USB bus is.
Edit: Technically the PCIe bus *can* support hot swapping, but it's not a standard setup. It's only done when it's absolutely required as it takes a lot of software overhead to do.
Check this KB article that confirms NI's devices are NOT hot-swappable (and thus require a reboot): https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kISoSAM&l=en-US
Sorry you can't solve this with a quick software fix, but it's a low-level hardware issue. Can you replace the PXI devices with USB or Ethernet ones? It's a lot of software (especially compared to adding a UPS) but it'd be much less sensitive to power loss.
04-23-2020 11:13 PM
@RevolutionKwon wrote:
APS cannot be installed due to circumstances.
Why not? That would be the best solution.
How often do these power outages occur? Apparently it has happened more than once for you to raise this question. If a power outage cause such problems, then the real solution is to figure out how to prevent the outage.