Page 1 of 1

Logi.Cad 3

Posted: 30 Jan 2017, 09:14
by rafa
Hello,
I'm a classic plc programmer and now I'm testing RevPi & Logi.Cals 3.
how I can store some values in the memory area, that don't lose it these values after cold start or reboot the device, like a memory table of standard plc?

Thanks.
Rafa.

Re: Logi.Cad 3

Posted: 30 Jan 2017, 10:02
by Mathias
Hi Rafa,

I am sorry, but permanent variables, that keep their values even if you turn the system off and on again, are not supported at the moment.

We plan a real hw solution for that, but I can't tell when it will be available.

One solution would be to write the data a file from time to time. But there you will have to handle the problem, that data written to a file shortly before the system is turned off will usually get lost. You should have older versions of the file as fallback.

Mathias

Re: Logi.Cad 3

Posted: 30 Jan 2017, 10:30
by rafa
Thanks for your comments.
Can I save the values with Logi.cad 3 to a mySql database or similar using for example html-json and retrieve them?

Rafa.

Re: Logi.Cad 3

Posted: 03 Feb 2017, 12:10
by dirk
Hi Rafa,
maybe you should give https://www.sqlite.org/ a try. It supports atomic operations and is more lightweight compared to a mysql server.

Re: Logi.Cad 3

Posted: 10 Feb 2017, 09:39
by rafa
Thanks Dirk.
SQLite works fine in a c-block and now I can insert data into a database.
Exists a library for accessing DIOs or variables defined in LogiCad 3 through php to display them on a web page?

Rafa.

Re: Logi.Cad 3

Posted: 10 Feb 2017, 10:42
by volker
interesting discussion...
Please note that if you use the RevPi Core eMMC for a data base: eMMC as any flash device has a limited number of erase/write cycles and thus is not intended for continuous high rate data logging! You should push data up into the cloud or to a server to permanently store and retrieve it. Or use a traditional hard disk drive via USB if you need to have this local.

Re: Logi.Cad 3

Posted: 10 Feb 2017, 11:51
by dirk
What Volker mentioned is an important fact which I forgot.
If you dont need historical data, you can move your database file to /tmp which is in memory.
Then you have to recreate it on startup i.e. by copying it form a permanent storage.
Exists a library for accessing DIOs or variables defined in LogiCad 3 through php to display them on a web page?
I have no details about the possibilities of LogiCad 3. Maybe the LogiCals support can answer this.

But the DIOs are accessible via the names defined in PiCtory.
There is example code in C and Python available in the download section to show how to do this.

For atomic access to the process image we recommend using the IOCTLs of the piControl driver.
So you should be able to find the variable by using one of the IOCTLs. But as mentioned here
https://bugs.php.net/bug.php?id=59336
IOCTLs will not be natively implemented in PHP at the moment. Therefore in PHP you should
call i.e. a python script which performs the IOCTLs and acts as a data provider.

Re: Logi.Cad 3

Posted: 20 Feb 2017, 09:51
by rafa
Is possible the Logi.Rts webserver installation in the RevPi Device?

Re: Logi.Cad 3

Posted: 20 Feb 2017, 13:03
by Mathias
Hi rafa,

I am not sure what you mean.

The logiRTS ist already installed, but there is no web server from logicals as far as I know.

Mathias

Re: Logi.Cad 3

Posted: 20 Feb 2017, 17:19
by juergen
dirk wrote:What Volker mentioned is an important fact which I forgot.
If you dont need historical data, you can move your database file to /tmp which is in memory.
Then you have to recreate it on startup i.e. by copying it form a permanent storage.
Exists a library for accessing DIOs or variables defined in LogiCad 3 through php to display them on a web page?
I have no details about the possibilities of LogiCad 3. Maybe the LogiCals support can answer this.

But the DIOs are accessible via the names defined in PiCtory.
There is example code in C and Python available in the download section to show how to do this.

For atomic access to the process image we recommend using the IOCTLs of the piControl driver.
So you should be able to find the variable by using one of the IOCTLs. But as mentioned here
https://bugs.php.net/bug.php?id=59336
IOCTLs will not be natively implemented in PHP at the moment. Therefore in PHP you should
call i.e. a python script which performs the IOCTLs and acts as a data provider.
at the moment it is not possible to share the variables through php.
What do you think about MQTT?