I am trying to use the structured text to collect temperature from DS18B20 sensor. Hoping the sensor information could be shown on the Factory IO (Modbus Slave 1) display.
Physically, i wired the sensor to UNO (Modbus Slave 2) pin 12.
On the OpenPLC Editor, I used the library DS18B20 to program the code.
I do a simulation before putting back to the Raspberry Pi (Modbus master). The code compile without problem, the simulation result is satisfactory.
However, when i upload the compiled program to the openplc runtime, there are weird errors. Please refer to the picture below.
I am not sure why this happens.
Firstly, I am not sure if it is my coding problem. I have attached the st file compiled by OpenPLC Editor for your comment please.
Secondly, I am not sure if it is my OpenPLC Editor problem. So, I check for any updates on OpenPLC Editor, and I updated to the latest version (just now). I run the same code again in the OpenPLC Editor , no problem in the simulation and the compilation process in OpenPLC Editor.
Moreover, I am not sure if it is my OpenPLC runtime problem. I try to see if there is any OpenPLC runtime updates, but seems that no update available.
Finally, I am not sure if it is my UNO problem, but i tried to setup the UNO using the General Modbus RTU Device, instead of the original template. Is there anything I have to enable in the OpenPLC Editor to allow UNO to be used as Slave of Raspberry Pi? I have previously followed your tutorial number 5
https://youtu.be/dQ8GcfpGDuA?si=_WcjxXNW-ChoaL1M and successfully turn on light wired to UNO with the Raspberry Pi button, so I guess the UNO is working normally.
However, I then upload the st file Raspberry Pi again, and the compilation in the OpenPLC runtime shows error.
I am sorry for very long message but hope to solve it and understand the issue.