Main Page

I2C.Labview Documentation
telos Systementwicklung GmbH (http://www.telos.info) 2014/06/24


Introduction

The Labview support for telos' I2C boards consists of the following VIs, which can be found in the installation directory of I2C Studio:

Open | I2cOpen.vi
Close | I2cClose.vi
Config | I2cConfig.vi
Find Boards | I2cFindBoards.vi
Master | I2cMaster.vi
Tracer | I2cTracer.vi
Tracer Data | I2cTracerData.vi
Slave | I2cSlave.vi
A/D | I2cAdc.vi

At least Labview 2014 is needed to use the VIs. Older versions for Labview 8.2 are still available from our support.

To use I2C in Labview the following steps are necessary (e.g. as I2C master):

  • Create your own VI.

  • Change to the diagram window using "CTRL-E".

  • Open the context menu:

    Choose "Select a VI..." and add the following VIs to your diagram: I2cOpen, I2cMaster, and I2cClose.

  • Use the "Connect Wire" tool to add controls and indicators and to connect the VIs.

  • Now you can use the "main" window of your VI to send data as a master transmitter to the I2C bus:
telos Systementwicklung GmbH (http://www.telos.info)


I2cOpen

I2cOpen.vi

This VI, which is part of telos' I2C.Labview API, can be used to get a reference to an I2C board. The reference can be passed to other parts of the I2C.Labview API like "I2cMaster". When the reference is no longer needed, it is important to release it using the "I2cClose" VI.

Connector Pane

Controls and Indicators

cu16

Serial Number

Each I2C board has got an unique serial number, which can be found at the bottom of the board. This parameter specifies the serial number of the board to be opened.

cenum

Board Type

Specifies the type of the board to be opened, e.g. "Tracii XL".

cerrcodeclst

Error In (No Error)

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cstr

Network Address

Sets the network address of the I2C scheduler. To use the local I2C scheduler use "localhost".

cstr

Password

Sets the password of the I2C scheduler. To use the local I2C scheduler use "".

ci32

LPT Port

Specifies the LPT port used by a Tracii 400 board.

cu16

Network Port

Sets the network port of the I2C scheduler. To use the local I2C scheduler (with default configuation) use "3000".

cbool

Is Open

This output connector can be used to detect whether the I2C board has been opened or not.

cerrcodeclst

Error Out

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cdotnetrefn

I2C Reference

This I2C reference can be passed to other VIs of the I2C.Labview API like "I2cMaster".


I2cClose

I2cClose.vi

This VI, which is part of telos' I2C.Labview API, can be used to close an I2C reference. Such a reference can be created using the "I2cOpen" VI. It is very important to close unused I2C references, because the allocate limited resources.

Connector Pane

Controls and Indicators

cerrcodeclst

Error In (No Error)

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cdotnetrefn

I2C Reference

This I2C reference gets closed by this VI.

cerrcodeclst

Error Out

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.


I2cMaster

I2cMaster.vi

This VI, which is part of telos' I2C.Labview API, can be used to exchange data with an I2C slave as master. Three kinds of transfers are supported: master transmitter, master receiver, combined (master receiver after master transmitter).

Connector Pane

Controls and Indicators

cu16

I2C Address

The I2C address specifies the slave to be addressed.The VI expects addresses in the 7 bit or 10 bit format as specified in the I2C standard. Valid addresses: 0..3, 8..119, 124..127 (7 bit); 0..1023 (10 bit).

Some data sheets of I2C devices are using a 8 bit representation. To convert a 8 bit address to a 7 bit representation shift the value of the address one bit to the right.

cbool

I2C Address (10 bit?)

This flag determines whether the "I2C Address" value specifies a 7 or 10 bit I2C slave address.

cerrcodeclst

Error In (No Error)

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cu32

Number Of Bytes

This connector specifies the number of bytes to be read from the slave as master receiver.

cbool

Transmitter Enabled

If this flag is "true", the VI will create a master transmitter transfer. If also the "Receiver Enabled" flag is "true", the VI will create a combined transfer.

c1du8

Data In

The VI sends this array of UInt8 data to the I2C slave as master transmitter.

    cu8

cbool

Receiver Enabled

If this flag is "true", the VI will create a master receiver transfer. If also the "Transmitter Enabled" flag is "true", the VI will create a combined transfer.

cu32

Bitrate

Specifies the bitrate used on SCL by the I2C master.

cu32

Bitrate High-Speed

Specifies the high-speed bitrate used on SCL by the I2C master. A value of "0" disables the high-speed mode.

cdotnetrefn

I2C Reference In

I2C reference create with the "I2cOpen" VI.

cerrcodeclst

Error Out

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cdotnetrefn

I2C Reference Out

I2C reference create with the "I2cOpen" VI.

c1du8

Data Out

This array contains the data read from the slave as master receiver.

    cu8


I2cAdc

I2cAdc.vi

This VI, which is part of telos' I2C.Labview API, can be used to control the A/D converter on Tracii XL and Tracii XL 2.0.

Connector Pane

Controls and Indicators

cerrcodeclst

Error In (No Error)

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cbool

Use Start As Trigger

Specifies whether a START condition on the I2C bus is used as trigger for the A/D converter.

cbool

Use Stop As Trigger

Specifies whether a STOP condition on the I2C bus is used as trigger for the A/D converter.

cbool

Use Ack As Trigger

Specifies whether an ACK condition on the I2C bus is used as trigger for the A/D converter.

cbool

Use Testpin1 As Trigger

Specifies whether testpin 1 is used as trigger for the A/D converter.

cbool

Use Testpin2 As Trigger

Specifies whether testpin 2 is used as trigger for the A/D converter.

ci32

Sampling Rate

Specifies the sampling rate of the A/D converter.

ci32

Pre Trigger

Specifies the pre trigger of the A/D converter.

cbool

Use Nack As Trigger

Specifies whether a NACK condition on the I2C bus is used as trigger for the A/D converter.

cbool

Use Error As Trigger

Specifies whether an ERROR condition on the I2C bus is used as trigger for the A/D converter.

cdotnetrefn

I2C Reference In

I2C reference created with the "I2cOpen" VI.

cwdtint

SCL Waveform

Contains the sampled analog values of the SCL line.

    catrn

            t0

    cdbl

            dt

    c1du8

            Y

      cu8

    cerrcodeclst

            error

    The error cluster contains error or warning information.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

      cbool

              status

      The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

      The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

      ci32

              code

      The code number identifies the error or warning.

      The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

      cstr

              source

      The source string describes the origin of the error or warning.

      The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cfxdt

            attributes

cwdtint

SDA Waveform

Contains the sampled analog values of the SDA line.

    catrn

            t0

    cdbl

            dt

    c1du8

            Y

      cu8

    cerrcodeclst

            error

    The error cluster contains error or warning information.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

      cbool

              status

      The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

      The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

      ci32

              code

      The code number identifies the error or warning.

      The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

      cstr

              source

      The source string describes the origin of the error or warning.

      The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cfxdt

            attributes

cdotnetrefn

I2C Reference Out

I2C reference created with the "I2cOpen" VI.

cerrcodeclst

Error Out

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.


I2cConfig

I2cConfig.vi

This VI, which is part of telos' I2C.Labview API, can be used to configure the termination of SCL/SDA and the voltage level thresholds.

Connector Pane

Controls and Indicators

ci32

Termination SCL

Sets the termination of the SCL line.

ci32

Termination SDA

Sets the termination of the SDA line.

cu8

Low Level Threshold

Sets the low voltage level threshold.

cu8

High Level Threshold

Sets the high voltage level threshold.

cerrcodeclst

Error In (No Error)

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cdotnetrefn

I2C Reference In

I2C reference created with the "I2cOpen" VI.

cdotnetrefn

I2C Reference Out

I2C reference created with the "I2cOpen" VI.

cerrcodeclst

Error Out

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.


I2cFindBoards

I2cFindBoards.vi

This VI, which is part of telos' I2C.Labview API, can be used to get a list of the I2C boards, which are connected to the specified I2C scheduler. These boards can be opened using the I2cOpen VI.

Connector Pane

Controls and Indicators

cerrcodeclst

Error In (No Error)

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cstr

Network Address

Sets the network address of the I2C scheduler. To use the local I2C scheduler use "localhost".

cstr

Password

Sets the password of the I2C scheduler. To use the local I2C scheduler use "".

cu16

Network Port

Sets the network port of the I2C scheduler. To use the local I2C scheduler (with default configuation) use "3000".

ierrcodeclst

Error Out

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ibool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ii32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    istr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

i1di32

Board Types

This array contains the types of the found I2C boards. These values can be used for the I2cOpen VI.

    ii32

i1du16

Serial Numbers

This array contains the serial numbers of the found I2C boards. These values can be used for the I2cOpen VI.

    iu16


I2cTracer

I2cTracer.vi

This VI, which is part of telos' I2C.Labview API, can be used to enable/disable the I2C tracers on Tracii XL, Tracii XL 2.0, Tracii 400, Connii MM, and Connii MM 2.0. The traced I2C data can be obtained using the "I2cTracerData" VI.

Connector Pane

Controls and Indicators

cdotnetrefn

I2C Reference In

I2C reference create with the "I2cOpen" VI.

cerrcodeclst

Error In (No Error)

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cbool

Enable

Enables or disables the I2C tracer.

cerrcodeclst

Error Out

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cdotnetrefn

I2C Reference Out

I2C reference create with the "I2cOpen" VI.


I2cTracerData

I2cTracerData.vi

This VI, which is part of telos' I2C.Labview API, can be used to obtain the messages traced on an I2C bus. The tracing of I2C messages can be enabled/disabled using the "I2cTracer" VI.

Connector Pane

Controls and Indicators

cdotnetrefn

I2C Reference In

I2C reference create with the "I2cOpen" VI.

cerrcodeclst

Error In (No Error)

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

c2dstr

Trace Data In

The traced I2C data gets appended to this 2-dimensional string array.

    cstr

c2dstr

Trace Data Out

Contains the traced I2C data as a 2-dimensional string array. Each row contains one I2C submessage. The rows have got the following meaning: flags, message number, I2C address, data length, absolute start time, idle time, message time, and data.

    cstr

cdotnetrefn

I2C Reference Out

I2C reference create with the "I2cOpen" VI.

cerrcodeclst

Error Out

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.


I2cSlave

I2cSlave.vi

This VI, which is part of telos' I2C.Labview API, can be used to configure and enable/disable the emulated I2C slave.

Connector Pane

Controls and Indicators

cu16

I2C Address

The I2C address of the emulated I2C slave.The VI expects addresses in the 7 bit or 10 bit format as specified in the I2C standard. Valid addresses: 0..3, 8..119, 124..127 (7 bit); 0..1023 (10 bit).

Some data sheets of I2C devices are using a 8 bit representation. To convert a 8 bit address to a 7 bit representation shift the value of the address one bit to the right.

cbool

I2C Address (10 bit?)

This flag determines whether the "I2C Address" value specifies a 7 or 10 bit I2C slave address.

cerrcodeclst

Error In (No Error)

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cbool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ci32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    cstr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

cbool

Enabled

If this flag is "true", the VI will create a master transmitter transfer. If also the "Receiver Enabled" flag is "true", the VI will create a combined transfer.

cdotnetrefn

I2C Reference In

I2C reference create with the "I2cOpen" VI.

cu32

Memory Size

Configures the size of the emulated RAM (1..256). If auto increment has been enabled, the address pointer gets reset to zero after reaching the end of the memory.

cbool

Auto Increment

Enables/disables the auto increment feature. If auto increment is enabled, the address pointer of the RAM gets incremented automatically after reading or writing bytes.

ci32

Timeout [ms]

Configures the timeout in milliseconds. If the transfer of one byte takes longer than the specified time, the RAM goes back to idle mode. This can be useful, if the RAM misses e.g. a clock cycle in slave transmitter mode and would block SDA for infinity. The value "-1" disables the timeout.

ierrcodeclst

Error Out

The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ibool

            status

    The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    ii32

            code

    The code input identifies the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

    istr

            source

    The source string describes the origin of the error or warning.

    The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

idotnetrefn

I2C Reference Out

I2C reference create with the "I2cOpen" VI.