威纶通官方论坛

威纶通cMT X系列触摸屏外部变量如何转换为内部变量

[复制链接]
发表于 3 天前 | 显示全部楼层 |阅读模式
请教各位:1. 欧姆龙NJ系列PLC与威纶通cMT X系列触摸屏采用以太网通讯;2. 威纶通cMT X系列触摸屏与三菱E800系列变频器进行modbus通讯;3. 物料连接均以正常。请问:PLC中计算的频率值如何写入到变频器中?
发表于 3 天前 | 显示全部楼层
资料传输就行
 楼主| 发表于 前天 15:26 | 显示全部楼层

资料传输很不可靠,触摸屏更改一下重新下载,数据传输就断了,再下载的时候有数据传输又正常了。
用宏指令做一下数据转化就能实现。但是奇怪的是之前用三菱Q系列PLC就一切正常,现在另一个项目中用欧姆龙NJ系列PLC就不行,外部变量的数据无法转化过来。

以下这段宏指令运行OK;

macro_command main()
//Modbus 读取传递到PLC
short a=0
GetData(a, "MODBUS RTU (Adjustable)", 4x, 2#0, 1)
SetData(a, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 2204, 1)   //CH1 实际值传递到D2204

short b=0
GetData(b, "MODBUS RTU (Adjustable)", 4x, 2#1, 1)
SetData(b, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 2206, 1)   //CH2 实际值传递到D2206

short c=0
GetData(c, "MODBUS RTU (Adjustable)", 4x, 2#2, 1)
SetData(c, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 2208, 1)   //CH3 实际值传递到D2208

short d=0
GetData(d, "MODBUS RTU (Adjustable)", 4x, 2#3, 1)
SetData(d, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 2210, 1)   //CH4 实际值传递到D2210

short e=0
GetData(e, "MODBUS RTU (Adjustable)", 4x, 2#4, 1)
SetData(e, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 2212, 1)   //CH5 实际值传递到D2212

short f=0
GetData(f, "MODBUS RTU (Adjustable)", 4x, 2#5, 1)
SetData(f, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 2214, 1)   //CH6 实际值传递到D2214

short g=0
GetData(g, "MODBUS RTU (Adjustable)", 4x, 2#6, 1)
SetData(g, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 2216, 1)   //CH7 实际值传递到D2214

short h=0
GetData(h, "MODBUS RTU (Adjustable)", 4x, 2#7, 1)
SetData(h, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 2218, 1)   //CH8 实际值传递到D2218

// PLC设定地址传递到modbus
short a1=0
GetData(a1, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 1002, 1)
SetData(a1, "MODBUS RTU (Adjustable)", 4x, 2#8, 1)             //CH1 设定值传递到0008H

short b1=0
GetData(b1, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 1003, 1)
SetData(b1, "MODBUS RTU (Adjustable)", 4x, 2#9, 1)             //CH2 设定值传递到0009H

short c1=0
GetData(c1, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 1004, 1)
SetData(c1, "MODBUS RTU (Adjustable)", 4x, 2#10, 1)             //CH3 设定值传递到000AH

short d1=0
GetData(d1, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 1005, 1)
SetData(d1, "MODBUS RTU (Adjustable)", 4x, 2#11, 1)             //CH4 设定值传递到000BH

short e1=0
GetData(e1, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 1007, 1)
SetData(e1, "MODBUS RTU (Adjustable)", 4x, 2#12, 1)             //CH5 设定值传递到000CH

short f1=0
GetData(f1, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 1008, 1)
SetData(f1, "MODBUS RTU (Adjustable)", 4x, 2#13, 1)             //CH6 设定值传递到000DH

short g1=0
GetData(g1, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 1009, 1)
SetData(g1, "MODBUS RTU (Adjustable)", 4x, 2#14, 1)             //CH7 设定值传递到000EH

short h1=0
GetData(h1, "Mitsubishi MELSEC-Q/L - Binary Mode", D, 1010, 1)
SetData(h1, "MODBUS RTU (Adjustable)", 4x, 2#15, 1)             //CH8 设定值传递到000FH
您需要登录后才可以发帖 登录 | 注册

本版积分规则

回复帖子

Archiver|小黑屋|威纶通官网 ( 粤ICP备06054553号 )

GMT+8, 2025-3-12 19:48

Powered by Discuz! X3.4

© 2001-2023 Comsenz Inc.

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