AM335X-PAC Series User Manual version 2.0.1 Page: 113
Copyright © 2019 ICP DAS Co., Ltd. All Rights Reserved. E-mail: [email protected]
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.
Figure 7.1.1-1.
Connection diagram of the device
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;