PLC Programming Example

We can use the "FOR DO" command structure to find the sought value in an array. In the 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 value we are looking for is...

Read more

Popular PLC Tutorials

Latest PLC Programming Tutorials

Siemens S7 PLC Error Codes and Causes/Solutions

Siemens S7 Error Codes, error number, error description and error cause. Error number: Text: Cause: Remedy: 34:178 Block call invalid because interface was changed in the meantime. With Step7 V5.0 the instance DB of the DB type is entered in the symbol list for an FB call. This is no longer permitted with Step7 V5.0. In this case the "Update Call" doesn't work. Enter the instance DB of the FB type in the symbol...

Read more