Campbell CR800 Especificações Página 117

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 324
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 116
Section 5. Program Declarations
5-7
Exit Sub Causes an immediate exit from a Subroutine. Program
execution continues with the statement following the
statement that called the Subroutine. Any number of Exit
Sub statements can appear anywhere in a Subroutine.
End Sub Marks the end of a Subroutine.
A Subroutine is a procedure that can take variables, perform a series of
statements, and change the value of the variables. However, a Subroutine can't
be used in an expression. You can call a Subroutine using the name followed
by the variable list. See the Call statement for specific information on how to
call Subroutines.
Caution Subroutines can be recursive; that is, they can call themselves to
perform a given task. However, recursion can lead to strange
results.
Subroutine Example
'CR800
'Declare Variables used in Program:
Public RefT, TC_C(4), TC_F(4), I
'Data output in deg C:
DataTable (TempsC,1,-1)
DataInterval (0,5,Min,10)
Average (1,RefT,FP2,0)
Average (4,TC_C(),FP2,0)
EndTable
'Same Data output in F :
DataTable (TempsF,1,-1)
DataInterval (0,5,Min,10)
Average (1,RefT,FP2,0)
Average (4,TC_F(),FP2,0)
EndTable
'Subroutine to convert temperature in degrees C to degrees F
Sub ConvertCtoF (TmpC, TmpF)
TmpF = TmpC*1.8 +32
EndSub
BeginProg
Scan (1,Sec,3,0)
'Measure Temperatures (panel and 4 thermocouples) in deg C
PanelTemp (RefT,250)
TCDiff (TC_C(),4,mV2_5C,1,TypeT,RefT,True ,0,250,1.0,0)
'Call Output Table for C
CallTable TempsC
'Convert Temperatures to F using Subroutine:
Vista de página 116
1 2 ... 112 113 114 115 116 117 118 119 120 121 122 ... 323 324

Comentários a estes Manuais

Sem comentários