Function Block variable not showing in variables list

Issue #25 closed
Thiago Alves created an issue

Steps to reproduce the problem

Create a blank project (or open the blank project attached here) and:

1) Add a button to the variables list at %QX0.0

2) Add a left power rail

3) Add a contact and associate with the button

4) Add a TON (and then you will see that the TON will not appear in the variables list)

5) Add an output to the variables list at %QX0.1

6) Add a coil and associate it with the output

7) Add a right power rail closing the circuit

8) Add a constant time (T#2000ms) for the PT input of TON0

The biggest problem is that if you compile the program (File -> generate), the final ST file doesn't have the TON on the list either and will fail after going through MatIEC Compiler:

PROGRAM My_Program

VAR

button AT %QX0.0 : BOOL;

output AT %QX0.1 : BOOL;

END_VAR

TON0(IN := button, PT := T#2000ms);

output := TON0.Q;

END_PROGRAM

CONFIGURATION Config0

RESOURCE Res0 ON PLC

TASK TaskMain(INTERVAL := T#1ms,PRIORITY := 0);

PROGRAM Inst0 WITH TaskMain : My_Program;

END_RESOURCE

END_CONFIGURATION

The only way to make TON0 appear on the list is to hit Display->Refresh right after adding it to the diagram. If you don't do it right after and then compile the program, it won't appear anymore even after hitting Refresh.

Comments (2)

  1. Log in to comment