Digital I/O Library
Slider_DigitalIO_API_color.jpg

Introduction

This digital I/O library defines a common interface for reading digital input states and setting digital outputs.


Including

The way how you include the library functions in your own windows program, depends on the compiler and on the programming language you use. In order to access the digital I/O API, you have to include the library labbCAN_DigIO_API.dll to your programming environment. You have to copy this file to the working directory of your system or to the application directory that contains your application EXE file. Use the calling convention LCDIO_CALL for this library. This convention is managing how the parameters are put on the stack and who is responsible to clean the stack after the function execution.

The interface of the library, constant definitions and declarations of the library functions, is defined in the header file interface/labbCAN_DigIO_API.h


Digital I/O API Usage

Retrieve device handle

To work with an digital I/O channel, you need a valid channel handle. A channel handle is simply an opaque pointer to the internal channel object created by the labbCAN environment. So the first thing you need do to is obtaining a valid digital I/O channel handle.

You can get a valid output channel handle with the function LCDIO_LookupOutChanByName() and a valid input channel handle with the function LCDIO_LookupInChanByName():

dev_hdl DigInHandle;
Result = LCDIO_LookupInChanByName("neMAXYS1_DigIN2", &DigInHandle);
dev_hdl DigOutHandle;
Result = LCDIO_LookupOutChanByName("neMAXYS1_DigOUT3", &DigOutHandle);
Note
You can get the channel names from the device configuration files (see Device Configuration Files). Simply search in the channel list for Lcl::CDigitalInChannel or Lcl::CDigitalOutChannel channels.
</ChannelList>
<Channel Name="neMAXYS1_DigIN4">
<Type>Lcl::CDigitalInChannel</Type>
<Device>neMAXYS1_YDigitalIn</Device>
<ChannelNo>12<!-- General purpose D --></ChannelNo>
</Channel>
<Channel Name="neMAXYS1_DigOUT1">
<Type>Lcl::CDigitalOutChannel</Type>
<Device>neMAXYS1_YDigitalOut</Device>
<ChannelNo>15<!-- General purpose A --></ChannelNo>
</Channel>
</ChannelList>

Reference

See the labbCAN Digital I/O API module for a detailed reference of all digital I/O control, status and configuration functions.


Programming Interface - API

See the labbCAN Digital I/O API module for a detailed reference of the Digital I/O library application programming interface