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

  • 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 71
RPBASIC-52 PROGRAMMING GUIDE
2-53
LINE (Function)
Syntax: A = LINE(line)
Where: line = 0-9 o r 100 to 123 (L ine ranges m ay vary. Check you r hardw are manual.)
Function: Returns status of a line at on-card lines L 0-7 or interrupt port.
Mode: Command,Run
Use: A = LINE(2) Reads line 2.
Cards: Basic function available on a ll cards. Range s vary from ca rd to card. See hardware m anual.
DESCRIPTION
LINE returns a 0 or a 1. A '0' corresponds to a low while a '1' is a high. LINE returns the status of an external
opto rack line or on ca rd lines 0-7. line number corresponds to a position on an external opto rack. For on
card lines, the range is 0 to 9. For an off card rack connected to the digital I/O port, it is num bered 100 to
123. 100 is sim ply added to the opto position number to spec ify a position.
When using LINE to return the status of an opto output line, a '0' means the module is ON while a '1'
indicates it is OFF. This is in contrast to the LINE statement which turns on a module with a '1'. When
reading an opto input module, a '0' indicates there is no voltage applied to the inputs.
LINE returns true logic for L0-L7. A "0" is a logic low while a "1" is a logic high. Line 8 returns the status
of INT0 and/or ISOA/B input. Line 9 returns the status of INT 1.
LINE(n) and LINE #(n) may be used interchangeably in a program. For example, you m ay have an external 8
position opto rack and use some of the non opto digita l lines fo r switch inputs.
RELATED
LINE#, LINEB functions, LINE, LINE#, LINEB statements, CONFIG LINE
ERRORS
BAD SYNTAX When '(' or ')' are missing
BAD DATA When line is out of range for a port.
EXAMPLE
The following example show how LINE and LINE# may be used
10 CONFIG LINE 100,12,0,0,1 Configure I/O port
20 PRINT LINE(104) Read external opto rack position 4
30 PRINT LINE#(119) Read digital I/O port line 19 (Port A.0)
40 LINE 100,1 Turns on opto module at external rack position 0
50 LINE#110,1 Turns on high current output at I/O port line 10.
Zobrazit stránku 71
1 2 ... 67 68 69 70 71 72 73 74 75 76 77 ... 162 163

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

Žádné komentáře