Campbell CR800 Spécifications Page 209

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 324
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 208
Section 8. Processing and Math Instructions
Parameter
& Data Type
Enter
Dest
Variable or
Array
The variable or array in which to store the average(s).
Reps
Constant
When the source is an array, this is the number of variables in the array to
calculate averages for. When the source is not an array or only a single
variable of the array is to be averaged, reps should be 1.
Number
Constant
The number of values to include in the running average.
Source
Array
The name of the variable or array that is to be averaged.
Example
BeginProg 'Program begins here
Scan( RATE, RUNITS, 0, 0 ) 'Scan 1(mSecs),
'______________________ Volt Blocks ______________________
VoltDiff(HiVolts, VREP1, VRNG1, 5, 1, 0, VDLY1, VINT1, VMULT1,
VOSET1)
AvgRun(AvgOut,1,HiVolts,100 ) 'Put the average of 100 HiVolts in
AvgOut
CallTable MAIN 'Go up and run Table MAIN
Next Scan 'Loop up for the next scan
EndProg 'Program ends here
Cos (Source)
Returns the cosine of an angle specified in radians.
Syntax
x = Cos (source)
Remarks
Source can be any valid numeric expression measured in radians.
The Cos function takes an angle and returns the ratio of two sides of a right
triangle. The ratio is the length of the side adjacent to the angle divided by the
length of the hypotenuse. The result lies in the range -1 to 1.
To convert degrees to radians, multiply degrees by π/180. To convert radians
to degrees, multiply radians by 180/π.
Cos Function Example
The example uses Cos to calculate the cosine of an angle with a user-specified
number of degrees.
Dim Degrees, Pi, Radians, Ans 'Declare variables.
BeginProg
Pi = 4 * Atn(1) 'Calculate Pi.
Degrees = Volts(1) 'Get value to convert.
Radians = Degrees * (Pi / 180) 'Convert to radians.
Ans = Cos(Radians) ‘The Cosine of Degrees.
EndProg
8-7
Vue de la page 208
1 2 ... 204 205 206 207 208 209 210 211 212 213 214 ... 323 324

Commentaires sur ces manuels

Pas de commentaire