×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Indexing through an array using ST programming

Indexing through an array using ST programming

Indexing through an array using ST programming

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources