laura said:
1. In the declarations-table there are "IN, OUT, STAT and TEMP). "IN and OUT" are I/O's from the real world, which are binary in-and-out'puts and my PIW752 and PQW752. I understand this.
Sorry, but I don't understand the STAT and TEMP.
TEMP's are present in the declarations of all block types.
These are L (local) flags, that are multi-used. Its quite common in programming to have what is termed as 'scratch' flags, flags that holds the status of some logic that you done to be used within that block. Once you leave the block its status may change by another block.
It basically gives you the opportunity to name a scratch flag at the point you are using it so that you can remember what it is doing in that particular block.
Golden rule with TEMP flags, condition it before you use it.
STAT's are only present in FB's. <== thats the main difference
When you call an FB, you must have an instance datablock (IDB). The program auto creates the IDB and it contains all the INs, OUT,s, IN_OUT's and STAT's.
This means that the STAT's are stored in memory and you can use them to remember status from the last tikme the block was called.
laura said:
2. Your coding starts with:
AN #Reset
JC Test // If Reset has not been pushed then jump to main code......where does Your main code start, and how can I see that ?
I made the assumption that before starting you would want a clean system, so have included the ability os a RESET pushbutton to be installed.
I did not do any other programm, a call would look like
DB90 was created as the IDB and the Inputs and Outputs could be M flags if required and started and monitored in a VTA table.