?? data_save.c
字號:
/***********************************************************************************
* FILE:TYPEDEFS.H *
* TMS320LF2407A TEST BED CODE *
* ZHEJIANG TIANHUANG TECHNOLOGY INDUSTRIAL CO.,Ltd *
* 07/28/2006 Vesion 1.0 *
* Jzming *
***********************************************************************************/
#include "TYPEDEFS.H"
#include "F2407_c.H"
#include "CONSTANT.H"
#include "self_define.h"
#include <stdio.h>
#include <math.h>
/* ================================================================== */
void var_query_dram (void);
void var_set_dram(void);
int parameter_set_flag=0;
extern int n_feed;
extern int ia,ib;
extern int adc_vdc;
extern int temp_h,temp_l;
extern int n_ref,speed_kp,speed_ki;
extern int current_kp,current_ki;
/* ================================================================== */
void var_query_dram (void)
{
temp_h = (n_feed>>8) & 0xff;
asm(" out _temp_h,0f002h");
temp_l = (n_feed) & 0xff;
asm(" out _temp_l,0f001h");
temp_h = (ia >>8) & 0xff;
asm(" out _temp_h,0f004h");
temp_l = ia & 0xff;
asm(" out _temp_l,0f003h");
temp_h = ((ib) >>8) & 0xff;
asm(" out _temp_h,0f006h");
temp_l = (ib) & 0xff;
asm(" out _temp_l,0f005h");
temp_h =(adc_vdc >>8) & 0xff;
asm(" out _temp_h,0f008h");
temp_l = adc_vdc & 0xff;
asm(" out _temp_l,0f007h");
}
void var_set_dram(void)
{
asm(" in _temp_l,0f4ffh");
parameter_set_flag=temp_l&0xff;
if(parameter_set_flag!=0)
{
asm(" in _temp_h,0f502h");
asm(" in _temp_l,0f501h");
n_ref=temp_h<<8+temp_l;
asm(" in _temp_h,0f504h");
asm(" in _temp_l,0f503h");
speed_kp=temp_h<<8+temp_l;
asm(" in _temp_h,0f506h");
asm(" in _temp_l,0f505h");
speed_ki=temp_h<<8+temp_l;
asm(" in _temp_h,0f508h");
asm(" in _temp_l,0f507h");
current_kp=temp_h<<8+temp_l;
asm(" in _temp_h,0f50ah");
asm(" in _temp_l,0f509h");
current_ki=temp_h<<8+temp_l;
if(n_ref>6000)
n_ref=6000;
if(n_ref<-6000)
n_ref=-6000;
if(speed_kp<20)
speed_kp=20;
if(speed_kp>500)
speed_kp=500;
if(speed_ki<10)
speed_ki=10;
if(speed_ki>100)
speed_ki=100;
if(current_kp<2)
current_kp=2;
if(current_kp>50)
current_kp=50;
if(current_ki<1)
current_ki=1;
if(current_ki>10)
current_ki=10;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -