jmuguruza
I created a project on OpenPLC Editor like this one:
Captura1.jpg 
I want to see the variables on the monitoring part, but I am not shown anything. 
The reason is that I have to give that variables a memory address or is there something else?
Captura2.jpg 
Reply 0 0
thiagoralves
jmuguruza wrote:

The reason is that I have to give that variables a memory address...
 

Yes!
Reply 0 0
jmuguruza
Fine, thanks.

Now if I initialize one of the variables then I get an error when starting PLC simulation. The file plc.st changes and it creates a programming error.
editor2.jpg
Reply 0 0
thiagoralves
Something seems wrong with the code generation, it is missing a semicolon. Can you attach your project here?
Reply 0 0
jmuguruza
Sure.
st  generated_plc.st      st  plc.st      xml plc.xml     xml beremiz.xml     
Reply 0 0
jmuguruza
I modified the .st file and I have the following values for the variables:
archivo.jpg 

Now I upload the file and start the plc; I see this in 'Monitoring':
monitoring.jpg 
I am not able to see those two variables ('CaudalPurga' and 'SolidoSuspendido') correctly.
Reply 0 0
jmuguruza
Any idea how to solve it?
Reply 0 0
thiagoralves
So, it seems that the error you're facing on simulation is due to a bug on OpenPLC Editor. This bug has been fixed ages ago, so please just update your editor and you should be good.

In terms of monitoring, the issue is that you're using the wrong addresses. First, when you use an input location like %IX, IW, etc, even if you initialize it with a value, the Runtime will immediately replace that value with whatever comes from the hardware. Those locations are linked to the input hardware, even if you don't physically have a hardware present. In that case, if you don't have a hardware present the driver will just populate those locations with zero. Besides that, OpenPLC Runtime does not support anything bigger than WORD on input and output locations. So, in essence, there is no IDx or QDx. The maximum you can get is IWx or QWx. If you want to use double locations, you will have to use memory: %MD0, MD1, etc... You can also use memory with Long (64-bit) variables as well: %ML0, %ML1.
Reply 0 0
jmuguruza
Ok, that way I can see the values in Monitoring, thanks!
monitoring.jpg 
Now I would like to see those two values also in Scada, but I only get 0:
scada.jpg 
Those two values are defined in the .json file as input registers
Reply 0 0
thiagoralves
https://www.openplcproject.com/reference/modbus-slave/
Reply 0 0
jmuguruza
My problem is that I get most of the variables correctly in Scada, configuring the point locator test for each one and reading data, but do not get the DINT (Caudal de Purga) and REAL (Solido suspendido) values.
point_locator.jpg
Those two values are defined as storage class: memory
Reply 0 0
thiagoralves
If you check the link I sent you on the previous post you will see that memory locations are mapped to Modbus holding registers
Reply 0 0
jmuguruza
You are right. Thank you once again!
Reply 0 0
rgb
I am having problems with monitoring, probably because I am newbie with this tool

I'm trying to display a float value, I have defined a very simple st.

PROGRAM prueba
  VAR
    
    soReal AT %MD0 : REAL := 11.1;
    soDint AT %MD1 : DINT := 11;
    
  END_VAR
    soReal := 11.1;
    soDint := 11;

END_PROGRAM 
CONFIGURATION Config0
  RESOURCE Res0 ON PLC
    TASK task0(INTERVAL := T#20MS, PRIORITY := 0);
    PROGRAM instance0 WITH task0 : prueba;
  END_RESOURCE
END_CONFIGURATION


but the value of the float variable is always set to 0 in monitoring tab:
Captura de pantalla de 2022-01-24 16-29-21.png 
Do you know where can be the problem?

Thanks in advance
Reply 0 0
jmuguruza
Hi there,

How did you build the .st file?
Did you configure it yourself line by line or you used the OpenPLC Editor and got an .st file?
Reply 0 0
Reply