|
60 | 60 |
|
61 | 61 | # Create a BIAS Camera, tirggered to take photos with flag 3 of pulseblaster_0
|
62 | 62 | Camera(
|
63 |
| - "andor_ixon_0", |
64 |
| - pulseblaster_0.direct_outputs, |
65 |
| - "flag 3", |
| 63 | + name="andor_ixon_0", |
| 64 | + parent_device=pulseblaster_0.direct_outputs, |
| 65 | + connection="flag 3", |
66 | 66 | BIAS_port=42520,
|
67 | 67 | serial_number="0000",
|
68 | 68 | SDK="IMAQdx",
|
|
87 | 87 |
|
88 | 88 | # Create the output/input channels on the above devices use the example1 conversion
|
89 | 89 | # class located in pythonlib/unitconversions/example.py with default paremeters
|
90 |
| -AnalogOut("analog0", ni_card_1, "ao0", unit_conversion_class=example1) |
| 90 | +AnalogOut( |
| 91 | + name="analog0", |
| 92 | + parent_device=ni_card_1, |
| 93 | + connection="ao0", |
| 94 | + unit_conversion_class=example1, |
| 95 | +) |
91 | 96 |
|
92 | 97 | # same as above, but we are changing some parameters used in the conversion and
|
93 | 98 | # specifying a prefix to be used with units. You can now program in mA, uA, mGauss,
|
94 | 99 | # uGauss
|
95 | 100 | AnalogOut(
|
96 |
| - "analog1", |
97 |
| - ni_card_1, |
98 |
| - "ao1", |
| 101 | + name="analog1", |
| 102 | + parent_device=ni_card_1, |
| 103 | + connection="ao1", |
99 | 104 | unit_conversion_class=example1,
|
100 | 105 | unit_conversion_parameters={"a": 5, "b": 1, "magnitudes": ["m", "u"]},
|
101 | 106 | )
|
102 |
| -AnalogOut("analog2", ni_card_0, "ao2") |
103 |
| -AnalogOut("analog3", ni_card_0, "ao3") |
104 |
| -AnalogIn("input1", ni_card_0, "ai0") |
105 |
| -DigitalOut("do0", ni_card_0, "port0/line2") |
106 |
| -Shutter("shutter1", ni_card_0, "port0/line1", delay=(0, 0)) |
107 |
| -Shutter("shutter2", pulseblaster_0.direct_outputs, "flag 2", delay=(0, 0)) |
108 |
| -DigitalOut("switch", pulseblaster_0.direct_outputs, "flag 4") |
109 |
| - |
110 |
| -DDS("dds1", novatechdds9m_0, "channel 0") |
111 |
| -DDS("dds2", novatechdds9m_0, "channel 1") |
112 |
| -StaticDDS("dds5", novatechdds9m_0, "channel 2") |
| 107 | +AnalogOut(name="analog2", parent_device=ni_card_0, connection="ao2") |
| 108 | +AnalogOut(name="analog3", parent_device=ni_card_0, connection="ao3") |
| 109 | +AnalogIn(name="input1", parent_device=ni_card_0, connection="ai0") |
| 110 | +DigitalOut(name="do0", parent_device=ni_card_0, connection="port0/line2") |
| 111 | +Shutter( |
| 112 | + name="shutter1", parent_device=ni_card_0, connection="port0/line1", delay=(0, 0) |
| 113 | +) |
| 114 | +Shutter( |
| 115 | + name="shutter2", |
| 116 | + parent_device=pulseblaster_0.direct_outputs, |
| 117 | + connection="flag 2", |
| 118 | + delay=(0, 0), |
| 119 | +) |
| 120 | +DigitalOut( |
| 121 | + name="switch", parent_device=pulseblaster_0.direct_outputs, connection="flag 4" |
| 122 | +) |
| 123 | + |
| 124 | +DDS(name="dds1", parent_device=novatechdds9m_0, connection="channel 0") |
| 125 | +DDS(name="dds2", parent_device=novatechdds9m_0, connection="channel 1") |
| 126 | +StaticDDS(name="dds5", parent_device=novatechdds9m_0, connection="channel 2") |
113 | 127 | # The next DDS is special because it has the frequency and amplitude calibrated using
|
114 | 128 | # example2 and example3 classes from pythonlib/unitconversions/example.py
|
115 | 129 | DDS(
|
116 |
| - "dds3", |
117 |
| - pulseblaster_0.direct_outputs, |
118 |
| - "dds 0", |
| 130 | + name="dds3", |
| 131 | + parent_device=pulseblaster_0.direct_outputs, |
| 132 | + connection="dds 0", |
119 | 133 | freq_conv_class=example2,
|
120 | 134 | freq_conv_params={"a": 4, "b": 6},
|
121 | 135 | amp_conv_class=example3,
|
122 | 136 | amp_conv_params={"a": 2, "b": 22, "magnitudes": ["m"]},
|
123 | 137 | )
|
124 |
| -DDS("dds4", pulseblaster_0.direct_outputs, "dds 1") |
| 138 | +DDS(name="dds4", parent_device=pulseblaster_0.direct_outputs, connection="dds 1") |
125 | 139 |
|
126 | 140 | # This sets up the inputs/counters/etc that will monitor
|
127 | 141 | # The first paremeter is the name for the WaitMonitor device
|
|
133 | 147 | # this channel should be physicaly connect to the external trigger of the master
|
134 | 148 | # pseudoclock.
|
135 | 149 | WaitMonitor(
|
136 |
| - "wait_monitor", ni_card_0, "port0/line0", ni_card_0, "ctr0", ni_card_0, "pfi1" |
| 150 | + name="wait_monitor", |
| 151 | + parent_device=ni_card_0, |
| 152 | + connection="port0/line0", |
| 153 | + acquisition_device=ni_card_0, |
| 154 | + acquisition_connection="ctr0", |
| 155 | + timeout_device=ni_card_0, |
| 156 | + timeout_connection="pfi1", |
137 | 157 | )
|
138 | 158 |
|
139 | 159 | # A variable to define the acquisition rate used for the analog outputs below.
|
|
0 commit comments