Campbell-scientific CR800 and CR850 Measurement and Control Systems Manuel d'utilisateur Page 112

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 566
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 111
Section 7. Installation
112
7.7.3 Syntax
7.7.3.1 Numerical Formats
Four numerical formats are supported by CRBasic. Most common is the use of
base-10 numbers. Scientific notation, binary, and hexadecimal formats may also
be used, as shown in table Formats for Entering Numbers in CRBasic
(p. 112). Only
standard, base-10 notation is supported by Campbell Scientific hardware and
software displays.
Table 8. Formats for Entering Numbers in CRBasic
Format Example Base-10 Equivalent Value
Standard 6.832 6.832
Scientific notation 5.67E-8
5.67X10
-8
Binary &B1101 13
Hexadecimal &HFF 255
Binary format (1 = high, 0 = low) is useful when loading the status of multiple
flags or ports into a single variable, e.g., storing the binary number &B11100000
preserves the status of flags 8 through 1. In this case, flags 1 – 5 are low, 6 – 8 are
high. CRBasic example Load binary information into a variable
(p. 112) shows an
algorithm that loads binary status of flags into a LONG integer variable.
CRBasicExample5. Loadbinaryinformationintoavariable
Public FlagInt As Long
Public Flag(8) As Boolean
Public I
DataTable(FlagOut,True,-1)
Sample(1,FlagInt,UINT2)
EndTable
BeginProg
Scan(1,Sec,3,0)
FlagInt = 0
For I = 1 To 8
If Flag(I) = true Then
FlagInt = FlagInt + 2 ^ (I - 1)
EndIf
Next I
CallTable FlagOut
NextScan
EndProg
Vue de la page 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 565 566

Commentaires sur ces manuels

Pas de commentaire