# Simple driver generator for the Fast ComTech NHQ Power Supply # vim: ts=8 sts=2 sw=2 expandtab autoindent smartindent # driver nhq_200 = { debug_threshold = 1; vendor = FastComTech; device = NHQ; protocol = std; class = environment; simulation_group = environment_simulation; group = { readable = 10; var id = { type = text; read_command = '#'; } var break = { type = int; read_command = 'W'; } } group ch1 = { readable = 5; type = int; var voltage = { type = int; read_command = 'U1'; read_function = rdVoltage; } var current = { type = text; read_command = 'I1'; read_function = rdCurrent; } var v_lim = { read_command = 'M1'; } var i_lim = { read_command = 'N1'; } var status = { type = text; read_command = 'S1'; } var module = { read_command = 'T1'; } writeable = 1; var v_sp = { type = int; read_command = 'D1'; write_command = 'D1='; driveable = ch1/voltage; lowerlimit = 0; upperlimit = 3000; tolerance = 5; property settle_time = 10; } var i_trip = { read_command = 'L1'; write_command = 'L1='; } var v_ramp = { read_command = 'V1'; write_command = 'V1='; } var auto_start = { read_command = 'A1'; write_command = 'A1='; } readable = 0; var go = { write_command = 'G1'; } } group ch2 = { readable = 5; type = int; var voltage = { type = int; read_command = 'U2'; read_function = rdVoltage; } var current = { type = text; read_command = 'I2'; read_function = rdCurrent; } var v_lim = { read_command = 'M2'; } var i_lim = { read_command = 'N2'; } var status = { type = text; read_command = 'S2'; } var module = { read_command = 'T2'; } writeable = 1; var v_sp = { type = int; read_command = 'D2'; write_command = 'D2='; driveable = ch2/voltage; lowerlimit = 0; upperlimit = 3000; tolerance = 5; property settle_time = 10; } var i_trip = { read_command = 'L2'; write_command = 'L2='; } var v_ramp = { read_command = 'V2'; write_command = 'V2='; } var auto_start = { read_command = 'A2'; write_command = 'A2='; } readable = 0; var go = { write_command = 'G2'; } } code rdCurrent = {%% %%} code rdVoltage = {%% # Strip the leading sign set data [expr {abs(${data})}] %%} }