Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2018-01-30 22:38:44

mcarroll
Member
From: Australia
Registered: 2017-02-14
Posts: 18

SILO error help

Hi Tomas and Jaroslav!

I'm currently using the SILO block to read the output of a Python script - which is reading environmental monitoring sensors on the I2C bus. The readings are then archived and sent to a SQL database.

The issue I'm having is when the SILO block throws an error, which defaults to 0, it's mucking up my sensor values.  For example, when I want to monitor temperature over time, the odd 0 degree value really mucks up the data I'm trying to collect.

I'm seeing this happen fairly often, I'm assuming it's probably when the script is writing to the text file, at the same time the SILO block is trying to read the same file, so it errors out.

Would you be able to confirm if this is true, or offer an alternative theory? 

AND hopefully a solution smile?

Many thanks
Michael

Offline

#2 2018-01-31 14:18:55

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: SILO error help

Dear Michael,
the most probable reason is the conflict between read/write operations on a single file from multiple programs as you wrote.
I can imagine 2 solutions:

1) Ignore invalid data as shown in this SILO block snippet (save file as e.g. filename.mdl). The SHLD function block must be set to "Hold last value" mode.

2) Use the REST API of REX and instead of loading the value from a file using the SILO block, push the value directly from Python script to e.g. the CNR function block.

Hope this helps, let me know.

Kind regards,
Jaroslav

Offline

#3 2018-01-31 22:37:16

mcarroll
Member
From: Australia
Registered: 2017-02-14
Posts: 18

Re: SILO error help

Awesome, thanks Jaroslav, I'll give it a whirl tomorrow, when I'm back at keyboard and let you know how it went.

Kind regards

Offline

#4 2018-02-01 16:30:14

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: SILO error help

Dear Michael,
here is an example on using REST API as mentioned earlier: 0302-03_REST_API_Python_Bash_etc.zip

A readme file with additional details is attached.

Let me know if this works for you.

Kind regards,
Jaroslav

Offline

Board footer

Powered by FluxBB