Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indexing through an array using ST programming

Status
Not open for further replies.

jonesy29847

Electrical
Feb 28, 2003
133
I am trying to code a string concatenization subroutine using ControlLogix ST.

The sub uses 3 Input parameters.
InputParam1 an SINT, is how many elements in the array, 3 in this case.
InputParam2 a STRING, is a pad character, : in this case
InputParam3 is the array of STRING with the following values for the elements InputParam3[0] = HH, InputParam3[1] = MM and InputParam3[2] = SS.

The calling convention for CONCAT is CONCAT(String1, String2, String3)

The subroutine is codded as follows:

index := 0

WHILE(index < InputParam1) DO
CONCAT(InputParam3[index], InputParam2, PartInfo);
index := index + 1
END_WHILE

The software didn't seem to like a RET at the end of this routine, but the processor didn't crash either.

I expect PartInfo to contain HH:MM:SS when the subroutine returns.

Any help would be appreciated.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor