UniPi Neuron and Variable Retain, WiFi, Bluetooth
-
Hi,
I need to know if there are possibilities to:-
Enable some variables to be retainable and maintain their value in case of power outage
-
If is possible and how to use WiFi and/or bluetooth wireless connectivity
Thanks at all
-
-
Hi Mike,
This has been an on-going topic for CODESYS on the Raspberry Pi. The Raspberry Pi does not have non-volatile RAM, and so the built in PERSISTENT and RETAIN variables within IEC61131 do not function. The neatest solution I have seen is discussed in this forum posthttps://forum.codesys.com/viewtopic.php?t=5722 where 3S have provided some sample code that can write retain variables to a file on demand and then restore at power up.
Be careful about writing too frequently to the SDCard as you increase the chance of file system corruption if the power is interrupted whilst writing.
Regarding wifi, CODESYS relays on the underlying Raspbian configuration. So yes you can enable WiFi and it will work. There is a discussion on how to do this on the UniPi forum https://forum.unipi.technology/topic/438/wifi-instead-nic-mervis the process is the same.
I have no experience of using Bluetooth with CODESYS. I suggest contacting 3S or using the CODESYS forum.
regards David