Third parameter was important, this code work for me
Not a piece of artwork but...
Code
PROGRAM SET_FA_WPP
TYPE
AW_PLS_SCH_T = STRUCTURE
PULSE_ENB : BOOLEAN
PULSE_FREQ : REAL
PULSE_DUTY : REAL
PHASE_SFT : INTEGER
ENDSTRUCTURE
VAR SCH : ARRAY[7] OF AW_SCH_T
VAR LSCH : ARRAY[3] OF AW_SCH_T
VAR RSCH : ARRAY[3] OF AW_SCH_T
VAR PLSCH : ARRAY[3] OF AW_PLS_SCH_T
VAR AWWV_MODE : ARRAY[3] OF INTEGER
VAR entry, STATUS : INTEGER
VAR arg1, arg2, arg3 : INTEGER
VAR arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17 : REAL
VAR temp, fname : STRING [25]
VAR temp_a1, temp_a2, temp_a3, temp_a4, temp_a5, temp_a6, temp_a7, temp_a8, temp_a9, temp_a10, temp_a11, temp_a12, temp_a13, temp_a14, temp_a15, temp_a16, temp_a17 : STRING[17]
--VAR sch_num : STRING[25]
VAR awwv : STRING[25]
VAR sch_1, sch_2, sch_3, sch_4 : STRING[25]
VAR lsch_1, lsch_2, lsch_3, lsch_4 : STRING[25]
VAR rsch_1, rsch_2, rsch_3, rsch_4 : STRING[25]
VAR plsch_1, plsch_2 : STRING[25]
VAR data_type : INTEGER
VAR real_value : REAL
VAR string_value : STRING[17]
VAR arg_int : INTEGER
VAR arg_real : REAL
BEGIN
GET_TPE_PRM(1, data_type, arg_int, real_value, string_value, status)
arg1 = arg_int
GET_TPE_PRM(2, data_type, arg_int, real_value, string_value, status)
arg2 = arg_int
GET_TPE_PRM(3, data_type, arg_int, real_value, string_value, status)
arg3 = arg_int
GET_TPE_PRM(4, data_type, arg_int, real_value, string_value, status)
arg4 = arg_int
GET_TPE_PRM(5, data_type, arg_int, real_value, string_value, status)
arg5 = arg_int
GET_TPE_PRM(6, data_type, arg_int, real_value, string_value, status)
arg6 = arg_int
GET_TPE_PRM(7, data_type, arg_int, real_value, string_value, status)
arg7 = arg_int
GET_TPE_PRM(8, data_type, arg_int, real_value, string_value, status)
arg8 = arg_int
GET_TPE_PRM(9, data_type, arg_int, real_value, string_value, status)
arg9 = arg_int
GET_TPE_PRM(10, data_type, arg_int, real_value, string_value, status)
arg10 = arg_int
GET_TPE_PRM(11, data_type, arg_int, real_value, string_value, status)
arg11 = arg_int
GET_TPE_PRM(12, data_type, arg_int, real_value, string_value, status)
arg12 = arg_int
GET_TPE_PRM(13, data_type, arg_int, real_value, string_value, status)
arg13 = arg_int
GET_TPE_PRM(14, data_type, arg_int, real_value, string_value, status)
arg14 = arg_int
GET_TPE_PRM(15, data_type, arg_int, real_value, string_value, status)
arg15 = arg_int
GET_TPE_PRM(16, data_type, arg_int, real_value, string_value, status)
arg16 = arg_int
GET_TPE_PRM(17, data_type, arg_int, real_value, string_value, status)
arg17 = arg_int
-- for debuging - write arguments to user window
--
-- WRITE('arg 1', arg1, ' ')
-- WRITE('arg 2', arg2, ' ')
-- WRITE('arg 3', arg3, CR)
-- WRITE('arg 4', arg4, CR)
-- WRITE('arg 5', arg5, ' ')
-- WRITE('arg 6', arg6, CR)
-- WRITE('arg 7', arg7, ' ')
-- WRITE('arg 8', arg8, CR)
-- WRITE('arg 9', arg9, ' ')
-- WRITE('arg 10', arg10, CR)
-- WRITE('arg 11', arg11, CR)
-- WRITE('arg 12', arg12, CR)
-- WRITE('arg 13', arg13, ' ')
-- WRITE('arg 14', arg14, CR)
-- WRITE('arg 15', arg15, CR)
-- WRITE('arg 16', arg16, CR)
-- WRITE('arg 17', arg17, CR)
CNV_INT_STR(arg1,1,0,temp_a1)
-- WRITE('temp', temp_a1, CR)
temp_a1 = SUB_STR(temp_a1,2,1)
-- WRITE('temp', temp_a1, CR)
fname = 'AWE1WP0' + temp_a1
-- WRITE('fname ', fname, CR)
-- temp_a2 = SUB_STR(temp_a2,2,1)
awwv = 'AWWV_MODE[' + temp_a2 + ']'
awwv = 'AWWV_MODE[1]'
-- WRITE('awwv ', awwv, CR)
-- WRITE('awwv ', temp_a2, CR)
CNV_INT_STR(arg3,1,0,temp_a3)
temp_a3 = SUB_STR(temp_a3,2,1)
CNV_INT_STR(arg2,1,0,temp_a2)
temp_a2 = SUB_STR(temp_a2,2,1)
awwv = 'AWWV_MODE[' + temp_a2 + ']'
sch_1 = 'SCH[' + temp_a2 + ']'
sch_1 = sch_1 + '.$CMD_VOLTS'
-- WRITE('sch_1 ', sch_1, CR)
sch_2 = 'SCH[' + temp_a2 + ']'
sch_2 = sch_2 + '.$CMD_WFS'
-- WRITE('sch_2 ', sch_2, CR)
sch_3 = 'SCH[' + temp_a2 + ']'
sch_3 = sch_3 + '.$CMD_AMPS'
-- WRITE('sch_3 ', sch_3, CR)
sch_4 = 'SCH[' + temp_a2 + ']'
sch_4 = sch_4 + '.$CMD_WSPEED'
-- WRITE('sch_4 ', sch_4, CR)
lsch_1 = 'LSCH[' + temp_a2 + ']'
lsch_1 = lsch_1 + '.$CMD_VOLTS'
-- WRITE('lsch_1 ', lsch_1, CR)
lsch_2 = 'LSCH[' + temp_a2 + ']'
lsch_2 = lsch_2 + '.$CMD_WFS'
-- WRITE('lsch_2 ', lsch_2, CR)
lsch_3 = 'LSCH[' + temp_a2 + ']'
lsch_3 = lsch_3 + '.$CMD_AMPS'
-- WRITE('lsch_3 ', lsch_3, CR)
lsch_4 = 'LSCH[' + temp_a2 + ']'
lsch_4 = lsch_4 + '.$CMD_WSPEED'
-- WRITE('lsch_4 ', sch_4, CR)
rsch_1 = 'RSCH[' + temp_a2 + ']'
rsch_1 = rsch_1 + '.$CMD_VOLTS'
-- WRITE('rsch_1 ', rsch_1, CR)
rsch_2 = 'RSCH[' + temp_a2 + ']'
rsch_2 = rsch_2 + '.$CMD_WFS'
-- WRITE('rsch_2 ', rsch_2, CR)
rsch_3 = 'RSCH[' + temp_a2 + ']'
rsch_3 = rsch_3 + '.$CMD_AMPS'
-- WRITE('rsch_3 ', rsch_3, CR)
rsch_4 = 'RSCH[' + temp_a2 + ']'
rsch_4 = rsch_4 + '.$CMD_WSPEED'
-- WRITE('rsch_4 ', rsch_4, CR)
plsch_1 = 'PLSCH[' + temp_a2 + ']'
plsch_1 = plsch_1 + '.$PULSE_FREQ'
-- WRITE('plsch_1 ', plsch_1, CR)
plsch_2 = 'PLSCH[' + temp_a2 + ']'
plsch_2 = plsch_2 + '.$PULSE_DUTY'
-- WRITE('plsch_2 ', plsch_2, CR)
SET_VAR (entry, fname, awwv, arg3, STATUS)
SET_VAR (entry, fname, sch_1, arg4, STATUS)
SET_VAR (entry, fname, sch_2, arg5, STATUS)
SET_VAR (entry, fname, sch_3, arg6, STATUS)
SET_VAR (entry, fname, sch_4, arg7, STATUS)
SET_VAR (entry, fname, lsch_1, arg8, STATUS)
SET_VAR (entry, fname, lsch_2, arg9, STATUS)
SET_VAR (entry, fname, lsch_3, arg10, STATUS)
SET_VAR (entry, fname, lsch_4, arg11, STATUS)
SET_VAR (entry, fname, rsch_1, arg12, STATUS)
SET_VAR (entry, fname, rsch_2, arg13, STATUS)
SET_VAR (entry, fname, rsch_3, arg14, STATUS)
SET_VAR (entry, fname, rsch_4, arg15, STATUS)
SET_VAR (entry, fname, plsch_1, arg16, STATUS)
SET_VAR (entry, fname, plsch_2, arg17, STATUS)
END SET_FA_WPP
Display More
TPP program
Description of parameters