External Devices

Control External Devices.

  1. A device that OS recognizes as an ordinal file.
    This can be controlled as an usual file.
  2. A device that are connected to a serial port.
    This can be handled as an usual file with the file name COM1, COM2, and so on.
    Refer to COM-ports(RS-232C).
  3. A device that becomes a virtual COM-port
    This can be used as usual. COM-port numbers above 10 can be used.
  4. A device with Windows API compatible driver.
    Refer to DLL and Win32 API (BASIC HELP), How to use Win32 API
  5. A deice with ActiveX.
    OLE automation, OLE Automation (OCX).
  6. A device that is connected to a parallel port.
    When manipulating I/O ports of CPU directly is required, use VBIOSCM libraly.
    Refer to How to use a DLL.

In any case, be careful with the character coding and the line end code.

When you want to manipulate a byte as a character, write
OPTION CHARACTER BYTE
on each program unit.

Line end code can be assigned for an opened file as follows.
SET #n ENDOFLINE CHR$(13)
This sets CR as the line end code.
When the Line end code is LF, CHR$(13) should be replaced by CHR$(10).
When the opposite uses CR+LF as the line end, this SET statement is not needed.



Bibliography.
RBIO-2U SIMPLE CONTROLLER (十進BASICで動作する RBIO-2U 用 出力簡易制御プログラム)

Back