array_copy_real | () |
# Purpose : This file provides an example of a call to the
# function array_copy_real()
#
# This function copies one real array to second array.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function array_copy_real()
# has the following arguments:
#
# array_copy_real (array1, array2, num )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER num
REAL array1(virtual)
REAL array2(virtual)
#---------------------------------------------------------------------
# Argument Initialization.
num = 5
sys_allocate_array(array1, 1, num)
sys_allocate_array(array2, 1, num)
array1 = [10.0, 1.0, 2.0, 3.0, 7.0]
#---------------------------------------------------------------------
# Copy array1 into array2.
array_copy_real(array1, array2, num)
#---------------------------------------------------------------------
# Dump the output of the function
dump array2
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
array_del_zero_int | () |
# Purpose : This file provides an example of a call to the
# function array_del_zero_int()
#
# This function deletes all zero value from an array.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function array_del_zero_int()
# has the following arguments:
#
# array_del_zero_int (array, numval )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER numval
INTEGER array(virtual)
#---------------------------------------------------------------------
# Argument Initialization.
numval = 10
sys_allocate_array(array,1,numval)
array = [10, 0, 0, 2, 3, 5, 0, 8, 2, 0]
#---------------------------------------------------------------------
# Set each of num elements of array into zero real values.
array_del_zero_int(array, numval)
#---------------------------------------------------------------------
# Dump the output of the function
sys_reallocate_array(array,1,numval)
dump numval
dump array
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
array_fill_int | () |
# Purpose : This file provides an example of a call to the
# function array_fill_int()
#
# This function sets each of num elements of integer
# array into a given input value.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function array_fill_int()
# has the following arguments:
#
# array_fill_int ( array, n, dim )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER array(virtual)
INTEGER n
INTEGER dim
#---------------------------------------------------------------------
# Argument Initialization.
dim = 8
sys_allocate_array(array, 1, dim)
array = [10, 1, 1, 2, 4, 6, 7, 2]
n = 5
#---------------------------------------------------------------------
# Set each of num elements of integer array into a given input value.
array_fill_int (array, n, dim)
#---------------------------------------------------------------------
# Dump the output of the function
dump array
dump n
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
array_fill_zero_int | () |
# Purpose : This file provides an example of a call to the
# function array_fill_zero_int()
#
# This function sets every component of the
# integer array to zero.This file sets an
# integer array to a constant value 101 and
# later it uses the above function to set
# the components of integer array to ZERO.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function array_fill_zero_int() has the following arguments:
#
# array_fill_zero_int
# ( array,
# in )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER ia_array(8)
INTEGER i_in
INTEGER i_r
#---------------------------------------------------------------------
# Set the integer array to some constant value(say 101)
FOR(i_r = 1 TO 8)
ia_array(i_r) = 101
END FOR
# The integer array is (Before setting)
dump ia_array
# i_in = 8
i_in = 8
array_fill_zero_int @
( ia_array, @
i_in )
# The integer array is (After setting)
dump ia_array
#---------------------------------------------------------------------
array_fill_zero_real | () |
# Purpose : This file provides an example of a call to the
# function array_fill_zero_real()
#
# This function sets each of num elements of
# array into zero real values.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function array_fill_zero_real()
# has the following arguments:
#
# array_fill_zero_real ( array, dim )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL array(virtual)
INTEGER dim
#---------------------------------------------------------------------
# Argument Initialization.
dim = 4
sys_allocate_array(array, 1, dim)
array = [10.0, 1.0, 3.0, 2.0]
#---------------------------------------------------------------------
# Set each of num elements of array into zero real values.
array_fill_zero_real (array, dim)
#---------------------------------------------------------------------
# Dump the output of the function
dump array
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
array_real_fill_null | () |
# Purpose : This file provides an example of a call to the
# function array_real_fill_null()
#
# This function sets every component of the
# real array to NULL value.This file sets a
# real array to a constant value 202.54 and
# later it uses the above function to set
# the components of integer array to NULL value.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function array_real_fill_null() has the following arguments:
#
# array_real_fill_null
# ( array,
# in )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL ra_array(8)
INTEGER i_in
INTEGER i_r
#---------------------------------------------------------------------
# Set the real array to some constant value(say 202.54)
FOR(i_r = 1 TO 8)
ra_array(i_r) = 202.54
END FOR
# The real array is (Before setting)
dump ra_array
# i_in = 8
i_in = 8
array_real_fill_null @
( ra_array, @
i_in )
# The real array is (After setting)
dump ra_array
#---------------------------------------------------------------------
array_sort_and_del_dupl_int | () |
# Purpose : This file provides an example of a call to the
# function array_sort_and_del_dupl_int()
#
# This function sqeezes all duplicate values from
# the first N locations of unsorted integer array.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# This function does not exist in MSC Patran9.0.
# It works in MSC Patran8.5 version.
#
# The function array_sort_and_del_dupl_int()
# has the following arguments:
#
# array_sort_and_del_dupl_int (array, n, ndim)
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER array(virtual)
INTEGER ndim
INTEGER n
#---------------------------------------------------------------------
# Argument Initialization.
ndim = 8
sys_allocate_array(array, 1, ndim)
array = [10, 1, 1, 2, 4, 6, 7, 2]
n = 6
#---------------------------------------------------------------------
# Sqeeze all duplicate values from the Ist n locs. of unsorted int array.
array_sort_and_del_dupl_int (array, n, ndim)
#---------------------------------------------------------------------
# Dump the output of the function
sys_reallocate_array(array, 1, n)
dump array
dump n
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
ga_entities_string_format | () |
# Purpose : This file provides an example of a call to the
# function ga_entities_string_format()
#
# This function converts an integer list of a
# given entity type into character string.This
# file defines 8 labels from 110 to 180 with
# a difference of 10.Later it gets the character
# string for entity surface with label ranging
# from 115 to 155.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ga_entities_string_format()
# has the following arguments:
#
# ga_entities_string_format
# ( entitytype,
# dblist,
# range,
# number,
# entitylist )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_entitytype
INTEGER ia_dblist(8) = [ 110,120,130,140,150,160,170,180 ]
INTEGER ia_range(3)
INTEGER i_number
STRING s_entitylist[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# i_entitytype = 3 (Surface)
i_entitytype = 3
i_number = 8
# Lowest range for label.
ia_range(1) = 115
# Highest range for label.
ia_range(2) = 155
# Maximum string length
ia_range(3) = 128
i_return_value = @
ga_entities_string_format @
( i_entitytype, @
ia_dblist, @
ia_range, @
i_number, @
s_entitylist )
dump i_return_value
# The Formatted integer to character converted label list is
dump s_entitylist
#---------------------------------------------------------------------
ga_entity_get_by_type | () |
# Purpose : This file provides an example of two calls
# to the function ga_entity_get_by_type()
#
# This function returns the labels of all the
# existing entities of a given type.This file
# opens a new database “new.db” and creates
# a surface and two curves.It then gets the
# entity labels with the orphan entity flag
# equal to TRUE and FALSE, for the entity
# type curve.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ga_entity_get_by_type() has the following arguments:
#
# ga_entity_get_by_type
# ( entity_type,
# orphan_flag,
# label_count,
# entity_labels )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_entity_type
LOGICAL l_orphan_flag
INTEGER i_label_count
INTEGER ia_entity_labels(8)
STRING sv_asm_create_patch_xy_created[VIRTUAL]
STRING sv_asm_create_line_xyz_created[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# Create a surface and two curves.
# The surface contains 4 curves which are orphans.The other two
# curves have labels 1 and 2.In all there are 6 curves.
asm_const_patch_xyz( “1”, “<1 1 0>”, “[0 0 0]”, @
“Coord 0”, sv_asm_create_patch_xy_created )
asm_const_line_xyz( “1”, “<1 1 0>”, “[0 0 0]”, @
“Coord 0”, sv_asm_create_line_xyz_created )
asm_const_line_xyz( “2”, “<1 -1 0>”, “[0 1 0]”, @
“Coord 0”, sv_asm_create_line_xyz_created )
# i_entity_type = 2 (Curve)
i_entity_type = 2
i_label_count = 6
l_orphan_flag = TRUE
i_return_value = @
ga_entity_get_by_type @
( i_entity_type, @
l_orphan_flag, @
i_label_count, @
ia_entity_labels )
dump i_return_value
# The actual number of labels returned are(orphan entity flag=TRUE)
dump i_label_count
# The entity labels are(orphan entity flag=TRUE)
dump ia_entity_labels
l_orphan_flag = FALSE
i_return_value = @
ga_entity_get_by_type @
( i_entity_type, @
l_orphan_flag, @
i_label_count, @
ia_entity_labels )
dump i_return_value
# The actual number of labels returned are(orphan entity flag=FALSE)
dump i_label_count
# The entity labels are(orphan entity flag=FALSE)
dump ia_entity_labels
SYS_FREE_STRING(sv_asm_create_patch_xy_created)
SYS_FREE_STRING(sv_asm_create_line_xyz_created)
#---------------------------------------------------------------------
math_get_no_data_null | () |
# Purpose : This file provides an example of a call to the
# function math_get_no_data_null()
#
# This function returns a no valid value real
# number.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function math_get_no_data_null() has the following arguments:
#
# math_get_no_data_null
# ( rval )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL r_rval
#---------------------------------------------------------------------
math_get_no_data_null @
( r_rval )
# The no valid value real number is
dump r_rval
#---------------------------------------------------------------------
math_is_no_data_null | () |
# Purpose : This file provides an example of a call to the
# function math_is_no_data_null()
#
# This function returns a logical value TRUE if
# the given real value has a NULL value else it
# returns a FALSE value for a real number.This
# file uses the function math_get_no_data_null()
# to get a no valid value real number.Later this
# value is supplied to the above function to get
# the logical return value.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function math_is_no_data_null() has the following arguments:
#
# math_is_no_data_null
# ( rval )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL r_rval
LOGICAL l_return_value
#---------------------------------------------------------------------
# Get a no valid value real number
math_get_no_data_null( r_rval )
# The no valid value real number is
dump r_rval
l_return_value = @
math_is_no_data_null @
( r_rval )
# The return value for checking for a real value is
# (The value is TRUE if the real value is NULL).
dump l_return_value
#---------------------------------------------------------------------
math_mat_add | () |
# Purpose : This file provides an example of a call to the
# function math_mat_add()
#
# This function adds the two matrix into third matrix.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function math_mat_add()
# has the following arguments:
#
# math_mat_add ( @
# matrix3, @
# matrix1, @
# matrix2, @
# dim1, @
# dim2)
#
#---------------------------------------------------------------------
# Variable Declarations
real matrix1(2, 2), matrix2(2, 2), matrix3(2, 2)
integer dim1, dim2
#---------------------------------------------------------------------
# Argument Initialization.
dim1 = 2
dim2 = 2
matrix1 = [[1.0, 2.0] [2.0, 3.0]]
matrix2 = [[2.0, 3.0] [3.0, 4.0]]
#---------------------------------------------------------------------
# Add two matrix a and b into third matrix named c
math_mat_add(matrix3, matrix1, matrix2, dim1, dim2)
#---------------------------------------------------------------------
# Dump the output of the function
dump matrix3
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
math_mat_invert | () |
# Purpose : This file provides an example of a call to the
# function math_mat_invert()
#
# This function invert the given matrix.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function math_mat_invert()
# has the following arguments:
#
# math_mat_invert ( @
# matrix, @
# dim, @
# tolerance, @
# i_return_value )
#
#---------------------------------------------------------------------
# Variable Declarations
real matrix(3, 3)
integer dim
real tol
integer i_return_value
#---------------------------------------------------------------------
# Argument Initialization.
dim = 3
tol = 0.001
matrix = [[1.0, 5.0, 3.0] [2.0, 7.0, 4.0] [1.0, 5.0, 6.0]]
#---------------------------------------------------------------------
# Invert the given matrix.
math_mat_invert(matrix, dim, tol, i_return_value)
#---------------------------------------------------------------------
# Dump the output of the function
dump matrix
dump i_return_value
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
math_mat_mult | () |
# Purpose : This file provides an example of a call to the
# function math_mat_mult()
#
# This function multiply the two matrix.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function math_mat_mult()
# has the following arguments:
#
# math_mat_mult ( @
# matrix1, @
# matrix2, @
# matrix3, @
# dim1, @
# dim2, @
# dim3)
#
#--------------------------------------------------------------------
INTEGER dim_aa
INTEGER dim_ab
INTEGER dim_ac
INTEGER dim_ba
INTEGER dim_bb
INTEGER dim_bc
INTEGER dim_ca
INTEGER dim_cb
INTEGER dim_cc
INTEGER dim_da
INTEGER dim_db
INTEGER dim_dc
REAL matrix_aa (2,3)
REAL matrix_ab (3,2)
REAL matrix_ac (2,2)
REAL matrix_ba (2,3)
REAL matrix_bb (3,5)
REAL matrix_bc (2,5)
REAL matrix_ca (5,3)
REAL matrix_cb (3,2)
REAL matrix_cc (5,2)
REAL matrix_da (4,4)
REAL matrix_db (4,4)
REAL matrix_dc (4,4)
uil_file_close.go ( )
uil_file_new.go( "", "math_mat_mult_example.db" )
$? YES 36000002
ga_viewport_location_set ( "default_viewport", 0.0, 0.0, 1 )
ga_viewport_size_set ( "default_viewport", 4.5, 4.5, 1 )
# #########################################
# Test case ONE
# were i=j
# Correct answer is:
# 58 64
#
# 139 154
#
dim_aa = 2
dim_ab = 3
dim_ac = 2
matrix_aa = [[1.0,2.0,3.0] @
[4.0,5.0,6.0] ]
matrix_ab = [[ 7.0, 8.0] @
[ 9.0,10.0] @
[11.0,12.0] ]
math_mat_mult ( matrix_aa, matrix_ab, matrix_ac, dim_aa, dim_ab, dim_ac )
frms_dump_real_array ( matrix_ac, "matrix_ac" )
frms_dump_real_array ( matrix_aa, "matrix_aa" )
frms_dump_real_array ( matrix_ab, "matrix_ab" )
dump dim_aa
dump dim_ab
dump dim_ac
# #########################################
# Test case TWO
$# were i!=j
# Correct answer is:
# 82 88 94 100 106
# 190 205 220 235 250
$#
$# (1*7+2*12+3*17) (1*8+2*13+3*18) (1*9+2*14+3*19) (1*10+2*15+3*20) (1*11+2*16+3*21)
$# (4*7+5*12+6*17) (4*8+5*13+6*18) (4*9+5*14+6*19) (4*10+5*15+6*20) (4*11+5*16+6*21)
dim_ba = 2
dim_bb = 3
dim_bc = 5
matrix_ba = [[1.0,2.0,3.0] @
[4.0,5.0,6.0] ]
matrix_bb = [[ 7.0, 8.0, 9.0,10.0,11.0] @
[12.0,13.0,14.0,15.0,16.0] @
[17.0,18.0,19.0,20.0,21.0] ]
math_mat_mult ( matrix_ba, matrix_bb, matrix_bc, dim_ba, dim_bb, dim_bc )
frms_dump_real_array ( matrix_bc, "matrix_bc" )
frms_dump_real_array ( matrix_ba, "matrix_ba" )
frms_dump_real_array ( matrix_bb, "matrix_bb" )
dump dim_ba
dump dim_bb
dump dim_bc
# #########################################
# Test case THREE
$# were i!=j
# Correct answer is:
# 112 118
# 274 289
# 436 460
# 598 631
# 760 802
$#
$# (1*16+2*18+3*20) (1*17+2*19+3*21)
$# (4*16+5*18+6*20) (4*17+5*19+6*21)
$# (7*16+8*18+9*20) (7*17+8*19+9*21)
$# (10*16+11*18+12*20) (10*17+11*19+12*21)
$# (13*16+14*18+15*20) (13*17+14*19+15*21)
dim_ca = 5
dim_cb = 3
dim_cc = 2
matrix_ca = [[ 1.0, 2.0, 3.0] @
[ 4.0, 5.0, 6.0] @
[ 7.0, 8.0, 9.0] @
[10.0,11.0,12.0] @
[13.0,14.0,15.0] ]
matrix_cb = [[16.0,17.0] @
[18.0,19.0] @
[20.0,21.0] ]
math_mat_mult ( matrix_ca, matrix_cb, matrix_cc, dim_ca, dim_cb, dim_cc )
frms_dump_real_array ( matrix_cc, "matrix_cc" )
frms_dump_real_array ( matrix_ca, "matrix_ca" )
frms_dump_real_array ( matrix_cb, "matrix_cb" )
dump dim_ca
dump dim_cb
dump dim_cc
# #########################################
# Test case FOUR
# Correct answer is:
# 250 260 270 280
# 618 644 670 696
# 986 1028 1070 1112
# 1354 1412 1470 1528
dim_da = 4
dim_db = 4
dim_dc = 4
matrix_da = [[ 1.0, 2.0, 3.0, 4.0] @
[ 5.0, 6.0, 7.0, 8.0] @
[ 9.0,10.0,11.0,12.0] @
[13.0,14.0,15.0,16.0] ]
matrix_db = [[17.0,18.0,19.0,20.0] @
[21.0,22.0,23.0,24.0] @
[25.0,26.0,27.0,28.0] @
[29.0,30.0,31.0,32.0] ]
math_mat_mult ( matrix_da, matrix_db, matrix_dc, dim_da, dim_db, dim_dc )
frms_dump_real_array ( matrix_dc, "matrix_dc" )
frms_dump_real_array ( matrix_da, "matrix_da" )
frms_dump_real_array ( matrix_db, "matrix_db" )
dump dim_da
dump dim_db
dump dim_dc
***
End of file
math_mat_transp_in_place | () |
# Purpose : This file provides an example of a call to the
# function math_mat_transp_in_place()
#
# This function transposes the matrix in place.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function math_mat_transp_in_place()
# has the following arguments:
#
# math_mat_transp_in_place ( matrix, dim)
#
#---------------------------------------------------------------------
# Variable Declarations
real matrix(3, 3)
integer dim
#---------------------------------------------------------------------
# Argument Initialization.
dim = 3
matrix = [[1.0, 2.0, 3.0] [2.0, 3.0, 5.0] [7.0, 8.0, 9.0]]
#---------------------------------------------------------------------
# Transpose the matrix in place.
math_mat_transp_in_place(matrix, dim)
#---------------------------------------------------------------------
# Dump the output of the function
dump matrix
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
math_vec_len | () |
# Purpose : This file provides an example of a call to the
# function math_vec_len()
#
# This function computes the length of the vector.
#
# This file can be run by starting a session of
# MSC Patran, running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function math_vec_len()
# has the following arguments:
#
# math_vec_len ( vector )
#
#---------------------------------------------------------------------
# Variable Declarations
real vector(3)
real length
#---------------------------------------------------------------------
# Argument Initialization.
vector = [2.0, 3.0, 4.0]
#---------------------------------------------------------------------
# Compute the length of the vector
length = math_vec_len ( vector )
#---------------------------------------------------------------------
# Dump the output of the function
dump length
#---------------------------------------------------------------------
# closing the patran environment.
# uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
math_vec_norm | () |
# Purpose : This file provides an example of a call to the
# function math_vec_norm()
#
# This function normalizes a 3-D vector.
#
# This file can be run by starting a session of
# MSC Patran, running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function math_vec_norm()
# has the following arguments:
#
# math_vec_norm ( syseps, vector )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL vector(3)
REAL syseps
#---------------------------------------------------------------------
# Argument Initialization.
vector = [2.0, 3.0, 4.0]
syseps = 0.01
#---------------------------------------------------------------------
# This function normalizes a 3-D vector
math_vec_norm ( syseps, vector)
#---------------------------------------------------------------------
# Dump the output of the function
dump vector
#---------------------------------------------------------------------
# closing the patran environment.
# uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
mth_vec_add | () |
# Purpose : This file provides an example of a call to the
# function mth_vec_add()
#
# This function computes the sum of two
# n-dimensional vectors.
#
# This file can be run by starting a session of
# MSC Patran, running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function mth_vec_add()
# has the following arguments:
#
# mth_vec_add ( dim, @
# vec1, @
# vec2, @
# vec3 )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL vec1(3)
REAL vec2(3)
REAL vec3(3)
INTEGER dim
#---------------------------------------------------------------------
# Argument Initialization.
dim = 3
vec1 = [2.0, 3.0, 4.0]
vec2 = [3.0, 4.0, 6.0]
#---------------------------------------------------------------------
# Computes the sum of two n-dimensional vectors.
mth_vec_add ( dim, vec1, vec2, vec3)
#---------------------------------------------------------------------
# Dump the output of the function
dump vec3
#---------------------------------------------------------------------
# closing the patran environment.
# uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
mth_vec_cross_prod | () |
# Purpose : This file provides an example of a call to the
# function mth_vec_cross_prod()
#
# This function computes the cross product of two
# 3-dimensional vectors array.
#
# This file can be run by starting a session of
# MSC Patran, running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function mth_vec_cross_prod()
# has the following arguments:
#
# mth_vec_cross_prod (vec1, vec2, vec3, dim)
#
#---------------------------------------------------------------------
# Variable Declarations
REAL vec1(2, 3)
REAL vec2(2, 3)
REAL vec3(2, 3)
INTEGER dim
#---------------------------------------------------------------------
# Argument Initialization.
dim = 2
vec1 = [[1.0, 2.0, 1.0][2.0, 3.0, 4.0]]
vec2 = [[4.0, 2.0, 3.0][3.0, 1.0, 2.0]]
#---------------------------------------------------------------------
# Computes the cross product of two 3-dimensional vectors array.
mth_vec_cross_prod ( vec1, vec2, vec3, dim)
#---------------------------------------------------------------------
# Dump the output of the function
dump vec3
#---------------------------------------------------------------------
# closing the patran environment.
# uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
mth_vec_dot_prod | () |
# Purpose : This file provides an example of a call to the
# function mth_vec_dot_prod()
#
# This function computes the dot product of two
# 3-dimensional vectors.
#
# This file can be run by starting a session of
# MSC Patran, running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function mth_vec_dot_prod()
# has the following arguments:
#
# mth_vec_dot_prod ( vec1, vec2)
#
#---------------------------------------------------------------------
# Variable Declarations
REAL vec1(3)
REAL vec2(3)
REAL product
#---------------------------------------------------------------------
# Argument Initialization.
vec1 = [2.0, 3.0, 4.0]
vec2 = [3.0, 4.0, 6.0]
#---------------------------------------------------------------------
# Computes the dot product of two 3-dimensional vectors.
product = mth_vec_dot_prod ( vec1, vec2)
#---------------------------------------------------------------------
# Dump the output of the function
dump product
#---------------------------------------------------------------------
# closing the patran environment.
# uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
mth_vec_length | () |
# Purpose : This file provides an example of a call to the
# function mth_vec_length()
#
# This function computes the length of the vector.
#
# This file can be run by starting a session of
# MSC Patran, running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function mth_vec_length()
# has the following arguments:
#
# mth_vec_length ( vector )
#
#---------------------------------------------------------------------
# Variable Declarations
real vector(3)
real length
#---------------------------------------------------------------------
# Argument Initialization.
vector = [2.0, 3.0, 4.0]
#---------------------------------------------------------------------
# Compute the length of the vector
length = mth_vec_length(vector)
#---------------------------------------------------------------------
# Dump the output of the function
dump length
#---------------------------------------------------------------------
# closing the patran environment.
# uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
mth_vec_scale |
# Purpose : This file provides an example of a call to the
# function mth_vec_scale()
#
# This function scales a vector by a scale factor.
#
# This file can be run by starting a session of
# MSC Patran, running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function mth_vec_scale()
# has the following arguments:
#
# mth_vec_scale ( scale_factor, dim, vector)
#
#---------------------------------------------------------------------
# Variable Declarations
REAL scale_factor
REAL vector(3)
REAL dim
#---------------------------------------------------------------------
# Argument Initialization.
scale_factor = 2.5
dim = 3
vector = [2.0, 3.0, 4.0]
#---------------------------------------------------------------------
# Scale a vector by a scale factor.
mth_vec_scale ( scale_factor, dim, vector )
#---------------------------------------------------------------------
# Dump the output of the function
dump vector
#---------------------------------------------------------------------
# closing the patran environment.
# uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
rpc_add_server | () |
# Purpose : This file provides an example of a call to the
# function rpc_add_server()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then an integer is sent to the
# server and same integer is got back from the
# server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_add_server() has the following arguments:
#
# rpc_add_server
# ( server,
# prog_num,
# prog_ver,
# host )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
INTEGER i_value
INTEGER i_get_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an integer value of 100 to the output stream (i.e. to the
# server)
#
i_value = 100
i_return_value = @
rpc_put_integer @
( i_handle, @
i_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the integer from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_integer @
( i_handle, @
i_get_value )
dump i_return_value
dump i_get_value
#---------------------------------------------------------------------
rpc_call | () |
# Purpose : This file provides an example of a call to the
# function rpc_call()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then an integer is sent to the
# server and same integer is got back from the
# server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_call() has the following arguments:
#
# rpc_call
# ( handle )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
INTEGER i_value
INTEGER i_get_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an integer value of 100 to the output stream (i.e. to the
# server)
#
i_value = 100
i_return_value = @
rpc_put_integer @
( i_handle, @
i_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Get the integer from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_integer @
( i_handle, @
i_get_value )
dump i_return_value
dump i_get_value
#---------------------------------------------------------------------
rpc_clear_output | () |
# Purpose : This file provides an example of a call to the
# function rpc_clear_output()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a string is sent to the
# server. Same string is got back from the
# server. Again another string is sent followed
# by a rpc_clear_output() call. Function rpc_call
# is called to see that it doesnot function since
# the output stream is cleared.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_clear_output() has the following arguments:
#
# rpc_clear_output
# ( handle )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
INTEGER i_count
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
STRING s_value[128]
STRING s_get_value[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a string “MSC Patran Welcomes” to the output stream ( i.e. to
# the server)
#
s_value = “MSC Patran Welcomes”
i_return_value = @
rpc_put_string @
( i_handle, @
s_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Get the string from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_string @
( i_handle, @
s_get_value )
dump i_return_value
dump s_get_value
#---------------------------------------------------------------------
s_value = “MSC Patran again welcomes you”
i_return_value = @
rpc_put_string @
( i_handle, @
s_value )
dump i_return_value
# Reset the output data stream.
#
rpc_clear_output @
( i_handle )
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Note that rpc_call() returns an error message “RPC call failure”
# (Error code 47000008). The function rpc_clear_output() clears
# the output stream. Since there is nothing in the output stream,
# rpc_call() fails to make an RPC. Hence the error code.
#---------------------------------------------------------------------
rpc_get_bool_array | () |
# Purpose : This file provides an example of a call to the
# function rpc_get_bool_array()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a boolean array is sent
# to the server and same boolean array is got
# back from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_get_bool_array() has the following arguments:
#
# rpc_get_bool_array
# ( handle,
# value,
# count )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
LOGICAL la_put_value(4)
INTEGER i_count
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
LOGICAL la_value(4)
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a boolean array to the output stream (i.e. to the server)
#
la_put_value = [TRUE, FALSE, TRUE, FALSE]
i_count = 4
i_return_value = @
rpc_put_bool_array @
( i_handle, @
la_put_value, @
i_count )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the boolean array from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_bool_array @
( i_handle, @
la_value, @
i_count )
dump i_return_value
dump la_value
#---------------------------------------------------------------------
rpc_get_boolean | () |
# Purpose : This file provides an example of a call to the
# function rpc_get_boolean()
#
# In this illustration, a server program
# “rpc_test” is started.The server is registered
# and initialised.Then a boolean value is sent
# to the server and same boolean value is got
# back from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_get_boolean() has the following arguments:
#
# rpc_get_boolean
# ( handle,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
LOGICAL l_put_value
LOGICAL l_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an boolean value of TRUE to the output stream (i.e. to the
# server)
#
l_put_value = TRUE
i_return_value = @
rpc_put_boolean @
( i_handle, @
l_put_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the Boolean from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_boolean @
( i_handle, @
l_value )
dump i_return_value
dump l_value
#---------------------------------------------------------------------
rpc_get_command | () |
# Purpose : This file provides an example of a call to the
# function rpc_get_command()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a command value is sent
# to the server and same command value is got
# back from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_get_command() has the following arguments:
#
# rpc_get_command
# ( handle,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
INTEGER i_put_value
INTEGER i_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a command value of 4 to the output stream (i.e. to the
# server)
#
i_put_value = 4
i_return_value = @
rpc_put_command @
( i_handle, @
i_put_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the command value from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_command @
( i_handle, @
i_value )
dump i_return_value
dump i_value
#---------------------------------------------------------------------
rpc_get_int_array | () |
# Purpose : This file provides an example of a call to the
# function rpc_get_int_array()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then an integer array is sent
# to the server and same integer array is got
# back from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_get_int_array() has the following arguments:
#
# rpc_get_int_array
# ( handle,
# value,
# count )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
INTEGER ia_put_value(4)
INTEGER i_count
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER ia_value(4)
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an integer array to the output stream (i.e. to the server)
#
ia_put_value = [1,2,3,4]
i_count = 4
i_return_value = @
rpc_put_int_array @
( i_handle, @
ia_put_value, @
i_count )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the integer array from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_int_array @
( i_handle, @
ia_value, @
i_count )
dump i_return_value
dump ia_value
#---------------------------------------------------------------------
rpc_get_integer | () |
# Purpose : This file provides an example of a call to the
# function rpc_get_integer()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then an integer is sent to the
# server and same integer is got back from the
# server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_get_integer() has the following arguments:
#
# rpc_get_integer
# ( handle,
# value )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
INTEGER i_put_value
INTEGER i_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an integer value of 100 to the output stream (i.e. to the
# server)
#
i_put_value = 100
i_return_value = @
rpc_put_integer @
( i_handle, @
i_put_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the integer from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_integer @
( i_handle, @
i_value )
dump i_return_value
# The value received from the server is
dump i_value
#---------------------------------------------------------------------
rpc_get_real | () |
# Purpose : This file provides an example of a call to the
# function rpc_get_real()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a real is sent to the
# server and same real is got back from the
# server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_get_real() has the following arguments:
#
# rpc_get_real
# ( handle,
# value )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
REAL r_put_value
REAL r_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an integer value of 100 to the output stream (i.e. to the
# server)
#
r_put_value = 10.0
i_return_value = @
rpc_put_real @
( i_handle, @
r_put_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the Remote Procedure Call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the integer from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_real @
( i_handle, @
r_value )
dump i_return_value
dump r_value
#---------------------------------------------------------------------
rpc_get_real_array | () |
# Purpose : This file provides an example of a call to the
# function rpc_get_real_array()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a real array is sent
# to the server and same real array is got back
# from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_get_real_array() has the following arguments:
#
# rpc_get_real_array
# ( handle,
# value,
# count )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
REAL ra_put_value(4)
INTEGER i_count
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
REAL ra_value(4)
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a real array to the output stream (i.e. to the server)
#
ra_put_value = [100.0, 200.0, 300.0, 400.0]
i_count = 4
i_return_value = @
rpc_put_real_array @
( i_handle, @
ra_put_value, @
i_count )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the real array from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_real_array @
( i_handle, @
ra_value, @
i_count )
dump i_return_value
dump ra_value
#---------------------------------------------------------------------
rpc_get_status | () |
# Purpose : This file provides an example of a call to the
# function rpc_get_status()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a status value is sent to
# the server and same status value is got back
# from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_status() has the following arguments:
#
# rpc_get_status
# ( handle,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
INTEGER i_value
INTEGER i_put_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a status value of 1 to the output stream (i.e. to the server)
#
i_put_value = 1
i_return_value = @
rpc_put_status @
( i_handle, @
i_put_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the status value from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_status @
( i_handle, @
i_value )
dump i_return_value
dump i_value
#---------------------------------------------------------------------
rpc_get_string | () |
# Purpose : This file provides an example of a call to the
# function rpc_get_string()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a string is sent to the
# server and same string is got back from the
# server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_get_string() has the following arguments:
#
# rpc_get_string
# ( handle,
# value )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
STRING s_put_value[128]
STRING s_value[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a string “MSC Patran” to the output stream ( i.e. to the
# server)
#
s_put_value = “MSC Patran”
i_return_value = @
rpc_put_string @
( i_handle, @
s_put_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the string from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_string @
( i_handle, @
s_value )
dump i_return_value
dump s_value
#---------------------------------------------------------------------
rpc_init_client | () |
# Purpose : This file provides an example of a call to the
# function rpc_init_client()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then an integer is sent to the
# server and same integer is got back from the
# server.
#
# Before running this file, run the script file
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_init_client() has the following arguments:
#
# rpc_init_client
# ( server,
# handle )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
INTEGER i_value
INTEGER i_get_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an integer value of 100 to the output stream (i.e. to the
# server)
#
i_value = 100
i_return_value = @
rpc_put_integer @
( i_handle, @
i_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the integer from the input stream (i.e. from the server)
i_return_value = @
rpc_get_integer @
( i_handle, @
i_get_value )
dump i_return_value
dump i_get_value
#---------------------------------------------------------------------
rpc_inquire_count | () |
# Purpose : This file provides an example of a call to the
# function rpc_inquire_count()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a string is sent to the
# server. Number of items in the input stream is
# is counted. Same string is got back from the
# server. Again the number of items in the input
# stream is counted.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_inquire_count() has the following arguments:
#
# rpc_inquire_count
# ( handle,
# count )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
INTEGER i_count
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
STRING s_value[128]
STRING s_get_value[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a string “MSC Patran Welcomes” to the output stream ( i.e. to
# the server)
#
s_value = “MSC Patran Welcomes”
i_return_value = @
rpc_put_string @
( i_handle, @
s_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Determine how many items remain in the input stream.
i_return_value = @
rpc_inquire_count @
( i_handle, @
i_count )
dump i_return_value
# Number of items in the input stream
dump i_count
#---------------------------------------------------------------------
# Get the string from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_string @
( i_handle, @
s_get_value )
dump i_return_value
dump s_get_value
# Determine how many items remain in the input stream.
i_return_value = @
rpc_inquire_count @
( i_handle, @
i_count )
dump i_return_value
# Number of items in the input stream
dump i_count
#---------------------------------------------------------------------
rpc_inquire_item | () |
# Purpose : This file provides an example of a call to the
# function rpc_inquire_item()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a string is sent to the
# server. Number of items in the input stream
# is counted. Same string is got back from the
# server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_inquire_item() has the following arguments:
#
# rpc_inquire_item
# ( handle,
# type,
# count )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
INTEGER i_type
INTEGER i_count
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
STRING s_value[128]
STRING s_get_value[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put strings “MSC Patran Welcomes you” to the output stream
# ( i.e. to the server)
#
s_value = “MSC Patran Welcomes you”
i_return_value = @
rpc_put_string @
( i_handle, @
s_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Determine the type of data and the number of items in that type
# in the current input stream.
i_return_value = @
rpc_inquire_item @
( i_handle, @
i_type, @
i_count )
dump i_return_value
# Number of items in the input stream
dump i_count
# Type of data in the current list item
dump i_type
#---------------------------------------------------------------------
# Get the string from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_string @
( i_handle, @
s_get_value )
dump i_return_value
dump s_get_value
#---------------------------------------------------------------------
rpc_put_bool_array | () |
# Purpose : This file provides an example of a call to the
# function rpc_put_bool_array()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a boolean array is sent
# to the server and same boolean array is got
# back from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_bool_array() has the following arguments:
#
# rpc_put_bool_array
# ( handle,
# value,
# count )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
LOGICAL la_value(4)
INTEGER i_count
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
LOGICAL la_get_value(4)
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a boolean array to the output stream (i.e. to the server)
#
la_value = [TRUE, FALSE, TRUE, FALSE]
i_count = 4
i_return_value = @
rpc_put_bool_array @
( i_handle, @
la_value, @
i_count )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the boolean array from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_bool_array @
( i_handle, @
la_get_value, @
i_count )
dump i_return_value
dump la_get_value
#---------------------------------------------------------------------
rpc_put_boolean | () |
# Purpose : This file provides an example of a call to the
# function rpc_put_boolean()
#
# In this illustration, a server program
# “rpc_test” is started.The server is registered
# and initialised.Then a boolean value is sent
# to the server and same boolean value is got
# back from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_boolean() has the following arguments:
#
# rpc_put_boolean
# ( handle,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
LOGICAL l_value
LOGICAL l_get_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an boolean value of TRUE to the output stream (i.e. to the
# server)
#
l_value = TRUE
i_return_value = @
rpc_put_boolean @
( i_handle, @
l_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the Boolean from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_boolean @
( i_handle, @
l_get_value )
dump i_return_value
dump l_get_value
#---------------------------------------------------------------------
rpc_put_command | () |
# Purpose : This file provides an example of a call to the
# function rpc_put_command()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a command value is sent
# to the server and same command value is got
# back from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_command() has the following arguments:
#
# rpc_put_command
# ( handle,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
INTEGER i_value
INTEGER i_get_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a command value of 4 to the output stream (i.e. to the server)
#
i_value = 4
i_return_value = @
rpc_put_command @
( i_handle, @
i_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the command value from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_command @
( i_handle, @
i_get_value )
dump i_return_value
dump i_get_value
#---------------------------------------------------------------------
rpc_put_int_array | () |
# Purpose : This file provides an example of a call to the
# function rpc_put_int_array()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then an integer array is sent
# to the server and same integer array is got
# back from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_int_array() has the following arguments:
#
# rpc_put_int_array
# ( handle,
# value,
# count )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
INTEGER ia_value(4)
INTEGER i_count
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER ia_get_value(4)
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an integer array to the output stream (i.e. to the server)
#
ia_value = [1,2,3,4]
i_count = 4
i_return_value = @
rpc_put_int_array @
( i_handle, @
ia_value, @
i_count )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the integer array from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_int_array @
( i_handle, @
ia_get_value, @
i_count )
dump i_return_value
dump ia_get_value
#---------------------------------------------------------------------
rpc_put_integer | () |
# Purpose : This file provides an example of a call to the
# function rpc_put_integer()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then an integer is sent to the
# server and same integer is got back from the
# server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_integer() has the following arguments:
#
# rpc_put_integer
# ( handle,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
INTEGER i_value
INTEGER i_get_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an integer value of 100 to the output stream (i.e. to the
# server)
#
i_value = 100
i_return_value = @
rpc_put_integer @
( i_handle, @
i_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the integer from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_integer @
( i_handle, @
i_get_value )
dump i_return_value
dump i_get_value
#---------------------------------------------------------------------
rpc_put_real | () |
# Purpose : This file provides an example of a call to the
# function rpc_put_real()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a real is sent to the
# server and same real is got back from the
# server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_real() has the following arguments:
#
# rpc_put_real
# ( handle,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
REAL r_value
REAL r_get_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put an integer value of 100 to the output stream (i.e. to the
# server)
#
r_value = 11.1
i_return_value = @
rpc_put_real @
( i_handle, @
r_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the Remote Procedure Call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the integer from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_real @
( i_handle, @
r_get_value )
dump i_return_value
dump r_get_value
#---------------------------------------------------------------------
rpc_put_real_array | () |
# Purpose : This file provides an example of a call to the
# function rpc_put_real_array()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a real array is sent
# to the server and same real array is got back
# from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_real_array() has the following arguments:
#
# rpc_put_real_array
# ( handle,
# value,
# count )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
REAL ra_value(4)
INTEGER i_count
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
REAL ra_get_value(4)
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a real array to the output stream (i.e. to the server)
#
ra_value = [100.0, 200.0, 300.0, 400.0]
i_count = 4
i_return_value = @
rpc_put_real_array @
( i_handle, @
ra_value, @
i_count )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the real array from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_real_array @
( i_handle, @
ra_get_value, @
i_count )
dump i_return_value
dump ra_get_value
#---------------------------------------------------------------------
rpc_put_status | () |
# Purpose : This file provides an example of a call to the
# function rpc_put_status()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a status value is sent to
# the server and same status value is got back
# from the server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_status() has the following arguments:
#
# rpc_put_status
# ( handle,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
INTEGER i_value
INTEGER i_get_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a status value of 1 to the output stream (i.e. to the server)
#
i_value = 1
i_return_value = @
rpc_put_status @
( i_handle, @
i_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the status value from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_status @
( i_handle, @
i_get_value )
dump i_return_value
dump i_get_value
#---------------------------------------------------------------------
rpc_put_string | () |
# Purpose : This file provides an example of a call to the
# function rpc_put_string()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then a string is sent to the
# server and same string is got back from the
# server.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_put_string() has the following arguments:
#
# rpc_put_string
# ( handle,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
INTEGER i_handle
STRING s_value[128]
STRING s_get_value[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Put a string “MSC Patran” to the output stream ( i.e. to the
# server)
#
s_value = “MSC Patran”
i_return_value = @
rpc_put_string @
( i_handle, @
s_value )
dump i_return_value
#---------------------------------------------------------------------
# Send the remote procedure call(RPC) to the server and make client
# to wait for the response from the server by calling rpc_call().
#
i_return_value = @
rpc_call @
( i_handle )
dump i_return_value
# Get the string from the input stream (i.e. from the server)
#
i_return_value = @
rpc_get_string @
( i_handle, @
s_get_value )
dump i_return_value
dump s_get_value
#---------------------------------------------------------------------
rpc_timeout | () |
# Purpose : This file provides an example of a call to the
# function rpc_timeout()
#
# In this illustration, a server program
# “rpc_test” is started. The server is registered
# and initialised. Then rpc_timeout() is called.
#
# Before running this file, run the script
# compile.rpc_test.script in the same platform
# where this file is supposed to run. The script
# will compile “rpc_test.c” and prepare an
# executable “rpc_test”. Copy the executable to
# the current working directory.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function rpc_timeout() has the following arguments:
#
# rpc_timeout
# ( handle,
# seconds )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_handle
INTEGER i_seconds
STRING s_server[128]
INTEGER i_prog_num
INTEGER i_prog_ver
STRING s_host[128]
LOGICAL l_return_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Start a program “rpc_test” in the back ground using the function
# utl_process_spawn(). This will act as the server. Set the program
# number to be 12345 and the version 1.
#
s_server = “rpc_test”
i_prog_num = 12345
i_prog_ver = 1
i_return_value = @
utl_process_spawn @
(“rpc_test 12345”, FALSE)
# The process ID of the server is
dump i_return_value
# Get the host name
utl_get_host_name(s_host)
dump s_host
#---------------------------------------------------------------------
# Register the server program and associate it with the program
# number, program version and the server host.
#
i_return_value = @
rpc_add_server @
( s_server, @
i_prog_num, @
i_prog_ver, @
s_host )
dump i_return_value
#---------------------------------------------------------------------
# Initialise client server communication and get the handle for
# further communication with the server.
#
i_return_value = @
rpc_init_client @
( s_server, @
i_handle )
dump i_return_value
#---------------------------------------------------------------------
# Call the function to change the amount of time before all
# subsequent rpc calls will timeout.
#
l_return_value = @
rpc_timeout @
( i_handle, @
i_seconds )
dump l_return_value
#---------------------------------------------------------------------
string_newline_count | () |
# Purpose : This file provides an example of a call to the
# function string_newline_count()
#
# This function counts the lines in a string.
# This file defines a string and formats it
# to contain four new line characters.Later
# it counts the number of lines in the string.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function string_newline_count() has the following arguments:
#
# string_newline_count
# ( chars,
# nl )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_chars[128]
INTEGER i_nl
STRING s_new[128]
INTEGER ia_i(1)
REAL ra_r(1)
STRING s_s[1]
#---------------------------------------------------------------------
# s_new = “Geometric %N% Software %N% Services %N% Limited %N%”
s_new = “Geometric %N% Software %N% Services %N% Limited %N%”
# Format the string s_new to contain four newline characters.
string_write(s_new,ia_i,ra_r,s_s,s_chars)
# Call xf_write_stdout() to dump the formatted string in standard
# output. Note that there are four lines.
xf_write_stdout( s_chars )
string_newline_count @
( s_chars, @
i_nl )
# The number of lines are
dump i_nl
#---------------------------------------------------------------------
string_newline_position | () |
# Purpose : This file provides an example of a call to the
# function string_newline_position()
#
# This function stores the new line locations
# in a string. This file defines a string and
# formats it to contain four new line characters.
# Later it counts the number of lines in the
# string.Finally it gets the position of these
# newline characters.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function string_newline_position()
# has the following arguments:
#
# string_newline_position
# ( chars,
# pos )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_chars[128]
INTEGER iv_pos(VIRTUAL)
INTEGER i_nl
STRING s_new[128]
INTEGER ia_i(1)
REAL ra_r(1)
STRING s_s[1]
#---------------------------------------------------------------------
# s_new = “Geometric %N% Software %N% Services %N% Limited %N%”
s_new = “Geometric %N% Software %N% Services %N% Limited %N%”
# Format the string s_new to contain four newline characters.
string_write(s_new,ia_i,ra_r,s_s,s_chars)
# Call xf_write_stdout() to dump the formatted string in standard
# output. Note that there are four lines.
xf_write_stdout( s_chars )
string_newline_count @
( s_chars, @
i_nl )
# The number of new lines are
dump i_nl
SYS_ALLOCATE_ARRAY(iv_pos,1,i_nl)
string_newline_position @
( s_chars, @
iv_pos )
# The position of the newline characters are
dump iv_pos
SYS_FREE_ARRAY(iv_pos)
#---------------------------------------------------------------------
timer_off | () |
# Purpose : This file provides an example of a call to the
# function timer_off()
#
# This function stops timer and reports the
# time to the xterm since last call to the
# the function timer_on().This file starts the
# timer and pauses for the user interaction.
# Finally it stops the timer and reports time
# to the xterm.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function timer_off() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_return_value
#---------------------------------------------------------------------
# Start the timer.
timer_on()
# Elapse some time.
# Session file paused. Press “Resume” to continue..
sf_pause()
# Stop the timer and report time to xterm.
i_return_value = timer_off()
# Accumulated CPU time elapsed for all calls to
# timer_on() and timer_off() during the session.
dump i_return_value
#---------------------------------------------------------------------
timer_on | () |
# Purpose : This file provides an example of a call to the
# function timer_on()
#
# This function starts the timer.This file
# starts the timer and pauses for the user
# interaction.Finally it stops the timer and
# reports time to the xterm using the function
# timer_off().
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function timer_on() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_return_value
#---------------------------------------------------------------------
# Start the timer.
timer_on()
# Elapse some time.
# Session file paused. Press “Resume” to continue..
sf_pause()
# Stop the timer and report time to xterm.
i_return_value = timer_off()
# Accumulated CPU time elapsed for all calls to
# timer_on() and timer_off() during the session.
dump i_return_value
#---------------------------------------------------------------------
uil_list_union_expr | () |
# Purpose : This file provides an example of a call to the
# function uil_list_union_expr()
#
# This function updates two input strings
# returning unique combined string.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function uil_list_union_expr()
# has the following arguments:
#
# uil_list_union_expr
# ( operator,
# in_string_1,
# in_string_2,
# out_string )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_operator[5]
STRING s_in_string_1[32]
STRING s_in_string_2[32]
STRING s_out_string[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Adding two lists of surfaces.
s_operator = "A"
s_in_string_1 = "Surface 1:4"
s_in_string_2 = "Surface 3:7"
i_return_value = uil_list_union_expr @
( s_operator, @
s_in_string_1, @
s_in_string_2, @
s_out_string )
dump s_out_string
dump i_return_value
#---------------------------------------------------------------------
# Subracting one surface list from the other.
s_operator = "R"
s_in_string_1 = "Surface 1:4"
s_in_string_2 = "Surface 3"
i_return_value = uil_list_union_expr @
( s_operator, @
s_in_string_1, @
s_in_string_2, @
s_out_string )
dump s_out_string
dump i_return_value
#---------------------------------------------------------------------
# Removes repeated numbers from a list.
s_operator = "C"
s_in_string_1 = "Surface 1:4 2"
s_in_string_2 = ""
i_return_value = uil_list_union_expr @
( s_operator, @
s_in_string_1, @
s_in_string_2, @
s_out_string )
dump s_out_string
dump i_return_value
#---------------------------------------------------------------------
util_equal_real | () |
# Purpose : This file provides an example of two calls
# to the function util_equal_real()
#
# This function determines whether two real
# numbers are equal upto a specified significant
# number of digits.This file checks for a set
# of real values with different significant
# digits.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function util_equal_real() has the following arguments:
#
# util_equal_real
# ( a,
# b,
# nsig )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL r_a
REAL r_b
INTEGER i_nsig
LOGICAL l_return_value
#---------------------------------------------------------------------
# r_a = 202.1234
r_a = 202.1234
# r_b = 202.1235
r_b = 202.1235
# Check with significant digits = 6
i_nsig = 6
l_return_value = @
util_equal_real @
( r_a, @
r_b, @
i_nsig )
dump l_return_value
# Check with significant digits = 7
i_nsig = 7
l_return_value = @
util_equal_real @
( r_a, @
r_b, @
i_nsig )
dump l_return_value
# r_a = 202.1236
r_a = 202.1236
# r_b = 202.123
r_b = 202.123
# Check with significant digits = 5
i_nsig = 5
l_return_value = @
util_equal_real @
( r_a, @
r_b, @
i_nsig )
dump l_return_value
# Check with significant digits = 6
i_nsig = 6
l_return_value = @
util_equal_real @
( r_a, @
r_b, @
i_nsig )
dump l_return_value
#---------------------------------------------------------------------
util_real_equal_null | () |
# Purpose : This file provides an example of two calls
# to the function util_real_equal_null()
#
# This function tests if a real value is Null.
# It returns a TRUE value if the input value
# is Null.This file gets the Null value using
# the function array_real_fill_null() and tests
# this value using the above function.Later it
# tests the value 202.54 using the above
# function.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function util_real_equal_null()
# has the following arguments:
#
# util_real_equal_null
# ( val )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL r_val
REAL ra_val(1)
LOGICAL l_return_value
#---------------------------------------------------------------------
# Get the NULL value
array_real_fill_null(ra_val,1)
r_val = ra_val(1)
# The Null value is
dump r_val
# Check the return value for real value = Null
l_return_value = @
util_real_equal_null @
( r_val )
dump l_return_value
# Check the return value for real value = 202.54
r_val = 202.54
l_return_value = @
util_real_equal_null @
( r_val )
dump l_return_value
#---------------------------------------------------------------------
util_rounder | () |
# Purpose : This file provides an example of two calls
# to the function util_rounder()
#
# This function rounds off a given real number
# to a specified number of significant digits.
# In this file, two real values are rounded off
# to five significant digits.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function util_rounder() has the following arguments:
#
# util_rounder
# ( rval,
# nsigd,
# rout )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL r_rval
INTEGER i_nsigd
REAL r_rout
INTEGER i_return_value
#---------------------------------------------------------------------
# i_nsigd = 5
i_nsigd = 5
# r_rval = 202.123
r_rval = 202.123
i_return_value = @
util_rounder @
( r_rval, @
i_nsigd, @
r_rout )
dump i_return_value
# The rounded value of 202.123 upto 5 significant digits is
dump r_rout
# r_rval = 202.125
r_rval = 202.125
i_return_value = @
util_rounder @
( r_rval, @
i_nsigd, @
r_rout )
dump i_return_value
# The rounded value of 202.125 upto 5 significant digits is
dump r_rout
#---------------------------------------------------------------------