{"id":"iec-delete","model_id":"DELETE","name":"CODESYS DELETE","summary":"DELETE is a standard string function in the CODESYS Standard library. It removes a given number of characters from a string, starting at a specified position, and returns the remaining string as a STRING(255) value. It is written as DELETE(STR, LEN, POS) and is used in structured text programs.","study_notes":["Declared as FUNCTION DELETE : STRING(255).","Return value is the string remaining after deletion.","Position POS is counted from the left, starting with 1; both POS = 0 and POS = 1 address the first character.","Example: VarSTRING1 := DELETE('SUXYSI',2,3); gives the result 'SUSI'.","The current implementation is not correct for POS = 0: LEN is internally reduced by one. This cannot be changed for compatibility reasons.","The library recommends using values in the range specified by IEC 61131-3, where the smallest value for POS is 1.","The documentation lists an InOut scope section with no parameters."],"safety_notes":[],"sources":[{"url":"https://infosys.beckhoff.com/content/1033/tcplclib_tc2_standard/74412555.html","title":"Beckhoff Information System","accessed":"2026-10-26"},{"url":"https://content.helpme-codesys.com/en/libs/Standard/Current/String-Functions/DELETE.html","title":"CODESYS Group","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":12,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"structured_text","code":"DELETE","group":"String Functions","syntax":"DELETE (STR, LEN, POS)","parameters":[{"name":"STR","data_type":"STRING(255)","description":"String to be modified."},{"name":"LEN","data_type":"INT","description":"Length of the partial string to be deleted, number of characters."},{"name":"POS","data_type":"INT","description":"Position in STR after which the deletion starts, counted from left starting with 1."}],"dialect":"CODESYS","related":[],"standards":[]},"url":"https://machineschema.com/instruction/iec-delete","license":"https://creativecommons.org/licenses/by/4.0/"}