Simulating the logic
Simulate the logic
Now we will execute the logic. This will take some steps:
HCADwin starts compiling the project in the background and shows the status bar in aqua while doing so. Be patient now, if an error occurs the compilation results are shown in an edit window. Normally this will only happen if some variables are both used are reals and as Boolean, so there is a type conflict. Remember the error lines and goto "List, List Pascal" in order to see the code for yourself. The cursor can be placed on the error line (shown above) so you can see which tag to search for.
Let me explain what you see: In the caption of this new task your project can be seen, this is the DLL, which is going to be executed or a group of DLL's. Before the # sign the number 102 tells you that 102 DLL's are going to be executed. (When grouping projects, like this example using the GRP file, the number is higher than 1. When a "0" is encountered, you need to fix some error and compile again).
HCsimul will show four buttons:
So Run your project and notice the HCADwin screen, which mimics what happens.
Let me explain what I did to create the above picture. I didn't press "Run" but 10x the single step to advance 1 second. HCADwin show you the simulation time on the status bar in green. As you can see all lines are gray, the all transport zero's as you can see on both inputs and outputs where the red zero's are also show.
I waited some seconds and now some lines are red. The RKLEP finally reached the desired value. Not that the cursor is put on a line and the status bar shows A4T=15, meaning the actual timer value is 15 seconds.
HCADwin shows the simulation mode by indicating the red line above the logic. It updates dynamically (refresh rate can be adjusted "Edit, Settings, Update Frequency" [200 msec]). In the run mode the left mouse click acts differently. You could still give a M command on the keyboard if you like, but the mouse click in lines or inputs now serves as a toggle for Boolean values. (Or asking for numerical values, which are accepted only by using F4 when leaving the window) Try clicking on INPUT1 and INPUT2. Click on the line between INPUT3 and PRESS, enter 25 and press F4. Click on PRESS and you'll see:
Because a PID block has a tag associated, you can fill the attributes here too.
When entering values in the Waarde column, try PRESS_I=10.0, use the F4 key to enter it also in the actual database. F5 does the opposite.
The PID algorithm of HCADwin is a very easy one. By dividing (PV-SP) through the SC (scale) factor (can be negative for reverse action) the algorithm will act in the 0.0..1.0 range. The output however is scaled within High and Low limits (also clamped). The TR (tracking) value must be in the output range. When no TR is connected, the previous output is assumed. The algorithm just calculates the change in output and adds or subtracts that to TR. So manual/auto operation must be programmed outside the PID block.
Use F3 on a line or a symbol with a tag for monitoring:
You'll see a list of max 50 variables. Just enter what you want, if the name is present in the database a color and a type-character will appear. For booleans: just click on the B for a toggle. Other types: also click and fill the appearing edit box. Use F4 to get it actual too.
Would you like to see a trend? Try F6 or T on the lines.
Would you have access to the HCADwin database in EXCEL or some SCADA? Just edit HCADDDE.HDE with notepad and make a list of all variables you want (Like PRESS or RKLEPPOS or OUTPUT1). Then start HCADDDE.exe. When using "=HCADDDE|Simul!PRESS" in an EXCEL cell, it will updated automatically.
What we have learned: