Is a bug?
When trying to pass real number E.g 20.0 in procedure CALL that will be suppressed to 20,
because in procedure is expected real value that VAR will be set to 0.00000E+00
Any idea how to deal with real number *.0 / *.00 etc.?
TPP program
Code
CALL SET_FA_WPP(6,1,1,22.5,181.1,100,20,23,181,101,31,24,182,102,32,2,50) ;
CALL SET_FA_WPP(6,2,2,23,182,100,31,23,181,101,31,24,182,102,32,2,50) ;
CALL SET_FA_WPP(6,3,4,24.3,184.6,100.9,32.3,23.1,181.7,101.3,31.5,24.8,182.8,102.7,32.8,2.9,50.5) ;
KAREL program
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 str_7 : STRING[17]
VAR data_type : INTEGER
VAR real_value : REAL
VAR string_value : STRING[17]
VAR arg_int : INTEGER
VAR arg_real : REAL
BEGIN
-- get integer value
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 real value
GET_TPE_PRM(4, data_type, arg_int, real_value, string_value, status)
arg4 = real_value
GET_TPE_PRM(5, data_type, arg_int, real_value, string_value, status)
arg5 = real_value
GET_TPE_PRM(6, data_type, arg_int, real_value, string_value, status)
arg6 = real_value
GET_TPE_PRM(7, data_type, arg_int, real_value, string_value, status)
arg7 = real_value
GET_TPE_PRM(8, data_type, arg_int, real_value, string_value, status)
arg8 = real_value
GET_TPE_PRM(9, data_type, arg_int, real_value, string_value, status)
arg9 = real_value
GET_TPE_PRM(10, data_type, arg_int, real_value, string_value, status)
arg10 = real_value
GET_TPE_PRM(11, data_type, arg_int, real_value, string_value, status)
arg11 = real_value
GET_TPE_PRM(12, data_type, arg_int, real_value, string_value, status)
arg12 = real_value
GET_TPE_PRM(13, data_type, arg_int, real_value, string_value, status)
arg13 = real_value
GET_TPE_PRM(14, data_type, arg_int, real_value, string_value, status)
arg14 = real_value
GET_TPE_PRM(15, data_type, arg_int, real_value, string_value, status)
arg15 = real_value
GET_TPE_PRM(16, data_type, arg_int, real_value, string_value, status)
arg16 = real_value
GET_TPE_PRM(17, data_type, arg_int, real_value, string_value, status)
arg17 = real_value
-- clear user screen
-- WRITE (CHR(128),CHR(137))
-- 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 = ''
-- -- ***
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)
CNV_REAL_STR(arg7, 2, 1, str_7)
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