Jump to content

Recommended Posts

Posted (edited)
Could somebody tell me why the subroutine in my attached program does not return the expected result. Basically what I want to do is convert 2 numeric bytes from seperate locations into a string. but seperate the 2 numbers with a "-" once in the string. I have almost got it right, but the last step to transfer the string out of the subroutine and into a location doesn't seem to work.... Must be something and nothing, but it beats me...? Thanks in advance. combine_bytes_to_string.rar Edited by Gazzr
Posted (edited)
Ill throw you a bone...... In your subroutine look at your local variable table Edited by 504bloke
Posted
I'm guessing that you mean look at the local variable table because LB2 is set to byte rather than string. But it doesn't let me select string.... I have no idea why though as the option is there in the drop down list.
Posted
I dont think you can pass a string out which is why you cannot select string, as you have selected byte insted this is why your subroutine isnt working on the output. I have searced siemens help and can find no reference to it though. All i think you can do is forget the OUT and just put the string in a variable say VB230 or something, that works ok.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...