From 82f81b4b02772915f137b98dfc612a218d964d2c Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 8 Dec 2014 16:24:30 +1100 Subject: [PATCH] Change the byte order and start addresses for the doppler modbus driver --- .../config/beamline/aerolas_doppler.sct | 109 ++++++++++++------ 1 file changed, 73 insertions(+), 36 deletions(-) diff --git a/site_ansto/instrument/config/beamline/aerolas_doppler.sct b/site_ansto/instrument/config/beamline/aerolas_doppler.sct index d08a31bc..7da6bbb9 100644 --- a/site_ansto/instrument/config/beamline/aerolas_doppler.sct +++ b/site_ansto/instrument/config/beamline/aerolas_doppler.sct @@ -3,7 +3,8 @@ driver aerolas_doppler = { protocol = modbus_ap; class = instrument; simulation_group = motor_simulation; - group = { + make_args = "{testing false}" + group ctrl = { readable = 1; writeable = 1; type = int; @@ -12,25 +13,26 @@ driver aerolas_doppler = { write_function = wrUShort; var run_cmd = { allowed = "0,1"; - read_command = "1"; - write_command = "1"; + read_command = "0"; + write_command = "0"; + lowerlimit = 0; upperlimit = 1; } type = float; fetch_function = getFloat; read_function = rdFloat; write_function = wrFloat; var amplitude = { - read_command = "2"; - write_command = "2"; + read_command = "1"; + write_command = "1"; lowerlimit = 0; upperlimit = 75; units = "mm"; } var velocity = { type = float; - read_command = "4"; - write_command = "4"; - lowerlimit = 0; upperlimit = 4700; - units = "mm/S"; + read_command = "3"; + write_command = "3"; + lowerlimit = 0; upperlimit = 4.700; + units = "m/S"; } } group read_write = { @@ -40,21 +42,21 @@ driver aerolas_doppler = { fetch_function = getUShort; read_function = rdUShort; write_function = wrUShort; - var move_profile = { + var profile = { allowed = "0,1"; - read_command = "7"; - write_command = "7"; + read_command = "6"; + write_command = "6"; } fetch_function = getULong; read_function = rdULong; write_function = wrULong; var te_ok_cycles = { - read_command = "8"; - write_command = "8"; + read_command = "7"; + write_command = "7"; } var te_ok_time = { - read_command = "10"; - write_command = "10"; + read_command = "9"; + write_command = "9"; } } group read_only = { @@ -63,31 +65,66 @@ driver aerolas_doppler = { type = int; fetch_function = getUShort; read_function = rdUShort; - var run_state = { read_command = "1001"; } - var arc_state = { read_command = "1017"; } - var version_number = { read_command = "1019"; } + var run_state = { read_command = "1000"; } + var arc_state = { read_command = "1016"; } + var version_number = { read_command = "1018"; } fetch_function = getULong; read_function = rdULong; - var move_error_code = { read_command = "1004"; } - var move_abs_counter = { read_command = "1006"; } - var move_abs_counter = { read_command = "1006"; } - var calc_error_code = { read_command = "1020"; } + var move_rel_counter = { read_command = "1003"; } + var move_abs_counter = { read_command = "1005"; } type = float; fetch_function = getFloat; read_function = rdFloat; - var move_amplitude_min = { read_command = "1008"; } - var move_amplitude_max = { read_command = "1010"; } - var move_velocity_min = { read_command = "1012"; } - var move_velocity_max = { read_command = "1014"; } - var braking_distance = { read_command = "1022"; } - var velocity_ratio = { read_command = "1024"; } - var continuous_acceleration = { read_command = "1026"; } - var maximum_acceleration = { read_command = "1028"; } + var move_amplitude_min = { read_command = "1007"; } + var move_amplitude_max = { read_command = "1009"; } + var move_velocity_min = { read_command = "1011"; } + var move_velocity_max = { read_command = "1013"; } + } + group testing = { + conditional = "${testing}"; + group shorts = { + readable = 30; + data = false; nxsave = false; mutable = false; + type = int; + fetch_function = getUShort; + read_function = rdUShort; +%exec +exec_output = [] +for i in range(0,30): + exec_output += ["var short_%04d = { read_command = '%d'; }" % (i, i)] + exec_output += ["var short_%04d = { read_command = '%d'; }" % (1000+i, 1000+i)] +%end + } + group longs = { + readable = 30; + data = false; nxsave = false; mutable = false; + type = int; + fetch_function = getULong; + read_function = rdULong; +%exec +exec_output = [] +for i in range(0,30): + exec_output += ["var long_%04d = { read_command = '%d'; }" % (i, i)] + exec_output += ["var long_%04d = { read_command = '%d'; }" % (1000+i, 1000+i)] +%end + } + group floats = { + readable = 30; + data = false; nxsave = false; mutable = false; + type = float; + fetch_function = getFloat; + read_function = rdFloat; +%exec +exec_output = [] +for i in range(0,30): + exec_output += ["var float_%04d = { read_command = '%d'; }" % (i, i)] + exec_output += ["var float_%04d = { read_command = '%d'; }" % (1000+i, 1000+i)] +%end + } } - code fetch_function getFloat = { @TCL - set cmd "1:3:${cmd_str}:1:F32" + set cmd "1:3:${cmd_str}:1:F32\[2,3,0,1\]" @END } code read_function rdFloat = { @@ -96,7 +133,7 @@ driver aerolas_doppler = { } code write_function wrFloat = { @TCL - set cmd "1:16:${cmd_str}:1:F32:${par}" + set cmd "1:16:${cmd_str}:1:F32\[2,3,0,1\]${par}" @END } @@ -117,7 +154,7 @@ driver aerolas_doppler = { code fetch_function getULong = { @TCL - set cmd "1:3:${cmd_str}:1:U32" + set cmd "1:3:${cmd_str}:1:U32\[2,3,0,1\]" @END } code read_function rdULong = { @@ -126,7 +163,7 @@ driver aerolas_doppler = { } code write_function wrULong = { @TCL - set cmd "1:16:${cmd_str}:1:U32:${par}" + set cmd "1:16:${cmd_str}:1:U32\[2,3,0,1\]${par}" @END }