/* Include files */
#include <stddef.h>
#include "blas.h"
#include "alldpll_sfun.h"
#include "c2_alldpll.h"
#define CHARTINSTANCE_CHARTNUMBER (chartInstance->chartNumber)
#define CHARTINSTANCE_INSTANCENUMBER (chartInstance->instanceNumber)
#include "alldpll_sfun_debug_macros.h"
#define _SF_MEX_LISTEN_FOR_CTRL_C(S) sf_mex_listen_for_ctrl_c(sfGlobalDebugInstanceStruct,S);
/* Type Definitions */
/* Named Constants */
#define c2_event_ref (0)
#define c2_event_var (1)
#define CALL_EVENT (-1)
#define c2_IN_NO_ACTIVE_CHILD ((uint8_T)0U)
#define c2_IN_Ahead ((uint8_T)1U)
#define c2_IN_Behind ((uint8_T)2U)
#define c2_IN_InPhase ((uint8_T)3U)
/* Variable Declarations */
/* Variable Definitions */
static real_T _sfTime_;
/* Function Declarations */
static void initialize_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance);
static void initialize_params_c2_alldpll(SFc2_alldpllInstanceStruct
*chartInstance);
static void enable_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance);
static void disable_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance);
static void c2_update_debugger_state_c2_alldpll(SFc2_alldpllInstanceStruct
*chartInstance);
static const mxArray *get_sim_state_c2_alldpll(SFc2_alldpllInstanceStruct
*chartInstance);
static void set_sim_state_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance,
const mxArray *c2_st);
static void c2_set_sim_state_side_effects_c2_alldpll(SFc2_alldpllInstanceStruct *
chartInstance);
static void finalize_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance);
static void sf_gateway_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance);
static void c2_chartstep_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance);
static void initSimStructsc2_alldpll(SFc2_alldpllInstanceStruct *chartInstance);
static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T
c2_chartNumber, uint32_T c2_instanceNumber);
static const mxArray *c2_sf_marshallOut(void *chartInstanceVoid, void *c2_inData);
static int8_T c2_emlrt_marshallIn(SFc2_alldpllInstanceStruct *chartInstance,
const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId);
static void c2_sf_marshallIn(void *chartInstanceVoid, const mxArray
*c2_mxArrayInData, const char_T *c2_varName, void *c2_outData);
static const mxArray *c2_b_sf_marshallOut(void *chartInstanceVoid, void
*c2_inData);
static int32_T c2_b_emlrt_marshallIn(SFc2_alldpllInstanceStruct *chartInstance,
const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId);
static void c2_b_sf_marshallIn(void *chartInstanceVoid, const mxArray
*c2_mxArrayInData, const char_T *c2_varName, void *c2_outData);
static const mxArray *c2_c_sf_marshallOut(void *chartInstanceVoid, void
*c2_inData);
static uint8_T c2_c_emlrt_marshallIn(SFc2_alldpllInstanceStruct *chartInstance,
const mxArray *c2_b_tp_Ahead, const char_T *c2_identifier);
static uint8_T c2_d_emlrt_marshallIn(SFc2_alldpllInstanceStruct *chartInstance,
const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId);
static void c2_c_sf_marshallIn(void *chartInstanceVoid, const mxArray
*c2_mxArrayInData, const char_T *c2_varName, void *c2_outData);
static const mxArray *c2_d_sf_marshallOut(void *chartInstanceVoid, void
*c2_inData);
static real_T c2_e_emlrt_marshallIn(SFc2_alldpllInstanceStruct *chartInstance,
const mxArray *c2_s, const char_T *c2_identifier);
static real_T c2_f_emlrt_marshallIn(SFc2_alldpllInstanceStruct *chartInstance,
const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId);
static void c2_d_sf_marshallIn(void *chartInstanceVoid, const mxArray
*c2_mxArrayInData, const char_T *c2_varName, void *c2_outData);
static const mxArray *c2_g_emlrt_marshallIn(SFc2_alldpllInstanceStruct
*chartInstance, const mxArray *c2_b_setSimStateSideEffectsInfo, const char_T
*c2_identifier);
static const mxArray *c2_h_emlrt_marshallIn(SFc2_alldpllInstanceStruct
*chartInstance, const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId);
static void init_dsm_address_info(SFc2_alldpllInstanceStruct *chartInstance);
/* Function Definitions */
static void initialize_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance)
{
real_T *c2_s;
c2_s = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
_sfTime_ = sf_get_time(chartInstance->S);
chartInstance->c2_doSetSimStateSideEffects = 0U;
chartInstance->c2_setSimStateSideEffectsInfo = NULL;
chartInstance->c2_tp_Ahead = 0U;
chartInstance->c2_tp_Behind = 0U;
chartInstance->c2_tp_InPhase = 0U;
chartInstance->c2_is_active_c2_alldpll = 0U;
chartInstance->c2_is_c2_alldpll = c2_IN_NO_ACTIVE_CHILD;
if (!(sf_get_output_port_reusable(chartInstance->S, 1) != 0)) {
*c2_s = 0.0;
}
}
static void initialize_params_c2_alldpll(SFc2_alldpllInstanceStruct
*chartInstance)
{
(void)chartInstance;
}
static void enable_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance)
{
_sfTime_ = sf_get_time(chartInstance->S);
}
static void disable_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance)
{
_sfTime_ = sf_get_time(chartInstance->S);
}
static void c2_update_debugger_state_c2_alldpll(SFc2_alldpllInstanceStruct
*chartInstance)
{
uint32_T c2_prevAniVal;
c2_prevAniVal = _SFD_GET_ANIMATION();
_SFD_SET_ANIMATION(0U);
_SFD_SET_HONOR_BREAKPOINTS(0U);
if (chartInstance->c2_is_active_c2_alldpll == 1U) {
_SFD_CC_CALL(CHART_ACTIVE_TAG, 0U, chartInstance->c2_sfEvent);
}
if (chartInstance->c2_is_c2_alldpll == c2_IN_Ahead) {
_SFD_CS_CALL(STATE_ACTIVE_TAG, 0U, chartInstance->c2_sfEvent);
} else {
_SFD_CS_CALL(STATE_INACTIVE_TAG, 0U, chartInstance->c2_sfEvent);
}
if (chartInstance->c2_is_c2_alldpll == c2_IN_InPhase) {
_SFD_CS_CALL(STATE_ACTIVE_TAG, 2U, chartInstance->c2_sfEvent);
} else {
_SFD_CS_CALL(STATE_INACTIVE_TAG, 2U, chartInstance->c2_sfEvent);
}
if (chartInstance->c2_is_c2_alldpll == c2_IN_Behind) {
_SFD_CS_CALL(STATE_ACTIVE_TAG, 1U, chartInstance->c2_sfEvent);
} else {
_SFD_CS_CALL(STATE_INACTIVE_TAG, 1U, chartInstance->c2_sfEvent);
}
_SFD_SET_ANIMATION(c2_prevAniVal);
_SFD_SET_HONOR_BREAKPOINTS(1U);
_SFD_ANIMATE();
}
static const mxArray *get_sim_state_c2_alldpll(SFc2_alldpllInstanceStruct
*chartInstance)
{
const mxArray *c2_st;
const mxArray *c2_y = NULL;
real_T c2_hoistedGlobal;
real_T c2_u;
const mxArray *c2_b_y = NULL;
uint8_T c2_b_hoistedGlobal;
uint8_T c2_b_u;
const mxArray *c2_c_y = NULL;
uint8_T c2_c_hoistedGlobal;
uint8_T c2_c_u;
const mxArray *c2_d_y = NULL;
real_T *c2_s;
c2_s = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
c2_st = NULL;
c2_st = NULL;
c2_y = NULL;
sf_mex_assign(&c2_y, sf_mex_createcellmatrix(3, 1), false);
c2_hoistedGlobal = *c2_s;
c2_u = c2_hoistedGlobal;
c2_b_y = NULL;
sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_u, 0, 0U, 0U, 0U, 0), false);
sf_mex_setcell(c2_y, 0, c2_b_y);
c2_b_hoistedGlobal = chartInstance->c2_is_active_c2_alldpll;
c2_b_u = c2_b_hoistedGlobal;
c2_c_y = NULL;
sf_mex_assign(&c2_c_y, sf_mex_create("y", &c2_b_u, 3, 0U, 0U, 0U, 0), false);
sf_mex_setcell(c2_y, 1, c2_c_y);
c2_c_hoistedGlobal = chartInstance->c2_is_c2_alldpll;
c2_c_u = c2_c_hoistedGlobal;
c2_d_y = NULL;
sf_mex_assign(&c2_d_y, sf_mex_create("y", &c2_c_u, 3, 0U, 0U, 0U, 0), false);
sf_mex_setcell(c2_y, 2, c2_d_y);
sf_mex_assign(&c2_st, c2_y, false);
return c2_st;
}
static void set_sim_state_c2_alldpll(SFc2_alldpllInstanceStruct *chartInstance,
const mxArray *c2_st)
{
const mxArray *c2_u;
real_T *c2_s;
c2_s = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
c2_u = sf_mex_dup(c2_st);
*c2_s = c2_e_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c2_u, 0)),
"s");
没有合适的资源?快使用搜索试试~ 我知道了~
【电路仿真】基于simulink全数字锁相环设计【含Matlab源码 340期】.zip
共25个文件
h:5个
obj:4个
c:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 192 浏览量
2024-06-21
12:03:41
上传
评论
收藏 197KB ZIP 举报
温馨提示
Matlab领域上传的全部代码均可运行,亲测可用,尽我所能,为你服务; 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,可私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、物理应用 仿真:导航、地震、电磁、电路、电能、机械、工业控制、水位控制、直流电机、平面电磁波、管道瞬变流、刚度计算 光学:光栅、杨氏双缝、单缝、多缝、圆孔、矩孔衍射、夫琅禾费、干涉、拉盖尔高斯、光束、光波、涡旋 定位问题:chan、taylor、RSSI、music、卡尔曼滤波UWB 气动学:弹道、气体扩散、龙格库弹道 运动学:倒立摆、泊车 天体学:卫星轨道、姿态 船舶:控制、运动 电磁学:电场分布、电偶极子、永磁同步、变压器
资源推荐
资源详情
资源评论
收起资源包目录
【电路仿真】基于simulink全数字锁相环设计【含Matlab源码 340期】.zip (25个子文件)
【电路仿真】基于simulink全数字锁相环设计【含Matlab源码 340期】
alldpll.mdl 45KB
slprj
_sfprj
alldpll
_self
sfun
src
alldpll_sfun.lmk 2KB
alldpll_sfun.c 9KB
alldpll_sfun.lib 286B
c2_alldpll.c 41KB
sfun.map 191KB
lccstub.obj 742B
alldpll_sfun.def 47B
alldpll_sfun.h 1KB
alldpll_sfun.lmko 920B
alldpll_sfun.exp 47B
alldpll_sfun_registry.obj 60KB
alldpll_sfun_registry.c 8KB
multiword_types.h 4KB
alldpll_sfun.bat 86B
alldpll_sfun.obj 10KB
c2_alldpll.h 1KB
rtwtypeschksum.mat 1KB
rtwtypes.h 1KB
alldpll_sfun_debug_macros.h 25KB
c2_alldpll.obj 42KB
info
binfo.mat 1KB
仿真图.PNG 13KB
alldpll_sfun.mexw64 148KB
运行结果.PNG 39KB
共 25 条
- 1
资源评论
Matlab领域
- 粉丝: 3w+
- 资源: 3222
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功