PLC Programming Example

We can use the "FOR DO" structure to find the sought value in an array. In the example below, I will explain how to run the "FOR DO" command in the STL language that I have prepared for you and understand the index number of a number in the array or whether this number is in the array. The "SIZE" instruction is an instruction that returns the number of elements of the parameterized array. If you know how many elements the array has, you can enter the part inside the "FOR DO" loop. If you want to write parametrically without errors, you can use the "SIZE" command. Size(BarcodeArray,0,SizeCount); command returns 100 to SizeCount tag because BarcodeArray array has 100 elements. The data type of the SizeCount tag is DINT. BarcodeFound :=0; // if the barcode value we are looking for is...

Read more

Popular PLC Tutorials

Latest PLC Programming Tutorials

Siemens PLC Example 4 separate buttons and motors

Siemens PLC Programming with Example Drive motors via siemens plc We will drive motors with four separate buttons, each motor has a different run command, and stop command. And we will add one rule for all motors that  motors can run for more than 30 minutes, If any motor has been on for 30 minutes, a red light will be on and that motor will stop immediately. Engagement times of the motors are important. Because,...

Read more