TwinCAT Software Testing

What is Software Testing (Coming soon...)

Software testing is the process of checking the quality, functionality, and performance of a software product before deployment to the fields. We shall focus on this article about functional testing. There are many different kinds of testing in software engineering.

In most cases, the PLC software reads, processes,  and writes variables to the output for controlling the system. The device in the fields interacts with depending on the output of the PLC program. PLC program does some output and then the automation system signals (by input sensors) that it has done the desired work. PLC monitors the variables for a certain time, if the desired input is not set within that time, PLC signals with an alarm.

In the following simple program, we command the motor to start by outputting the startMotorContactor variable.

VAR
motorRunning AT%I*: BOOL;
startMotorContactor   AT %Q* : BOOL;
END_VAR

When the PLC program has made an output (startMotorContactor HIGH) then the motor should start and it will set the motorRunning flag to HIGH (So our PLC knows the motor is running and continues to process other stuff). So during the development phase, we don’t have a motor or any sensors. So what we can do is we can monitor by 3rd software the startMotorContactor variable and when it is HIGH then we can put the motorRunning flag to HIGH in the idle case and we don’t do anything during an error case. 

This concept will be our driving force for developing test software and will continue, please come back later.