Remote-processing BASIC 52 Uživatelský manuál Strana 76

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 163
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 75
RPBASIC-52 PROGRAMMING GUIDE
2-57
LINE# (Statement)
Syntax: LINE# line,data
Where: line = 101 to 125, is the digital I/O line connector number. (Line ranges may vary. Check
your ha rdwa re manual.)
data = ON, OFF, 0, or 1. See text below.
Function: Sets a specified line at the digital I/O connector high or low.
Mode: Command, Run
Use: LINE #10 2,0
Card: Basi c com man d available for all cards. line ranges are card dependent. Refer to hardw are manu al.
DESCRIPTION
LINE # addresse s the dig ital I/O conne ctor pins. line must be between 101 and 125. Line 102 is not valid (it
is the +5 V supply).
data is either ON, OFF, 0 or 1. ON is the same a s a 1 while OFF is a 0. '0' sets the line low w hile a '1' sets it
high. This is the opposite of the LINE command. Opto modules require a low , or '0' level to turn on. LINE
inverts data while LINE # does not. Using ON and OFF speeds up statement execution by about 20%.
LINE and LINE # ma y be us ed interchangeably in a program .
RELATED
LINE, LINEB (function), LINE, LINEB (statement), CONFIG LINE
ERRORS
BAD ARGUMENT When line is out of range
BAD SYNTAX When # is used for on card opto rack
EXAMPLE
The following example shows how different data is returned.
10 LINE 118,OFF Turns off external opto module 18.
20 LINE #118,0 Sets digital I/O connector line 18 to 0.
30 PRINT LINE(118),LINE#(118)
run
1 0
The function LINE(118) returns a 1 because that is the condition to turn off a module.
Zobrazit stránku 75
1 2 ... 71 72 73 74 75 76 77 78 79 80 81 ... 162 163

Komentáře k této Příručce

Žádné komentáře