How to Detect Which Power Input Is Used by My Linux RT cRIO 904x

Updated May 25, 2021

Environment

Hardware

  • cRIO-9040
  • cRIO-9041
  • cRIO-9042
  • cRIO-9043
  • cRIO-9045
  • cRIO-9046
  • cRIO-9047
  • cRIO-9048
  • cRIO-9049

Operating System

  • LabVIEW Real-Time (NI Linux Real-Time)

Some cRIO target have a power connector to which you can connect a primary and secondary
power supply like this one: 
2021-05-25_13h50_34.png
How do I programmatically know which one is used?

If you look at the documentation of your cRIO, you will see that the color of the Power LED is linked to the Power Input you are using. That way, you can access this value by using this kind of application on your target: 
cRIOPowerSupplyMonitor.png
It reads the value of the brightness of the color of your choice (green in this example) and outputs TRUE on the "V1 power" boolean if the power input V1 is used.