Campbell CR5000 Specifiche Pagina 179

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 238
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 178
Section 8. Processing and Math Instructions
8-7
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 FunctionExample
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
CosH (Source)
The COSH function returns the hyperbolic cosine of an expression or value.
Syntax
x = COSH (source)
Remarks
The COSH function takes a value and returns the hyperbolic cosine [COSH(x)
= 0.5(ex + e-x)] for that value.
COSH Function Example
The example uses COSH to calculate the hyperbolic cosine of a voltage input
and store the result in the Ans variable.
Vedere la pagina 178
1 2 ... 174 175 176 177 178 179 180 181 182 183 184 ... 237 238

Commenti su questo manuale

Nessun commento