I want to modify settings of a National Instruments PXI system via pyvisa. In particular, I want to programmatically route a trigger from bus 1 to bus 2 on the backplane.
There is a documentation by National Instruments which explains the process via a Labview VI:
This basically tells me to
- open a VISA session to the backplane
- set src and dest trigger bus attributes
- use map_trigger function
Step 1) works fine via pyvisa, I can open a communication with the backplane via backplane = rm.open_resource('PXI0::2::BACKPLANE')
, as described in the resource names.
But after having opened a visa session to the backplane, I cannot find any of the described src trig bus and dest trig bus attributes here. There is only a bunch of attribute classes such as AttrVI_ATTR_RM_SESSION, which do not seem to contain any of the values I am interested in. But I guess I am misunderstanding something here.
Step 3) would be straightforward, as this functionality is directly implemented in pyvisa.
So the remaining question is: How can I modify the source trigger bus and destination trigger bus in a PXI backplane via pyvisa?
I found the location of all required attributes: pyvisa.constants lists all addresses of all possible attributes (for any interface).
To access a specific attribute, this can be implemented via the set_visa_attributes function: