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
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