Perle Systems Sds4 Manuel d'utilisateur Page 422

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 460
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 421
Utilities 421
API I/O Access Over TruePort
API I/O Access Over TruePort
You can access IOLAN I/O data through TruePort using the Perle API. The API uses the
command/response format. See the
ioapiotp.c sample program, found on the product CD-ROM,
for an example implementation.
API Request Format
All data in the Request must be sent as a single write to the COM port. The API command takes the
following format:
API Response Format
The API command takes the following response format:
Number of Bytes Value
1 Function Code (in hexadecimal):
z 01—Get read/write boolean register
z 03—Get read/write register
z 04—Get read only register
z 15—Set read/write boolean register (0x0F)
z 16—Set read/write register (0x10)
2 Starting register number (see A4/T4 Registers , A4D2/A4R2 Registers ,
or D4/D2R2 Registers for this value).
2 Number of registers to act on starting from the register defined in byte
2 above.
n Data for write. Some values must be read/written as a unit consisting of
2 consecutive registers. If the request is to write, the data to write
follows the number of registers. If accessing registers consisting of 2
bytes or 4 bytes, the data is in big endian (network order) format.
Number of Bytes Value
1 Function code of request if no error. Most significant bit will be set if
an error occurred.
1 Length of data in response if no error occurred. If an error occurred, the
byte will contain the error code (see the
Error Codes table below).
n Data response for request (the number of bytes is dependent on the
number and type of registers requested). If the request returns 2 or 4
byte values, it will be in big endian (network order) format. If the
request returns boolean values, the least significant bit (bit 0) represents
the first value requested and bits 1 to 7 represents subsequent boolean
values. If more than 8 boolean registers are requested, they are returned
in successive bytes.
Vue de la page 421
1 2 ... 417 418 419 420 421 422 423 424 425 426 427 ... 459 460

Commentaires sur ces manuels

Pas de commentaire