jypsilantis
I need to create a custom function block in C or Python, which can log values to, and read values from, a PostGres SQL database. Ideally, I would like to test logic using the debug capabilities and "onbioard" PLC which is accessible from the editor, but ultimately load the block onto a physical PLC (RPi would do).
 
Has anyone looked at this in the past? Alternatively, any guidance would be greatly appreciated.
 
One key consideration is the ability to load and link with the relevant Python or C libraries for interface with PostGres. I am not sure if the process for creating a custom function block (embedded C or via pragmas) would work here.
Reply 0 0
thiagoralves
I think the easiest way to do this would be using PSM. Otherwise you will have to not only add a new block on the editor, which is already complicated, but also modify the compilation of programs to link the C libraries you need.
Reply 0 0
jypsilantis
I think the easiest way to do this would be using PSM. Otherwise you will have to not only add a new block on the editor, which is already complicated, but also modify the compilation of programs to link the C libraries you need.
Hi Thiago, thank you for your prompt reply. I will try this - it does seem to be a much simpler approach than modifying the block library.
Reply 0 0
jypsilantis
One question: how can I access the webinterface for the simulator? I would like to try out the PostGres interface on the simulator if possible, rather than developing on an RPi etc at this time.
 
I cannot see a listening service that looks like a webinterface on the Ubuntu instance hosting the editor.
Reply 0 0
thiagoralves
There isn't any. The simulator is just a simulator, it is not a complete runtime. You will need the runtime to test your code. You can install the runtime on Windows and use it the same way you would use on the Pi.
Reply 0 0
Reply