National Instruments AutoCode NI MATRIX User Manual

Page 32

Advertising
background image

Chapter 2

C Language Reference

© National Instruments Corporation

2-15

AutoCode Reference

Figure 2-2. Linking Handwritten UCBs with AutoCode Applications

Generate AutoCode Application

dsp .c

usr_dsp.c (Handwritten UCB using sa_user

.

c example)

compile
and link

File Name: usr_dsp.c

y (k) = -1/2*y(k-2) + 3* u(k) + u(k-2);

which leads to the State-Space realizati on:

x1(k+1) = x2(k)

x2(k+1) = -1/2* x1(k) - 1/ 2*u(k)

y(k) = x1(k) + 3*u (k)

Advertising