General info about local area network ===================================== This LAN is developed for communication between computers in a classroom. It allows to connect the teacher with up to 15 students and gives the ability to interchange programs, data and messages, between the teacher and student(s) and also between pairs of students. The network operates not only in BASIC, but also in MSX Disk BASIC, MSX-DOS and MSX-CP/M. Notes: 1) For the simplicity of writing, instead of "the teacher's computer" and "the student's computer" the terms "teacher" and "student" will be used below. 2) Like in previous versions of the network, in this version (v3.0) when student accesses the disk drive, BASIC networking commands are temporarily disabled. 3) Network operations use a special RAM (2K) called NetRAM in a net unit and don't use regular RAM (see "Classroom Network Work Area" section). 4) The address given as parameter in NetBIOS call (either from MSX-DOS or MSX-CP/M) points to a 8-byte long area in regular RAM. 5) If it's impossible to run some application when network is enabled (for example, MSX Painter), use _NETEND and then rerun your application. =============================================================== The list of classroom network BASIC commands: =============================================================== CALL HELP shows this list of network commands CALL WHO returns the number of your computer CALL SNDRUN sends BASIC program to student and runs it there CALL SEND sends BASIC program to student CALL BSEND sends a binary program or a screen contents CALL RECEIVE receives BASIC program CALL BRECEIVE receives binary program or screen contents CALL SNDMAIL sends data from the teacher's mailbox to student's mailbox CALL RCVMAIL receives data from student's mailbox to teacher's mailbox CALL MESSAGE sends the message from teacher to students CALL SNDCMD sends a command CALL RUN runs BASIC program on student's computer CALL STOP stops BASIC program on student's computer CALL POKE writes number to NetRAM or to student's memory or student's NetRAM CALL PEEK reads number from NetRAM or from student's memory or student's NetRAM CALL PON starts polling of the students CALL POFF stops polling of the students CALL CHECK checks which students are connected to the net CALL TALK sends message from student to the teacher (or to other student) CALL ONLINE enable the net (only after CALL NETINIT command) CALL OFFLINE disable the net (only after CALL NETINIT command) CALL NETEND switch off the net CALL NETINIT inititlize (switch on) the net CALL ENACOM enables communications between students CALL DISCOM disables communications between students =============================================================== [Teacher/Student] [Syntax] CALL HELP [Action] Shows the list of Net BASIC commands that can be used in a classroom network. The screen have to be in a textual mode. The list of available commands differs between teacher and student. On a student's computer this command will also display its number. If student's sending is enabled (CALL ENACOM), CALL HELP will show also SEND, RECEIVE, BSEND, BRECEIVE and TALK commands. When called without variable as parameter, the number is displayed on the screen. =============================================================== [Teacher/Student] [Syntax] CALL WHO [(variable)] [Action] Returns the number of your computer as set by DIP switch in the network unit (teacher: 0, students: 1 - 15) [Example 1] (when done on student No.3) CALL WHO(A) PRINT A 3 [Example 2] CALL WHO 3 =============================================================== [Teacher/Student] Note: student can use this command only if teacher enabled him to communicate (see CALL ENACOM) [Syntax] CALL BSEND ([filename],[student number],[begin address],[end address],[]) [Action] Sends binary code/data or screen (VRAM) contents. If the student number is not specified, sends to all students. If begin address is not specified, begin address from which the file was saved is used. And if the mentioned begin address is higher then given end address - then the end address is ignored. The data is being sent until the end address is reached or until the file ends. [Example 1] CALL BSEN ("DATA.BIN",12,&H8000) This command sends contents of binary file (created from BASIC with the help of either BSAVE or BRECEIVE commands) to student No.12, and puts them beginning from address &H8000. [Example 2] CALL BSEN (,12,&H0100,&H2000,S) When is used, the contents of your screen are copied to the video memory (VRAM) of the receiving computer. Prior to sending, the VDP screen mode of the receiving computer is automatically set to be the same as on the sending one. In this example VRAM contents of the sending computer from address &H100 to &H2000 are copied to addresses &H100-&H2000 in VRAM of the student No.12. [Example 3] CALL BSEN (,12,,,S) When is used and addresses are not specified, then &H0000 is used as begin address and &HFFFF is used as end address. [Example 4] CALL BSEN ("VDAT.BIN",12,&H0100,&H2000,S) This command sends contents of binary file (created from BASIC with the help of either BSAVE or BRECEIVE command with option) to VRAM of student No.12, to the area of addresses specified by begin address (&H100) and end address (&H2000). When file (not VRAM) is used as data source like in this example, VDP mode on the receiving computer is not set automatically, so if you need it - you have to set VDP mode yourself before sending. =============================================================== [Teacher/Student] Note: student can use this command only if teacher enabled him to communicate (see CALL ENACOM) [Syntax] CALL BRECEIVE ([filename],[student number],[begin address],[end address],[]) [Action] Receives binary code/data or screen (VRAM) contents [Example 1] CALL BREC ("DATA.BIN",10,&HA000,&HB000) This command saves binary code/data from student No.10 memory (RAM) area that begins from &HA000 and ends at &HB000 to disk file "DATA.BIN". Files created by _BRECEIVE and BSAVE have the same format, but _BRECEIVE always sets start address to be equal to begin address. [Example 2] CALL BREC (,10,&H0100,&H2000,S) When is used, the contents of student's screen are copied to the video memory (VRAM) of your computer. Prior to sending, the VDP screen mode of your computer is automatically set to be the same as on the student's one. In this example VRAM contents of the student No.10 from &H100 to &H2000 are copied to addresses &H100-&H2000 in VRAM of your computer. When is used and addresses are not specified, then &H0000 is used as begin address and &HFFFF is used as end address. [Example 3] CALL BREC ("DATA.BIN",12,&H0100,&H2000,S) Screen (VRAM) contents of student are saved to disk file. File created in this example has the same format as the file created by BSAVE with option. Saved file does not contain info about VDP mode, so when you will use this file later you may want to set an appropriate VDP mode yourself. In this example screen (VRAM) data from student No.12's area from address &0100 to &H2000 is saved to disk file named "DATA.BIN" . =============================================================== [Teacher] [Syntax] CALL ENACOM() [Action] Enables student which number is specified to communicate with other students. When enabled, student can use commands CALL SEND, CALL RESEIVE, CALL BSEND, CALL BRECEIVE and send messages to other students (see CALL TALK). If disabled, student can only send messages to the teacher. Specifying 0 as student number enables all students. On network initialization, no student is enabled to communicate with others. [Example] CALL ENAC(12) Enables student No.12 to communicate with other students. =============================================================== [Teacher] [Syntax] CALL DISCOM() [Action] Disables communications (sending/receiving) for a student. For more detailed explanation see CALL ENACOM. [Example] CALL DISC(12) Disables communications for student No.12. =============================================================== [Teacher] [Syntax] CALL CHECK ([],[]) [Action] Checks which students are connected to the net and which students are enabled to communicate with others. [Example 1] CALL CHECK (A) PRINT BIN$ (A) 110110111101100 This command checks which students are connected to the net and returns in variable A number, in binary representation of which the lowest bit (bit 0) corresponds to student No.1, next bit - to student No.2, ..., bit 14 - to student No.15. The highest bit (bit 15) always equals to zero. When any of bits 0-14 equals to zero, this means the corresponding student is connected to the net, 1 - not connected. In this example students 1, 2, 5, 10 and 13 are connected. Easy to see, that when all 15 students are connected, CALL CHECK(A) sets A=0. The meaning of "student is not connected to the net" is one of the following: - student computer is switched off - student computer is on, but physically is not connected to the net - student computer is on, but networking is switched off programmatically with the help of CALL OFFLINE command. [Example 2] CALL CHECK (,B) PRINT BIN$ (B) 111111111101110 This command checks which students can communicate (send/receive) and returns number in variable B. Decipher it like in Example 1 (0 - can communicate, 1 - cannot) In this example students 1 and 5 can send and receive. Enabling/disabling communication is done with the help of CALL ENACOM/CALL DISCOM commands. =============================================================== [Teacher/Student] [Syntax] CALL NETINIT [Action] Initializes network [Example] CALL NETI This command initializes network and usually is needed to switch on networking after using CALL NETEND command. Usually the network is initialized automatically on the computer powerup. =============================================================== [Teacher/Student] [Syntax] CALL NETEND [Action] Switches networking off. [Example] CALL NETE This command is usually used for switching network off when you need to execute an application that cannot work when network is on. =============================================================== [Teacher/Student] [Syntax] CALL POKE (,
,[],[]) [Action] Puts the number into RAM or NetRAM of the student whose number is specified, or into your NetRAM. NetRAM is a special area of RAM mapped into NetROM address space. NetRAM is 2048 bytes long, and it can be accessed on addresses &H7800 - &H7FFF. If student number equals to zero, the given number is poked to all students. [Example 1 - Teacher/Student] CALL POKE (100,&H7800) In this example 100 is written into NetRAM of the computer you are working on at address &H7800. [Example 2 - Teacher only] CALL POKE (100,&HB000,1) In this example 100 is written into RAM of the student computer No.1 at address &HB000. [Example 3 - Teacher only] CALL POKE (100,&H7A00,1,N) In this example 100 is written into NetRAM of the student computer No.1 at address &H7A00. =============================================================== [Teacher/Student] [Syntax] CALL PEEK(,
,[],[]) [Action] Reads the number RAM or NetRAM of the student whose number is specified, or from your NetRAM, and puts it into given variable (see CALL POKE for more detailed NetRAM description). If student number equals to zero, error message is returned. [Example 1 - Teacher/Student] CALL PEEK (A,&H7800) In this example value from NetRAM address &H7800 of the computer you are working on is stored in variable A. [Example 2 - Teacher only] CALL PEEK (A,&HB000,1) In this example command reads value from RAM address &HB000 of student computer No.1 and stores it in variable A. [Example 3 - Teacher only] CALL PEEK (A,&H7A00,1,N) In this example command reads value from NetRAM address &H7A00 of the student computer No.1 and stores it in variable A. =============================================================== [Teacher] [Syntax] CALL MESSAGE (,[]) [Action] Sends a message to a given student. If student number is omitted, sends to all students. The message sent can be up to 56 characters long, but when displayed on the 24th row of the student's screen, the length of the message that can be displayed is determined by the width of current screen. If the student is not in text mode, the message is displayed when the student goes into text mode. When space key is pressed, the message disappears. Note: if student computer is in KEY OFF mode, the message won't disappear after pressing space key and will remain as usual text on the screen (it will scroll up with other text on the screen, you can edit it, etc.) [Example] CALL MESSAGE ("Hello !!",10) In this example message "Hello !!" will be displayed on the screen line 24 of the student No.10. =============================================================== [Student] [Syntax] CALL TALK (,[]) [Action] Sends message from student to the teacher (or to other student). If student is not authorized to communicate, the message can be sent only to the teacher. Otherwise, the message can be sent to student as well. The number of teacher (always 0) or student (1- 15) is passed in a variable. The result of message transmission is returned into the same variable: 0 is OK, 255 means failure. The message sent can be up to 56 characters long, but when displayed on the 24th row of the receiving computer's screen, the length of the message that can be displayed is determined by the width of current screen. If the receiving computer is not in text mode, the message is displayed when it goes into text mode. Max length of a message is 56 chars, but how many of them will be shown is determined by max width in current screen mode on the receiving computer. [Example] CALL TALK ("I dont understand",A) In this example message "I dont understand" will be sent to the student number of which is set in variable B (or to the teacher if B=0). =============================================================== [Teacher/Student] Note: student can use this command only if teacher enabled him to communicate (see CALL ENACOM) [Syntax] CALL SEND [([],[])] [Action] Sends BASIC program from disk file or from the memory to student. If a student already has a BASIC program in memory, it will be erased and student will get a new one. During transmission student will see message "Wait" on the screen, and in the end of transmission - "Ok". If student number is zero or omitted, sends to all students. If filename is omitted, sends the BASIC program that currently resides in the memory of the sending computer. [Example 1] CALL SEND ("A:TEST.BAS",0) In this example BASIC program "A:TEST.BAS" will be sent to all students. [Example 2] CALL SEND (,10) This command sends BASIC program from the memory of the sending computer to student No.10. =============================================================== [Teacher] [Syntax] CALL SNDRUN [([],[])] [Action] Sends BASIC program to student (just like CALL SEND) and runs it. [Example 1] CALL SNDRUN ("A:TEST.BAS",0) In this example BASIC program "A:TEST.BAS" will be sent to and run on all students. [Example 2] CALL SNDRUN (,10) This command sends BASIC program from teacher's memory to student No.10 and runs it there. =============================================================== [Teacher/Student] Note: student can use this command only if teacher enabled him to communicate (see CALL ENACOM) [Syntax] CALL RECEIVE ([],) [Action] Receives BASIC program from student and saves it on disk. This command saves the program on the disk in the same format as SAVE does. If filename is omitted, the program in memory of the receiving computer will be erased and the received program will take it's place. If the program on the student's computer was running at the moment CALL RECEIVE starts working, it will be stopped. Then "Wait" message will be shown, and in the end of transmission "Ok" will appear. [Example 1] CALL RECE ("B:TEST.BAS",14) In this example BASIC program will be received from student No.14 and saved on disk B: as file "TEST.BAS" . [Example 2] CALL RECE (,1) In this example program from student No.1 is received into memory, erasing the program that was in memory before executing the command. =============================================================== [Teacher] [Syntax] CALL SNDMAIL [()] [Action] Sends (copies) contents of teacher's send mailbox to a student's receive mailbox. Mailboxes are a special areas of 256 bytes reserved in NetRAM of both teacher and student. Mailboxes locations (send mailbox: &H7900-&H79FF, receive mailbox: &H7B00-&H7BFF) are defined in network work area (see "Classroom network work areas" section of the manual) variables SMLADR (at &H7C84) and RMLADR (at &h7C86). Sending a mail means transmitting teacher's send mailbox contents to student's receive mailbox. In other words, mailbox is just an area for data transfer, and the way it will be used depends only on you. [Example 1] 10 FOR L=1 TO 5 20 CALL SNDM (L) 30 NEXT L This example copies teacher's send mailbox to receive mailboxes of students No.1-5 [Example 2] CALL SNDM When student number is missing, teacher's send mailbox is being sent to receive mailboxes of all students, like in this example. =============================================================== [Teacher] [Syntax] CALL RCVMAIL () [Action] Receives mailbox contents. [Example] CALL RCVM (5) This command receives contents of outbox of student No.5 and saves them into teacher's inbox. =============================================================== [Teacher] [Syntax] CALL SNDCMD (,[]) [Action] Sends BASIC command to student and executes it there. Carriage return (CHR$(13)) is always added to the end of command. If student number is omitted, sends command to all students. If a command has an error in it or it is not a BASIC command at all, it still will be sent as is without any syntactic or other check and then executed, generating an error message on the student side only - so be careful. If during transmission there is a running BASIC program on a student computer, it will be stopped and then the command will be sent and executed. [Example 1] CALL SNDC ("KEY OFF",3) In this example functional keys hints will disappear on student No.3 as a result of KEY OFF command execution. [Example 2] 10 A$="COLOR 15,4,7" 20 B$=CHR$(13) 30 C$="CLS" 40 CALL SNDC (A$+B$+C$) It's possible to send multiple commands simultaneously - just separate them with carriage return symbol (CHR$(13)). In this example on all student computers command "COLOR 15,4,7" is being executed, and then the screen is cleared by "CLS" command. =============================================================== [Teacher] [Syntax] CALL RUN [([],[])] [Action] Runs a BASIC program on a student computer from given line. If a program was already running, it will be stopped and then rerun from the given line number. If a program does not contain this line, an error message will be displayed, but only on a student computer. If line number is omitted, runs program from the beginning. [Example 1] CALL RUN (1,100) In this example BASIC program is being run from line 100 on student computer No.1. [Example 2] CALL RUN In this example BASIC program will be run on all student computers. =============================================================== [Teacher] [Syntax] CALL STOP [()] [Action] Stops a BASIC program on a student computer. If student number is omitted, stops on all student computers. This command acts exactly as pressing CTRL+STOP does. For example, it stops LIST command on the student computer if it is showing program listing at the moment the teacher executes CALL STOP command. [Example] CALL STOP (5) In this example program will be stopped on student computer No.5. =============================================================== [Teacher] [Syntax] CALL PON [Action] Starts polling of the students. The teacher uses this command to start polling of the students. Unless the students are polled, it is impossible to check which students are connected to the classroom network, the teacher can not receive messages from the students, and communications between the students are impossible. On teacher's computer powerup or network initialization (CALL NETINIT) polling is set on. =============================================================== [Teacher] [Syntax] CALL POFF [Action] Stops polling of the students. The teacher uses this command to stop polling of the students. To restart the polling, execute CALL PON. =============================================================== [Student] [Syntax] CALL ONLINE [Action] Switches student to online mode (student switches himself to online mode after being switched to offline mode by command CALL OFFLINE). On powerup student computer is swithed to online mode automatically. [Example] CALL ONLINE =============================================================== [Student] [Syntax] CALL OFFLINE [Action] Disconnects a student from network (student switches himself to offline mode). Neither teacher nor other students can communicate with an offline computer. In order to become being connected again, student have to use CALL ONLINE command. =============================================================== E N D O F D O C U M E N T ===============================================================