广州大彩串口屏论坛_大彩开发者交流论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 564|回复: 2

Screen as Modbus slave, how to get access to register via LUA

[复制链接]

20

主题

53

帖子

268

积分

中级会员

Rank: 3Rank: 3

积分
268
发表于 2024-10-16 22:52:57 | 显示全部楼层 |阅读模式
Like in topic,
1. I need to create variable in VisualStudio only or I can made some struct from LUA level?
2. Mainly I need to operate at this variable from lua
回复

使用道具 举报

0

主题

389

帖子

1124

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1124
发表于 2024-10-17 11:08:31 | 显示全部楼层
1. Hello, as you said, after creating a variable in VisualStudio, it can be directly bound to the control, or you can use the logical processing in the protocol and variable to automatically handle the relationship between the variable and the control. To do so, you can refer to the Configuring Controls tutorial in the online documentation at https://doc.gz-dc.com/Modbus/Ctrls/01_Mb_basic.html
2. If you need to operate on the created variables in lua, you need to understand the API interface functions of lua, and use get_variant (name) to get the numeric value of the protocol variable. name: variable name. Use set_variant (name, value) to set the value of the protocol variable. Alternatively, you can use the encapsulated MB function to read and write the modbus registers directly. The website address is: https://doc.gz-dc.com/LUA/000_lu ... E%E8%AE%BF%E9%97%AE
Attached is a screenshot of the function:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

25

主题

119

帖子

763

积分

高级会员

Rank: 4

积分
763
QQ
发表于 2024-10-17 21:07:56 | 显示全部楼层
Sorry, my friend, I can't help you because I can't read English, but I sincerely wish you an early solution.
欢迎加入大彩爱好者QQ群:14769485
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|广州大彩串口屏论坛_大彩开发者交流论坛

GMT+8, 2024-11-24 10:12 , Processed in 0.069779 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表