Home > Vidicode > Communications System > Vidicode Argus Basic Programmers Reference Manual

Vidicode Argus Basic Programmers Reference Manual

    Download as PDF Print this page Share this page

    Have a look at the manual Vidicode Argus Basic Programmers Reference Manual online for free. It’s possible to download the document as PDF or print. UserManuals.tech offer 9 Vidicode manuals and user’s guides for free. Share the user manual or guide on Facebook, Twitter or Google+.

    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    78
      
    FAX ON/OFF    turn FAX on or off 
    With FAX ON the modem will wait for an answer tone after dialing and then return with result code 19 (=ESCAPE).  The 
    FAX SEND and FAX RECEIVE commands will both automatically set FAX ON. 
    With FAX OFF the modem tries to connect as a modem. 
    Examples: 
    FAX ON
    DIAL TONE 123456
    IF RESULT=19 GOTO Continue ELSE GOTO Error
    Syntax: 
    FAX [ON|OFF]
    See also: 
    FAX SEND, FAX RECEIVE
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    79
      
    FAX RECEIVE    receive fax 
    The FAX RECEIVE command is a powerfull tool that allows the Argus to receive a fax directly onto the disk filing system.  
    Before using the FAX command a RAM buffer of at least 1024 bytes big must be defined with the BUFFER command. 
     
    The FAX RECEIVE command consists of three parts. 
    FAX RECEIVE [file] 
    Filename can have a maximum of 10 characters.  No wildcards are allowed.  After connecting, a file is stored which starts 
    with page number 01.  Also the resolution is added to the file name.  Example: 
    FAX RECEIVE test
    will receive file  TEST.01.S or (TEST.01.F) 
    next page  TEST.02.S or (TEST.02.F) 
    etc. 
     
    There is 1 exceptions on the file name, namely when the name starts with a # (hash): 
    FAX RECEIVE #
    the modem will first connect and then send all the received G3 data through the fax printer driver.  It will then be printed out 
    on the printer on port 1, port 2 or port 7 (depending on OPORT). 
    FAX RECEIVE [file], [option] 
    These are the same options as for FAX SEND.  The ,U and ,T and ,N options have no effect. 
     
    If you only want to receive in standard resolution you can add ,S.  Example: 
    FAX RECEIVE test,S
    If you add ,F, it depends on the sending fax whether it will be received as a standard or fine resolution file. 
     
    The speed register (S51) can also be set to ensure reception at a known speed.  If it is set at 0 (S51=0) then the highest 
    speed, after negotiation with the other fax machine, is used. 
     
    During the handshaking process, the two faxes exchange their IDs.  The ID numbers are strings with a maximum length of 
    20 characters and may only contain numbers and the characters + and -.  The ID of the sending fax machine will be stored 
    at address &2950 after leaving the FAX RECEIVE command, while your own ID must be stored at address &2970 before 
    executing the FAX RECEIVE command.  The commands POKE$ and PEEK$ are used to write and read the ID strings. 
    FAX RECEIVE [file] TO [number] 
    A number can be added in a special case, namely polling.  Example: 
    FAX RECEIVE test TO 01223-1227
    The modem will dial up another fax machine and will look for a ready to send document (polling).  If there is a document it will 
    receive it and store it in the usual way. 
    See also: 
    ERN, FAX SEND, MATCH, RESULT
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    80
      
    FAX SEND ...TO...    send fax 
    The FAX SEND command is a powerfull tool that allows the Argus to send a fax from the disk filing system.  Before using 
    the FAX command a RAM buffer of at least 1024 bytes big must be defined with the BUFFER command. 
     
    The FAX SEND ... TO ... command consists of three parts. 
    FAX SEND [file] 
    The file name can be any name up to 16 characters long. If the file name is 10 characters or less, the system will 
    automatically add .01*.* as the first page number. If found, the sending continous with .02*.*, .03*.*, etc until no more 
    files/pages are found. Example: 
    (file) = TEST will send TEST.01
    TEST.02
    etc.
    or
    TEST.01.S
    TEST.02.S
    etc.
    If the file name is more than 10 characters long OR a wildcard is used (* or ?), the system just sends the matching files, 
    without adding page numbers. If you are using wildcards in the file name, many files can be sent with one command.  
    Example: 
    (file) = TEST*.* will send TEST
    TEST1
    TEST999
    TEST-ALL
    TEST-TEXT.01
    TEST-TEXT.02
    TEST-BIN.S
    TEST-BIN.F
    TEST.T
    TEST50.01.T
    When a file name ends with .T  or nothing, it will be treated as a text-file. Convertion to G3 format is done on the fly during 
    sending. 
     
    When a file name ends with .S  it will be treated as a Standard resolution G3 file. Standard resolution can not be converted 
    to Fine resolution by the modem! 
     
    When a file name ends with .F  it will be treated as a Fine resolution G3 file. Fine resolution is automatically converted to 
    Standard during sending if the receiving fax doesn’t support Fine or if sending is fixed to Standard.  
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    81
      
     
    When a file name ends with ‘.G‘ it will be treated as a G3 file with an unknown resolution. How the file is sent depends on 
    the negotiation of the 2 fax machines and on the way the resolution is set with S-register 17. 
     
    Page numbers can be maximum of .99 (after that it will continue with .AO, .A1, .....til .Z9). 
    FAX SEND [file], [option] 
    Some options can be added to the command: 
    ,U
    ;  Unread files only 
    ,S
    ;  Send in Standard resolution only 
    ,F
    ;  Send in Fine resolution only 
    ,T
    ;  Include Top Line and strip lines of a .F or .S file 
    ,N
    ;  Dont send Top Line and dont strip from a G3 file 
    Examples: 
    FAX SEND Text$,U,T,S TO Tel$
    FAX SEND Text$,N TO Tel$
    FAX SEND Text$,F TO Tel$
    These options can also be selected by S-register 17: 
     
    S17 ; Fax flags 
    b7
    =0/1=  Fax connection disabled/enabled (FAX OFF/ON) 
    b6
    =0/1=  No/Yes send own Top Line (,N/,T) 
    b5
    =0/1=  Standard/Fine resolution (,S/,F) 
    b4
    =0/1=  No/Yes strip Top Line of bin file (,N/,T) 
    b2+b3
    =  Select line-time: 0,10,20,40 ms 
    b0+b1
    =  Dont alter (not for faxing)! 
    Stripping the Top Line from a G3 file will remove the first 16 (Standard) or 32 (Fine) scan-lines during the sending of that file.  
    This is equal to 2 text-lines when compared to a text-fax. 
    Adding your own Top Line is enabled by setting bit6. 
    Bit7 is automatically set/cleared by the system when using the FAX command. 
    Selecting the line-time is only used when receiving faxes and normally doesn’t have to be changed. 
     
    After &F  the register is set on 83, which means: 
      Standard resolution and Top Line included (,S,T). 
    The speed at which the modem is transmitting depends on S-register 51.  It also depends on the negotiation with the other 
    fax-machine. 
    S51=0
    ;  Transmit at highest speed possible after negotiation 
    S51=11
    ;  Transmit at 9600 (V29) only 
    S51=7
    ;  Transmit at 7200 (V29) only 
    S51=5
    ;  Transmit at 4800 (V27ter) only 
    S51=6
    ;  Transmit at 2400 (V27ter only 
    S51=28
    ;  Transmit at 14400 (V17) only 
    S51=29
    ;  Transmit at 12000 (V17) only 
    The V17 speeds can be disabled (excluded from the negotiation) by setting bit3 in S-register 23 (SREG23=SREG23 OR
    8). 
    After sending or receiving a fax, the used speed can be read from S-register 50 (X=SREG50). 
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    82
      
    During the handshaking process, the two faxes exchange their IDs.  The ID numbers are strings with a maximum length of 
    20 characters and may (officially) only contain numbers and the characters + and -.  The ID of the receiving fax machine 
    will be stored at address &2950 after leaving the FAX SEND command, while your own ID must be stored at address 
    &2970 before executing the FAX SEND command.  The commands POKE$ and PEEK$ are used to write and read the 
    ID strings. 
     
    The top line text must be stored at address &2990.  This text is a string with a maximum length of 100 characters and can be 
    written and read using the commands POKE$ and PEEK$. 
    FAX SEND ... TO [number]: 
    This can be a telephone number.  A D (Dial) is automatically put in front of the string, and is treated as a normal ATD 
    command.  Examples: 
    FAX TEXT TO 0-123456
    FAX TEXT TO T018282
    FAX TEXT TO p0w111111
    If the modem is already on-line, then this string will be ignored. 
     
    There are three (3) special cases: 
     
    When the command starts with a less than sign (): 
    After dialing, connecting and sending the file(s), the modem will not stop sending, but will return with result code 19 
    (= ESCAPE).  First, however, it will end its current page and start a new page on the other fax-machine.  A 
    second FAX-command can then be given and sending will continue with another file on a new page.  This is 
    especially useful for adding documents. 
    When the command starts with a hash (#): 
    The converted fax data is now routed through the fax printer driver.  It will then be printed out on the port selected 
    by OPORT.  No dialing is needed or done.  For example: 
    FAX SEND TEXTFILE TO #
    Program example: 
     
    FAX ON ;
    Enable fax connection 
    DIAL Tel$ ;
    Dial number and wait for Answer tone 
    IF RESULT19 GOTO Err ;
    Result = ESCAPE (Answer tone found)? 
    FAX Head$ TO < ;
    Go back on-line, connect/negotiate and send header 
    IF RESULT19 GOTO Err ;
    Successful so far? 
    FAX Text$ TO < ;
    Go back on-line, and continue sending text file on same page 
    IF RESULT19 GOTO Err ;
    Still successful? 
    FAX Foot$ TO > ;
    Go back on-line and continue sending footer on same page 
    IF RESULT19 GOTO Err ;
    Still successful? 
    FAX Dcmt$ TO  ;
    Go back on-line and continue sending document on next page 
    IF RESULT GOTO Err ;
    Overall successful? 
     
    There are 3 system variables which can be read or checked after the FAX SEND/RECEIVE command:  MATCH,
    RESULT and ERN. 
     
    MATCH is a function which acts as a counter:  
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    83
      
    After FAX SEND, it contains the total number of files sent. 
    After FAX RECEIVE, it contains the number of pages received. 
    RESULT is a function which holds the status of the last modem activity: 
     
    RESULT = 0 OK
    :  Sending or Receiving was successful 
    RESULT = 2 RING
    :  File not found with FAX SEND (special case) 
    RESULT = 3 NO CARRIER
    :  Initiate handshake with other fax has failed 
    RESULT = 4 ERROR
    : 
     No confirmation from other fax after sending a page or 
    failure during receiving a page 
    RESULT = 6 NO DIALTONE
    :  No dialtone found before dialing out 
    RESULT = 7 BUSY
    : 
     Other fax found busy after dialing out or disk is full during 
    receive (special case) 
    RESULT = 8 NO ANSWER
    :  No answer (answer tone) found after dialing out 
    RESULT = 18 OFF-HOOK
    :  Modem is not connected to telephone system or line is 
    already in use 
    RESULT = 19 ESCAPE
    :  Used when sending, meaning continue 
    RESULT = 20 VOICE
    :  Human voice (or much noise) found after dialing 
    ERN is only set when a filing system error has occured: 
    ERN = 0 OK
    : No error 
    ERN = 22 Out of memory
    :  Disk is (became) full during FAX RECEIVE 
    ERN = 73 Not found
    :  File not found during FAX SEND  RESULT 
    is set to 2 also in this case 
     
    The only real BASIC errors which can occur are: 
    No filing system
    : No filing system ROM available 
    No fax system
    : No fax system ROM available 
    No/Bad BUFFER
    : No or too small RAM buffer is defined (must be at least BUFFER &400, 
    1k bytes, 1024 bytes) 
    Sending TEXT faxes 
    ASCII text files are converted to G3 format on the fly.  The output on the remote fax machine depends on the 4 parameters 
    set with the DUTCH or ENGLISH command: 
     
    1. Characters per line: 
      
    0  =  Word Warp disabled, 10 chars/inch, max. 80 chars on a line 
    1-88  =  Word Wrap enabled, 10 chars/inch, max. 80 chars on a line 
    89-112  =  Word Wrap enabled, 12 chars/inch, max. 96 chars on a line 
    113-254  =  Word Wrap enabled, 17 chars/inch, max. 136 chars on a line 
     
    Word Warp means that a whole word is started on a new line if it doesn’t fit on the current line. 
    A new line is always generated after a character with the value equal to S-register 3 which defaults to control-character 13 
    (=Cariage Return).  All characters with a value equal to S-register 4 are ignored; default control-character 10 (=Line Feed). 
     
    2. Lines per page: 
     
    The maximum number of lines per page can be set with this parameter. If more lines are in the file, then a new page is 
    negotiated first with the remote fax before sending continues.  For standard A4 format this parameter must be set to 68 if the 
    top line is enabled or 70 if the top line is disabled.  
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    84
      
    Setting this parameter to 0 will disabled the automatic page-break generation.  A new page is also forced if the file contains a 
    control-character 12 (=CTRL-L=Form Feed).  If  a control-character 26 (=CTRL-Z=End Of File) is encountered the sending 
    stops. 
     
    3. Left margin: 
     
    Enabling the left margin will add some spaces in front of a line, if that line is less than 80, 96 or 136 characters. 
     
    4. Page fillout: 
     
    Enabling the page fillout will fill the page with empty lines on the bottom until the ‘lines per page’ is reached. This is done 
    before starting a new page and at the end of the file. 
     
     
    For use inside a text file, a few embedded commands are recognized: 
     
    @D+ 
    = Use 12 chars/inch 
    @D- 
    = Use 10 chars/inch 
    @C+ 
    = Use 17 chars/inch 
    @C- 
    = Use 10 chars/inch 
    @I+ 
    = Use 8 lines/inch vertical 
    @I- 
    = Use 6 lines/inch vertical (default) 
    @B+ 
    = Bold on 
    @B- 
    = Bold off 
    @U+ 
    = Underlined on 
    @U- 
    = Underlined off 
     
    See also: 
    ERN, FAX RECEIVE, MATCH, RESULT
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    85
      
    FOR ... (TO) ... (NEXT) ... (STEP)    loop structure 
    The Argus BASIC FOR ... NEXT loop construct is very similar to that used in most versions of BASIC, and allows a 
    sequence of commands to be executed a fixed number of times depending upon the value of a loop variable. 
     
    For example: 
    10 PRINT Start
    20 FOR X=1 TO 10 : PRINT X; ; : NEXT X
    30 PRINT End
    will display: 
    Start
    12345678910
    End
    i.e. the first time the FOR command is encountered, the numeric variable X is set to 1 and printed.  The loop is then 
    repeated, X being incremented to 2 and printed again.  This procedure is repeated until X is 10, after which line 30 is 
    executed and the program ends. 
     
    By default, the loop variable X, is incremented by 1, but this can be changed by including the optional STEP clause in the 
    FOR command: 
    10 PRINT Start
    20 FOR X=1 TO 10 STEP 2 : PRINT X; ; : NEXT X
    30 PRINT End
    Here, X is incremented by 2 each time the loop is executed, so only the numbers 1, 3, 5, 7, 9 are printed. 
     
    More complicated loops can be constructed by including multiple commands between FOR and NEXT: 
    50 FOR X=1 TO 5 : PRINT X : PRINT X*X :
    PRINT X*X*X : NEXT X
    This program line prints X, the square of X and the cube of X for each value of X between 1 and 5.  The number of 
    commands executed is limited only by the maximum line length of 255 characters. 
     
    Up to sixteen FOR ... NEXT loops can nested within each other, each operating on a different loop variable: 
    FOR A=1 TO 10 : FOR B=5 TO 15 :
    PRINTA+B:NEXT B : NEXT A
    Here, there are two loops.  This example could in fact be shorter (and more efficient) by combining the two NEXT 
    commands: 
    FOR A=1 TO 10 : FOR B=5 TO 15 :
    PRINTA+B:NEXT B, A
    It is also possible to omit the variable following NEXT completely; in which case the variables are incremented innermost 
    first.  The example above would then become: 
    FOR A=1 TO 10 : FOR B=5 TO 15 :
    PRINTA+B:NEXT , 
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    86
      
    The trailing comma in this example is necessary to ensure that the outer NEXT loop variable is incremented. 
    Examples: 
    FOR Code = 32 TO 126 : PRINT CHR$(Code) : NEXT
    FORX=0TO-10STEP -2 : PRINT X : NEXT
    Syntax: 
    FOR [num-var] = [integer] TO [integer] (STEP [integer]) : [command] :
    .... NEXT ([num-var]) (,)
    See also: 
    REPEAT ... UNTIL, WHILE ... WEND
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    87
      
    FREQ    frequency measurement 
    The frequency of the signal on the telephone line is permanently measured by the modem.  When the modem is off-hook, the 
    command FREQ will read this value.  This is only useful for specialist applications; but we can think of some very special 
    ways of using it for access control of your computer. 
     
    The value is updated every 100ms by the operating system.  Reading the value faster than 100ms will return the last/same 
    values and has no use. 
    Examples: 
    PRINT FREQ
    Tone = FREQ
    Syntax: 
    [num-var] = FREQ
    See also: 
    ADC
      
    						
    All Vidicode manuals Comments (0)

    Related Manuals for Vidicode Argus Basic Programmers Reference Manual