Application For N-Port Module - ICP DAS USA LinPAC AM335 Series User Manual

Hide thumbs Also See for LinPAC AM335 Series:
Table of Contents

Advertisement

7.1.1. Application for N-Port Module

The
i7kdio_8114.c
demo program illustrates how to use an I-8114W module that is inserted into
an LP-8x21 embedded controller. In this demo program, the I-7044 module (8 DO and 4 DI
channels) is controlled through the second serial port on the I-8114W module that is inserted into
the slot 2 on the LP-8x21, which, in turn, is connected to an RS-485 network. The address of the
I-7044 module is 02 and the baud rate is 115200 bps. Figure 7.1.1-1 provides an illustration of the
control diagram.
The result of executing this demo program is that the state of the DO channels can be controlled,
and the program returns the state of the DI channels. The source code for the demo program is as
follows:
#include<stdio.h>
#include<stdlib.h>
#include "msw.h"
char szSend[80], szReceive[80], ans;
WORD wBuf[12];
float fBuf[12];
int main()
{
int wRetVal, j=0;
char i[10];
AM335X-PAC Series User Manual
Copyright © 2021 ICP DAS Co., Ltd. All Rights Reserved.
Figure 7.1.1-1. Connection diagram of the device
version 2.0.4
Page: 118
E-mail: service@icpdas.com

Advertisement

Table of Contents
loading

Table of Contents