I could be reading into it, but my understanding is that Daniel wants to do something else. In his example the subroutine logic only sets the bit. In the real code, the subroutine probably does more comparisons before it determines which value to apply to the bit. The trick, as I see it, is that Daniel wants to select which USER_LABEL he sends to the subroutine to have the logic applied. We can use your suggestion and come up with another algorithm for Daniel. Given that there a set number of Boolean inputs and outputs (and Daniel will know ahead of time how many he will be using), the subroutine could be written to handle all of them. The CALL statement would pass an INTEGER value to determine to which input or output the logic would apply. Given the original puzzle, I think David's answer is still the most efficient. But, now we have supported Jones' Law(tm). I tell my trainees that "there are always at least three different ways to program anything". (And, no, they are not "the right way", "the wrong way", and "my way". :) Each has different merits and costs. Cheers, Chuck Jones "Things should be made as simple as possible--but no simpler."--A. Einstein. -----Original Message----- From: foxboro-bounce@xxxxxxxxxxxxx [mailto:foxboro-bounce@xxxxxxxxxxxxx] On Behalf Of Pan, Jim Sent: Friday, September 01, 2006 2:46 PM To: foxboro@xxxxxxxxxxxxx Subject: Re: [foxboro] HLBL User Labels Hi List, I think a User Label is a global name and will be recognized in the subroutines. There is no need to use arguments. If interested, you can try this: INDEPENDENT_SEQUENCE CONSTANTS VARIABLES USER_LABELS In_Flag :BI0001; Out_Flag :BO0001; SUBROUTINE my_flags ( ) VARIABLES STATEMENTS Out_Flag :=3D3D In_Flag; ENDSUBROUTINE STATEMENTS WHILE TRUE DO CALL my_flags ( ); WAIT 0.1; ENDWHILE ENDSEQUENCE To run the test, just toggle BI0001 and you will see that BO0001 follows it. Jim Pan Invensys Lifetime Learning -----Original Message----- From: foxboro-bounce@xxxxxxxxxxxxx [mailto:foxboro-bounce@xxxxxxxxxxxxx] On Behalf Of Klebba, Daniel Sent: Thursday, August 31, 2006 2:00 PM To: foxboro@xxxxxxxxxxxxx Subject: [foxboro] HLBL User Labels My understanding is that you cannot pass a user label to a subroutine and have it act as a user label in the subroutine, i.e. THIS_GUY : BO0001; {user label to pass} SUBROUTINE CHNG_OUTPUT (IN Label :S) Label :=3D3D3D TRUE; {set the Boolean output to TRUE} ENDSUBROUTINE STATEMENTS CALL CHNG_OUTPUT (THIS_GUY); ENDSEQUENCE As I understand it, this code will not work to change the status of BO0001 because I cannot pass a user label to a subroutine. It will only set the local subroutine variable to the string value "TRUE." A subroutine can only take strings, real, Booleans, and integers as arguments (arrays being a special case of said arguments) and I haven't figured out a way to pass a user label as a string which can then be used as a user label in the subroutine. Is this understanding incorrect? The reason this is important is that the subroutine would be written in an include file which could then be used in HLBL in several compounds. I believe that I can work around this problem by using input registers instead of output registers but that is counter-intuitive and it seems only reasonable to be able to pass user labels. Thanks Daniel Klebba ATK Launch =3D20 =3D20 _______________________________________________________________________ This mailing list is neither sponsored nor endorsed by Invensys Process Systems (formerly The Foxboro Company). Use the info you obtain here at your own risks. Read http://www.thecassandraproject.org/disclaimer.html =3D20 foxboro mailing list: //www.freelists.org/list/foxboro to subscribe: =3D mailto:foxboro-request@xxxxxxxxxxxxx?subject=3D3Djoin to unsubscribe: =3D mailto:foxboro-request@xxxxxxxxxxxxx?subject=3D3Dleave =3D20 =20 =20 _______________________________________________________________________ This mailing list is neither sponsored nor endorsed by Invensys Process Systems (formerly The Foxboro Company). Use the info you obtain here at your own risks. Read http://www.thecassandraproject.org/disclaimer.html =20 foxboro mailing list: //www.freelists.org/list/foxboro to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Djoin to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Dleave =20 ***************************************************************************= ************************** This email and any files transmitted with it are confidential and intended = solely for the=20 use of the individual or entity to whom they are addressed. If you are not = the intended=20 recipient or the person responsible for delivering the email to the intende= d recipient, be=20 advised that you have received this email in error that any use, disseminat= ion,=20 forwarding, printing, or copying of this email is strictly prohibited. If = you have received=20 this email in error please notify the sender immediately. Please note that = we reserve=20 the right to monitor and read any emails sent and received by the Company i= n=20 accordance with and to the extent permitted by applicable legal rules. ***************************************************************************= ************************** _______________________________________________________________________ This mailing list is neither sponsored nor endorsed by Invensys Process Systems (formerly The Foxboro Company). Use the info you obtain here at your own risks. Read http://www.thecassandraproject.org/disclaimer.html foxboro mailing list: //www.freelists.org/list/foxboro to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave