This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS320F28388D:Modbus TCP/IP

Guru**** 2225540 points
Other Parts Discussed in Thread: TMS320F28388D, C2000WARE
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1001069/tms320f28388d-modbus-tcp-ip

器件型号:TMS320F28388D
主题中讨论的其他器件: C2000WARE

您好!

是否有人可以为 TMS320F28388D 的 Modbus TCP/IP 提供示例项目? 这是为了将 TMS320F28388D 与 PLC 通信

谢谢你。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    由于接下来的三天是 TI 印度节假日、因此请预计会有一些延迟。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我们没有您正在寻找的确切示例、但也有类似的示例。 有一个基于 lwip TCP/IP 堆栈的 Web 服务器示例、但在以太网上。

    您可以在此处找到该项目 \libraries\communications\ethernet/third_party/lwip\examples\enet_lwip\cm\、然后 按照工程中 readme.txt 中的步骤开始使用。  

    有一个接口层 f2838xif.c、用于将网络堆栈与以太网 IP 连接。 您可能需要查看此内容并尝试根据 Modbus 要求进行更新。

    此致、

    Yashwant

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    感谢您的回复。 我能够使用 lwIP 示例在控制卡和 PC 之间建立通信、它既适用于网络服务器、也适用于从 PC ping。 您能告诉我吗、我能不能通过修改  f2838xif.c 文件来与 PLC 通信、或者我还需要做任何其他更改?

    此致、

    Dushan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    通过简单的网络搜索、可以得到以下使用 socket (4)并使用 lwIP 协议栈 https://www.programrsought.com/article/59761635631/的 Modbus TCP 应用示例

    您可能需要对此进行研究。

    此致、

    Yashwant

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    感谢您的回复。 我尝试在 enet_lwip 示例中启用套接字、但显示错误

    平路机、

    Dushan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    查找现有 e2e 是否存在类似错误。 如果它们是链接器 cmd 错误、请尝试为所需的段分配更多内存。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我找不到任何有关使用 lwip 的机具方式的 e2e 螺纹

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您能否粘贴错误的图像。

    -yashwant

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //*****************************************************************************
    //
    // lwipopts.h - Configuration file for lwIP
    //
    //*****************************************************************************
    //
    // NOTE: This file has been derived from the lwIP/src/include/lwip/opt.h
    // header file.
    //
    // For additional details, refer to the original "opt.h" file, and lwIP
    // documentation.
    //
    //*****************************************************************************
    #ifndef __LWIPOPTS_H__
    #define __LWIPOPTS_H__
    //*****************************************************************************
    //
    // ---------- Stellaris / lwIP Port Options ----------
    //
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    这是我的 lwipopts.h 文件

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    **** Build of configuration Flash for project enet_lwip ****
    "C:\\ti\\ccs1011\\ccs\\utils\\bin\\gmake" -k all
    Building file: "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/examples/enet_lwip/cm/enet_lwip.c"
    Invoking: ARM Compiler
    "C:/ti/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=none -me -O0 --opt_for_speed=0 --include_path="C:/ti/ti-cgt-arm_18.12.2.LTS/include" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps/http" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip" --include_path="C:/Users/Sahan Sanjaya/workspace_v10/enet_lwip" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/driverlib/f2838x" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/driverlib/f2838x/driverlib_cm" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/examples/enet_lwip/cm" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/driverlib/f2838x" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/include" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/ports/C2000/include" --define=_FLASH --define=ccs -g --diag_warning=225 --gen_func_subsections=on --abi=eabi --ual --preproc_with_compile --preproc_dependency="enet_lwip.d_raw" "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/examples/enet_lwip/cm/enet_lwip.c"
    "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/examples/enet_lwip/cm/enet_lwip.c", line 261: warning: variable "txChan" was declared but never referenced
    Finished building: "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/examples/enet_lwip/cm/enet_lwip.c"
    Building file: "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/ports/C2000/netif/f2838xif.c"
    Invoking: ARM Compiler
    "C:/ti/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=none -me -O0 --opt_for_speed=0 --include_path="C:/ti/ti-cgt-arm_18.12.2.LTS/include" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps/http" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip" --include_path="C:/Users/Sahan Sanjaya/workspace_v10/enet_lwip" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/driverlib/f2838x" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/driverlib/f2838x/driverlib_cm" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/examples/enet_lwip/cm" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/driverlib/f2838x" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/include" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/ports/C2000/include" --define=_FLASH --define=ccs -g --diag_warning=225 --gen_func_subsections=on --abi=eabi --ual --preproc_with_compile --preproc_dependency="f2838xif.d_raw" "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/ports/C2000/netif/f2838xif.c"
    Finished building: "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/ports/C2000/netif/f2838xif.c"
    Building file: "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps/http/fs.c"
    Invoking: ARM Compiler
    "C:/ti/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=none -me -O0 --opt_for_speed=0 --include_path="C:/ti/ti-cgt-arm_18.12.2.LTS/include" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps/http" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip" --include_path="C:/Users/Sahan Sanjaya/workspace_v10/enet_lwip" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/driverlib/f2838x" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/driverlib/f2838x/driverlib_cm" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/examples/enet_lwip/cm" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/driverlib/f2838x" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/include" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps" --include_path="C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/ports/C2000/include" --define=_FLASH --define=ccs -g --diag_warning=225 --gen_func_subsections=on --abi=eabi --ual --preproc_with_compile --preproc_dependency="fs.d_raw" "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps/http/fs.c"
    Finished building: "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps/http/fs.c"
    Building file: "C:/ti/C2000Ware_3_04_00_00_Software/libraries/communications/Ethernet/third_party/lwip/lwip-2.1.2/src/apps/http/httpd.c"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    然后我得到了这个

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    是否有人可以为该实现提供一个好的示例? 这是紧急情况。 请帮助。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大多数错误都是"隐式声明"的、这表明需要的 lwip 源文件、如 api_lib.c、不会添加到工程中来创建它们的符号。

    [引用 userid="457528" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1001069/tms320f28388d-modbus-tcp-ip/3709144 #3709144"]是否有人可以为该实现提供一个好的示例?

    我们恐怕您在 C2000Ware 中找不到您想要的示例。 您可以尝试一些开源网站或论坛。

    -yashwant

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大多数错误来自 API_lib.c 您能建议一种纠正该错误的方法

    谢谢你

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我看到 sockets .c 和 tcpip_priv.h 中有很多 OS 依赖项、文件 开头处有#if!no_SYS、这是 API_lib.c 所必需的 我们尚未移植 lwIP 协议栈以与操作系统兼容。

    我们还有基于 TI NDK 堆栈的 TCP/IP 示例、该示例在 C2000Ware 中的 C2000Ware_3_04_00_00\libraries\communications\ethernet/ti\NDK\examples\tcpEchoF2838X 上展示了很少的 NDK 功能。

    即使这样、也没有 Modbus 堆栈。

    https://e2e.ti.com/support/legacy_forums/embedded/tirtos/f/ti-rtos-forum-read-only-archived/398818/pointers-to-implement-integrate-modbus-tcp-stack-for-tms320f28335/1411934#1411934

    此致、

    Yashwant