• 大小: 1.79M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-04-13
  • 语言: C/C++
  • 标签: sss  ss  yu  js  

资源简介

STM32三菱PLC源码原理图

资源截图

代码片段和文件信息



//excute privite Variable
unsigned short program_address;
unsigned short excute_flag;



void exe_read_command(void)
{

user_ladder.grp = program[program_address] & 0xf0;
user_ladder.order = program[program_address];
user_ladder.type = program[program_address + 3];
user_ladder.type = user_ladder.type >> 5;
user_ladder.dtype = program[program_address + 3] & 0x001f;
user_ladder.bit = program[program_address + 3] & 0x000f;

user_ladder.data = program[program_address + 2];
user_ladder.data = user_ladder.data << 8;
user_ladder.data |= program[program_address + 1];

program_address+=4;
}

unsigned short exe_read_bit(void)
{
unsigned short result;

if(memory[user_ladder.data] & (1<< user_ladder.bit) ) result = 0xff;
else result = 0x00;

return result;


unsigned short exe_read_short(void)
{
unsigned short result;
if(user_ladder.dtype == 0x1f)
  result = user_ladder.data;
else
  result = memory[user_ladder.data];

return result;
}

unsigned long exe_read_long(void)
{
unsigned long resultn;
unsigned long *lptr;
if(user_ladder.dtype == 0x1f)
{
  n = user_ladder.data;
  exe_read_command();
  result = user_ladder.data;
  result = result << 16;
  result |= n;
}
else
{
  lptr = (unsigned long *)(memory + user_ladder.data);
  result = *lptr;
}
return result;
}

#include “ladder_command.c“

/******************************************************************************
*用户程序执行函数解释梯形图的内循环函数
* 目前为空!
*******************************************************************************/
void program_excute(void)
{
program_address = 0x100;
excute_flag  = 0;


while((program_address < 8000) && (excute_flag == 0))
  {
  if(program_address >= 8000)  excute_flag = 0xff;
  exe_read_command();

  switch(user_ladder.grp)
   {
   case(0x00):
   //--------------------------------------------------
   switch(user_ladder.order)
   {
   case(0x00):
                          ladder_nop();
   break;
   case(0x01):
                          ladder_ld();
   break;
   case(0x02):
                          ladder_ldi();
   break;
   case(0x03):
                          ladder_ldp();
   break;
   case(0x04):
                          ladder_ldf();
   break;
   case(0x05):
                          ladder_and();
   break;
   case(0x06):
                          ladder_ani();
   break;
   case(0x07):
                          ladder_andp();
   break;
   case(0x08):
                          ladder_andf();
   break;
   case(0x09):
                          ladder_or();
   break;
   case(0x0a):
                          ladder_ori();
   break;
   case(0x0b):
                          ladder_orp();
   break;
   case(0x0c):
                          ladder_orf();
   break;
   case(0x0d):
                          ladder_anb();
   break;
   case(0x0e):
                          ladder_o

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2225  2013-12-21 23:46  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\cortexm3_macro.h

     文件      10277  2013-12-21 23:46  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\cortexm3_macro.s

     文件      30304  2013-12-21 23:46  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Exe\GC.bin

     文件      85281  2013-12-21 23:46  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Exe\GC2.hex

     文件     318128  2013-12-21 23:46  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Exe\GC2.out

     文件      30347  2013-12-21 23:46  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Exe\GC2.sim

     文件      29447  2013-12-21 23:46  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Exe\GC2.sim._1

     文件    1139251  2013-12-21 23:46  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\List\GC2.log

     文件     851337  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\GC.pbd

     文件     851337  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\GC.pbd.browse

     文件     665835  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\main.pbi

     文件      10024  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\main.pbi.cout

     文件     117715  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_adc.pbi

     文件      10045  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_adc.pbi.cout

     文件      77750  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_bkp.pbi

     文件      10045  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_bkp.pbi.cout

     文件      91031  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_dma.pbi

     文件      10045  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_dma.pbi.cout

     文件      87611  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_flash.pbi

     文件      10047  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_flash.pbi.cout

     文件      94575  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_gpio.pbi

     文件      10046  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_gpio.pbi.cout

     文件     108774  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_i2c.pbi

     文件      10045  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_i2c.pbi.cout

     文件     193962  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_lib.pbi

     文件      10045  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_lib.pbi.cout

     文件      82342  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_nvic.pbi

     文件      10046  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_nvic.pbi.cout

     文件      76128  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_pwr.pbi

     文件      10045  2018-08-08 13:59  STM001-STM32F103RBT6PLC源码说明书原图\Software6.13\Debug\Obj\stm32f10x_pwr.pbi.cout

............此处省略147个文件信息

评论

共有 条评论