Campbell CSIOPC Spezifikationen Seite 111

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 322
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 110
Section 9. CR1000 Programming
9-3
9.3.3 Transformer
This section is not yet available.
9.4 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 9.4-1. Only standard base 10 notation is
sup
ported by Campbell Scientific hardware and software displays.
TABLE 9.4-1. Formats for Entering Numbers in CRBASIC
Format Example Value
Standard 6.832 6.832
Scientific notation 5.67E-8 5.67X10
-8
Binary: &B1101 13
Hexadecimal &HFF 255
Binary format is useful when loading the status (1 = high, 0 = low) 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. Program Code EXAMPLE 9.4-1 shows an algorithm
t
hat loads binary status of flags into a LONG integer variable.
EXAMPLE 9.4-1. CRBASIC Code: Program to load binary information into a single variable.
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
Seitenansicht 110
1 2 ... 106 107 108 109 110 111 112 113 114 115 116 ... 321 322

Kommentare zu diesen Handbüchern

Keine Kommentare