ORGANIZATION_BLOCK OB1
VAR_TEMP
// Reserved
Info: ARRAY[0..19] OF BYTE;
// Temporary Variables
TT:s5Time;
END_VAR
// Instructions
M0.1:=NOT M0.0;
TT:=S_ODT(T_NO:=1,S:=M0.1,TV:=T#1000ms,Q:=M0.0);
IF M0.0 THEN
FB1.DB1();
END_IF;
;
END_ORGANIZATION_BLOCK
ORGANIZATION_BLOCK OB35
VAR_TEMP
// Reserved
Info: ARRAY[0..19] OF BYTE;
// Temporary Variables
END_VAR
// Instructions
;
END_ORGANIZATION_BLOCK
I wonder if they have simulated this in Matlab. Matlab was mentioned above but I have looked at Dynamic Matrix Control and it doesn't look like they have all the code necessary. Also, there is no definition of what they are controlling or where the system matrix comes from.Once you have a running system - your problems can be split into two - fundamental design errors and coding errors.
Coding errors can be found by setting up test data, running the plc for one scan and then verifying that all calculated data is correct from an alternative method (calculator, matlab etc). PLCSIM is ideal for this.
First I would implement this in Matlab or Scilab. There is an example on the Mathworks website.Fundamental design errors - one possibility is to generate an ideal model of your process and contruct the SCL code to simulate this process. You can control your simulated process with your DMC implemenation using PLCSIM before getting near the real hardware.