It's your place to connect with experts and peers, get continuous support, and share knowledge.
This forum is for all Modicon users to share knowledge and best practices, submit and discuss ideas for product evolutions and innovation, ask questions and provide answers on the scope of Modicon PAC offers and ecosystem along the whole lifecycle: Modicon M580, Modicon M340, EcoStruxure Control Expert (Unity Pro), EcoStruxure Process Expert, integration with Aveva Software.
You can subscribe to this forum after you log in or create your free account..
Posted: 2021-12-15 03:32 PM
I have couple programs running with communication from M172 to the TM172DCLWTH HMI, i can easily access the plc "status variables" from the HMI to show statuses on the screen.
Now the idea is to use the internal temperature sensor of that TM172 HMI, i know the variable in the display where the temperature value gets written into but i am not able to use that temperature variable in my PLC program.
I just cannot drag and drop the variable from the "HMI Vars and Parameters" window in my ST programming window.
When I type that variable in my program then I will get an error when I compile the program.
Is there a way to have access the HMI variables in the M172 controller and if yes how can I achieve that?
Thanks alot in advance.
Posted: 2021-12-27 07:31 AM
I guess you are using the TM172 Display as modbus master of the M172 PLC.
If this is the case, I suggest you define a R/W Status Var on M172 PLC and write on it periodically from the PLC of the TM172 Display the value of the temperature sensor.
TM172 Display has target blocks which allows to write modbus messages from the Programming section.
Posted: 2021-12-27 02:53 PM
Hi @FedericoM ,
thank you for your respond.
yes the TM172 is connected via mod is master.
i cannot access target variables in the plc from the display. I can use the target variables in the display editor but that doesn’t work.
i need to somehow write the temp variable from the plc in to the plc.
can you make an example please what you mean?
Your help is very appreciated.
Posted: 2021-12-27 11:52 PM
try to check the examples and powerpoints available at this link:
In the Fan Coil control example, in the Programming part of the TM172DCL project you can find a small program which writes some data from TM172DCL to M172.
At this link:
you can find a full project of TM172DCL used as thermostat, in this case TM172DCL is a modbus slave. It means you have to implement modbus master on M172 and read/write what you need from TM172DCL.
If you prefer a solution like this one (it allows to connect several M172DCL to a M172), check also the manual with the table of all the available modbus registers on the thermostat.
Posted: 2022-01-02 11:23 PM
How is you configuration? You use a TM172P as controller and a TM172DCL as HMI?
If yes is the HMI Modbus RTU server or client?
If the HMI is server you could find the temperature on Modbus register 8208
If the HMI is client you need to write the value manualy down to the TM172P via target block sysMbMRTU_FC6.
Posted: 2022-01-03 02:17 PM
Yes i have have a TM172DCL connected to a TM172 via Modbus Master.
Can you make a example how I could read that Modbus register 8208?
I got thrown in the cold water and need to make it work. (Wurde ins kalte Wasser geschmissen)
Your help is very much appreciated.
Posted: 2022-01-03 10:43 PM
In that case you need to define on the TM172P a Status Variable which is set to read and write ability(Default) like explained from @FedericoM before.
After that you need to create a Programm which is aligned to the background task in the programming tab.
In this programm you need to use the Target block sysMbMRTU_FC6.
You could see here an example
The functionblock need as input the follow information
|addr||Modbus RTU address of the slave controller (a.e. 1 )|
|base||Modbus register address were you want to send your data|
|object||The value which you want to write|
|polling time||Polling time in [ms]|
|timeout||Timeout in [ms]|
|waitBeforeSend||time in [ms]to wait before send|
You could find this information also in the FB description.
Posted: 2022-01-17 11:53 AM
thank you for your help, i made it work.
I had to create a poll timing routine else the HMI would have a to low response time and was nearly impossible to operate it.
Now I can read the HMI's internal Temperature and Humidity sensor.
Really appreciated all your help and thank you for being so supported, the world need more people like you.