Hello all,
I wrote a unit conversion class from volts to amps to control current output from a power supply using external voltage from an NI DAQ. Everything seems to be working, except for the fact that in runviewer, the desired values of the current are not showing up.
I am wondering if this is an issue specific to runviewer, or if it is something to do with my code.
This is how I defined the relevant channel in the connection table
main_MOT_coils=AnalogOut(
name="main_MOT_coils",
parent_device=ni_card_1,
connection="ao0",
unit_conversion_class=Test,
unit_conversion_parameters = {"slope": 23}
)
And this is how I defined it in the shot file
main_MOT_coils.apply_calibration(value = 23, units = 'A')
main_MOT_coils.constant(t=t_initial,value=2) #start at 18 G/cm
main_MOT_coils.ramp(t=t_repump, duration = t_sit, initial=2, final=5, samplerate=rate)
main_MOT_coils.constant(t=t_compress, value=fgrad)
In BLACS, I see that this channel has the option of V or A on the toggle, but in runviewer, if I ramp from 2 to 5 Amps I expect to see a voltage of 2/23 to 5/23 volts. However I see a ramp from 2 to 5 volts, which tells me that somehow the channel is only receiving the default unit conversion value of 1.
I have attached the unit conversion file as well.
best,