Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: ryanastiefes on November 12, 2020, 04:42:51 PM
-
Been having some issues with a certain brand of device over modbus RTU rs485, so I figure I would try to change some of the com port settings real time using DEVWRITE and DEVREAD to see if that fixed the problem and in doing so I think I ran into a bug or I am using the instruction wrong. When writing to the comm port using DEVWRITE I see the changes populating in my DEVREAD but when I go into the comm port static settings the changes did not take place?? I tried stopping the controller and starting it back up, but that did not fix the issue. Any thoughts?
As for the comm. problem it still lingers no weird actions it'll work for weeks and than out of nowhere the device just stops communicating, to get the device communicating again I have to cycle it's power. Attached is the code if anyone would like to make some suggestions on it and also the bug.
SG Communication.S0
MRX @Rotork_Comm 0 0 5 3 1 5 V100 0x0 0 0x101 Communication.S1 Communication.S4 DST511
SG Communication.S1
TMR T4 2000
RST C2
STR T4.Done
JMP Communication.S2
SG Communication.S2
MWX @Rotork_Comm 0 0 5 6 7 1 V105 0x0 0 0x101 Communication.S3 Communication.S5 DST511
SG Communication.S3
TMR T24 2000
RST C3
STR T24.Done
JMP Communication.S0
SG Communication.S4
TMR T28 2000
SET C2
STR T28.Done
JMP Communication.S2
SG Communication.S5
TMR T29 2000
SET C3
STR T29.Done
JMP Communication.S0
#BEGIN MEM_CONFIG
Communication PROGRAM 0 -1
#END
#BEGIN ELEMENT_DOC
"V100","ACT1_WRDtoBITS","",""
"C2","ACT_Rx_Alarm","",""
"C3","ACT_Wx_Alarm","",""
"V105","ACT1_DsrdPos","","0-1000"
#END
-
DEVWRITE does NOT modify the static System Configuration. The SysConfig is in FLASH ROM. At power-up or after Write to PLC, the PLC makes a COPY of it and uses THAT one while running. Hence, DEVWRITE tweaks the RAM copy, but the FLASH copy NEVER changes (unless you overwrite it with another project via Write to PLC)
-
Sounds good to me. The only reason I asked was due to the documentation attached, unless I'm reading that wrong to. I am not going to argue with free software just happy you guys answer our questions.
-
Sounds good to me. The only reason I asked was due to the documentation attached, unless I'm reading that wrong to. I am not going to argue with free software just happy you guys answer our questions.
Yeah, that phrase "at runtime" implies a lot there. It's not just that you can do it AT runtime, but that you are modifying the RUNTIME copy. We'll look at clearing that up.