Tekeff
Hello,

I can ask about the Monitoring page on OpenPLC Webserver? This page states:

"This feature is not available yet! Check back later..."

What specifically does this mean? This function is still in the progress?

Thank you
Quote 0 0
thiagoralves
Yes, this means that this feature is not available yet and I don't have any estimation of when it will be available. It depends on how much free time I can have to work on it.
Quote 0 0
Ohcoatl

Hi

I have troubles with Monitoring page. When I add analog input into the program this page cannot be displayed. I have OpenPLC on rpi 1 and 2 and both behave the same.

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

When I refresh page reloads and shows variables, but doesn't updates any values.

My program works as it should otherwise. I would just like to set some values based on analog readings.
Is there another way of getting values from analog inputs? I'm using Arduino nano as a slave if it matters.

Quote 0 0
thiagoralves
How old is your OpenPLC installation? There were some fixes pushed to Monitoring pages recently. If your installation is more than 2 months old, try reinstalling with the latest version from git and report back if that worked.
Quote 0 0
Ohcoatl
It's about 2 weeks old, not two months.
I also reinstalled OpenPLC and there is the same error.
Quote 0 0
thiagoralves
Can you post your program here? I would like to check what might be causing this error
Quote 0 0
Ohcoatl
Attached.
Quote 0 0
thiagoralves
This is just the compiled output. I need the full project folder. You can just .zip (compress) the folder and attach here
Quote 0 0
Ohcoatl
I'm sorry, here is the whole folder.
Quote 0 0
thiagoralves
Your program seems quite short. I was able to flag the issue just by reading the compiled code. It seems that you used the wrong location for analog I/O. Analog I/Os don't have the bit separation as digital I/Os, so the right address should be %IW100 and not %IW100.0. Fix that and your program will run just fine
Quote 0 0
thiagoralves
edit: additionally, it is wise to use UINT instead of INT for analog readings, otherwise values bigger than 32768 will be interpreted as negative numbers.
Quote 0 0
Ohcoatl
Thank you, that solved it.

How that it is INT 4bytes, here it states that it is two: https://en.wikipedia.org/wiki/IEC_61131-3
Also on your reference page I got a notion that I have to use separation bit: https://www.openplcproject.com/getting-started-arduino
Quote 0 0
thiagoralves
INT on OpenPLC is two bytes, as defined on the standard. That's why I said that it is better to use UINT for analog readings, which is also two bytes, but uses all bits to represent values. Otherwise you will be using 15 bits instead of 16 bits for the analog input (i.e. readings over 32768 will show as negative values).

You are right about the table. I need to update that. It was created for OpenPLC v2 which used the dot separation for everything. Addressing changed on v3 and I forgot to update the documentation. Thanks for pointing out.
Quote 0 0