smart700iev3 程序下载设置_博途软件中S7-1200项目程序的上载下载

142a0fa270f681b544b2cb7120ca2766.png

在前面的一篇文章中讲解了博途软件与S7-1200 PLC的通信连接,以及相关的设置,这也是非常重要非常关键的一个步骤,通信成功之后,我们才能将创建好的工程项目下载到S7-1200 PLC,从而可以进行程序的调试、监控诊断等功能。

那么今天就给大家讲解一下项目程序的上载与下载的内容。

下载功能

当博途软件与CPU通信成功之后,项目工程编译无错即可对项目进行下载了。下载程序可以通过三种方法进行。

1、通过工具栏的下载按钮进行下载程序。

2、通过菜单栏的“在线”选择下载。

3、通过站点“下载到设备”选择下载。


1、通过工具栏的下载按钮进行下载程序

我们点击工具栏中的“下载”按钮图标

4ab1465eb315079f0f1823789f575742.png

可以进行程序的下载。如果博途软件没有跟CPU通信连接成功的话,这时候去点击“下载”图标,是会弹出“扩展的下载到设备”对话框,需要设置好接口类型和接口,然后搜索设备,搜索到设备之后,再进行下载。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
// This code includes the buct_hal.h library #include "buct_hal.h" // Define two global volatile variables to keep track of button presses volatile int Button_Pressed_SW1, Button_Pressed_SW2; // Main function int main(void) { // Set pin modes for buttons and LEDs pinMode(GPIOF, 0, INPUT_PULLUP); pinMode(GPIOF, 4, INPUT_PULLUP); pinMode(GPIOF, 2, OUTPUT); pinMode(GPIOF, 1, OUTPUT); // Interrupt setup // Configure interrupts for both buttons GPIOF_IS = GPIOF_IS & ~(1 << 0) & ~(1 << 4); // Set the interrupt event to occur on both rising and falling edges GPIOF_IEV = GPIOF_IEV | (1 << 0) | (1 << 4); // Enable interrupts for both buttons GPIOF_IM = GPIOF_IM | (1 << 0) | (1 << 4); // Enable the interrupt globally SYS_EN0 = SYS_EN0 | (1 << 30); // Enable interrupts in the CPU enable_interrupts(); // Continuous loop to check for button presses while(1) { // Check if SW1 button was pressed if (Button_Pressed_SW1) { // Reset button pressed flag Button_Pressed_SW1 = 0; // Turn on the red LED redOn(); // Delay for a short period of time delay(1000000); // Turn off the red LED redOff(); } // Check if SW2 button was pressed if (Button_Pressed_SW2) { // Reset button pressed flag Button_Pressed_SW2 = 0; // Turn on the blue LED blueOn(); // Delay for a short period of time delay(1000000); // Turn off the blue LED blueOff(); } // Put the CPU to sleep until the next interrupt occurs asm(" wfi "); } // End of main function return 0; } // Interrupt handler for GPIOF void GPIOF_Handler(void) { // Check if SW1 button was pressed if (GPIOF_RIS & (1 << 0)) { // Set the button pressed flag Button_Pressed_SW2 = 1; // Clear the interrupt flag GPIOF_ICR = (1 << 0); } // Check if SW2 button was pressed if (GPIOF_RIS & (1 << 4)) { // Set the button pressed flag Button_Pressed_SW1 = 1; // Clear the interrupt flag GPIOF_ICR = (1 << 4); } } This code sets up interrupts for two buttons (SW1 and SW2) on GPIOF, and turns on/off LEDs based on the button presses. The main function continuously checks for button presses using a while loop, and puts the CPU to sleep until an interrupt occurs. The interrupt handler function (GPIOF_Handler) sets the appropriate button pressed flag and clears the interrupt flag. The code also uses the buct_hal.h library to configure pin modes and control the LEDs.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值