Mange
OK, so finally, my heat pump control is starting to emerge.
I want to start with a very simple program and only have 2 delays for a certain time, lets say 3 seconds, for start of compressor K, and after that a modbus command about which speed, KH, it shall have.
But I get stuck on the delay, I did someting wrong so the block for add time gives error.
Then I have no clew on how the blocks for TCP-connect and TCP-send shall be used for Modbus, (I have not found it at least)
Here is my program right now:
[203128%2F9060065%2Fmceclip0]
Reply 0 0
thiagoralves
ADD_TIME should take two TIME variables to add them together, outputting the sum on the OUT pin. It does not make any sense to connect a Boolean variable to any of its input pins. If you want to control when the addition should happen, then you must enable execution control on the ADD_TIME block and use the EN/ENO pins for that.
 
TCP blocks are used to send raw TCP packets, not for Modbus. Modbus is a protocol that is already implemented in the OpenPLC Runtime.
Reply 1 0
Mange
OK, in fact the modbus slaves I will use are serial and not TCP, so I will make a separate thread about that later when Im running Runtime on the PI.
What I want to do here is only a simple delay, is it not add time, I should to use? I added now execution control, but I dont understand how to connect it?
[203128%2F9060175%2Fmceclip0]
Reply 0 0
fg71
You need to set your OUT of block ADD_TIME
Reply 0 0
thiagoralves
For delays you need to use timers. Spend some time reading about IEC 61131-3 timers to get a better understanding on how they work. I always recommend Beckhoff docs, great documentation, very straightforward: https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclib_tc2_standard/74403595.html&id=
Reply 1 0
Mange
For delays you need to use timers. Spend some time reading about IEC 61131-3 timers to get a better understanding on how they work. I always recommend Beckhoff docs, great documentation, very straightforward: https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclib_tc2_standard/74403595.html&id=
Great, now it works! KH is now the BOOLean for send desired speed in some way by modbus. Will read up on how now.
[203128%2F9060279%2Fmceclip0]
Reply 0 0
thiagoralves
To understand how to attach Modbus slave devices, read this doc: https://autonomylogic.com/docs/2-6-slave-devices/
Reply 1 0
Mange
To understand how to attach Modbus slave devices, read this doc: https://autonomylogic.com/docs/2-6-slave-devices/
Thanks! I think I get it how to attach RTU slaves. My slave will need only analog in and out connections in order for the master to write and read holding registers in it.
I also think I got a hold on how the addressing should look like in my case.
 
But now Im stuck on how those should to look in the LD-logic in OpenPLC editor. Are they to be a variable, or a coil, or a connection?
The examples I have seen so far are only for coils, to drive a LED or so. Are there some examples I can learn from?
Reply 0 0
clintux
See attached for simple LD usage.
Reply 1 0
Reply