Show/Hide Toolbars

Irinos Measurement System

Navigation: MscDll Reference Guide > Opcodes and parameters > Opcodes: Measurement

opcBIO: Read digital inputs / write digital outputs

Scroll Prev Top Next More

This opcode is used for exchanging Bit I/O data (digital in- and outputs).

 

Overview


Opcode:              0x42

Name:                opcBIO

Function:            Bit I/O

Parameter type:        Binary

 

DLL-Funktion


The Bit I/O data can be exchanged continuously using MSC_SetupStaticChannel and MSC_ReadStatic. If output data (digital outputs) is changed, the function MSC_RefreshChannel must be called (otherwise the MscDll won't use the updated output data). This is the preferred way.

Alternatively Bit I/O data can be exchanged using MSC_WriteCommand.

 

Request data to the Irinos-System


Byte 0        Digital outputs 1..8

Byte 1        Digital outputs 9..16

Byte 2        Digital outputs 17..24

etc.

 

Response data from the Irinos-System


Byte 0        State of the digital outputs 1..8

Byte 1        State of the digital outputs 9..16

Byte 2        State of the digital outputs 17..24

etc.

Byte x+0        State of the digital inputs 1..8

Byte x+1        State of the digital inputs 9..16

Byte x+2        State of the digital inputs 17..24

etc.

 

Comments


The response data first contains "mirrored" output bytes. The data length of the digital outputs is always identical to the data length of the digital inputs. Examples:

oIf 8 output bytes are written to the request data, the response contains 8 (mirrored) bytes for the output bytes plus 8 additional bytes for the input data.

oIf 16 output bytes are written to the request data, the response contains 16 (mirrored) bytes for the output bytes plus 16 additional bytes for the input data.

 

The number of in-/output data bytes is independent of the real number of digital in- and outputs available:

oIf more output bits are written than digital outputs are available, the additional bits will be ignored.

oIf less input bits are read than digital inputs are available, the status of the additional inputs is not transferred to the PC.

oIf more input bits are read than digital inputs are available, all additional input bits read as 0.

 

Exchanging Bit I/O data is quite similar to reading static measurement values. Typically the data is exchanged between the MscDll and the Irinos-System continuously. An important difference is, that Bit I/O required a bidirectional data transfer.

Usually this opcode is used together with the function MSC_SetupStaticChannel. This function defines a send- and a receive-buffer. The send-buffer contains the output bits and the receive-buffer the inputs bits.

The MscDll contains a local buffer for the output data. If the application wants to change the output data, it must tell this the MscDll via the function MSC_RefreshChannel.