{"id":673,"date":"2017-05-28T16:16:43","date_gmt":"2017-05-28T16:16:43","guid":{"rendered":"http:\/\/bryceautomation.com\/?p=673"},"modified":"2017-05-28T16:19:06","modified_gmt":"2017-05-28T16:19:06","slug":"passing-parameters-to-subroutines","status":"publish","type":"post","link":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/","title":{"rendered":"Passing Parameters to Subroutines"},"content":{"rendered":"<h2>Introduction to Passing Parameters to Subroutines<\/h2>\n<p>We&#8217;ve already discussed <a href=\"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/controllogix-simple-subroutines\/\">simple subroutines<\/a>. \u00a0In most cases, subroutines are just used for the purpose of organization. \u00a0 Now, we will use subroutines as <strong>functions<\/strong>. \u00a0We will create a subroutine that converts Celsius to Fahrenheit. \u00a0 Once we create the subroutine, we will use the subroutine any time we need to convert Celsius to Fahrenheit.<\/p><div id=\"bryce-1054294986\" class=\"bryce-afterfirst bryce-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-8316758073402323\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-8316758073402323\" \ndata-ad-slot=\"7728240895\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n<p>Another popular use of this method is to scale analog signals. \u00a0\u00a0A Pressure Transducer might be calibrated to send out a 4 to 20ma signal based on a pressure of 0 to 200psi. \u00a0 The analog module itself might not know how the transducer is calibrated, so the analog card places a 3277 to 16384 into the controller tag. \u00a0 We might send the raw value of this tag to a subroutine to convert the data back to 0 to 200psi. \u00a0Then we store the answer in another tag that will be used for comparison in our logic.<\/p>\n<p>The advantage of using this method is that the subroutine does not need any modification once it is completed. \u00a0 \u00a0When we need to do a conversion, we&#8217;ll just add a JSR anywhere in the program that we like. \u00a0 We will pass a Celsius Value, and then once we get the answer back from the subroutine, we will store this result to a tag.<\/p>\n<h2>Create your tags<\/h2>\n<p>First, let&#8217;s create some tags that we will be using for this conversion. \u00a0 Here, we will have tags that will store random values. \u00a0 \u00a0In your project, these tags will normally be populated by a thermocouple module, an RTD module, or any other analog input.<\/p>\n<p>Create the following tags with the Data Type of &#8220;REAL&#8221; \u00a0 This data type will allow us to use decimal points in our values.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-674 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/tags-1.png\" alt=\"Subroutine Tags\" width=\"471\" height=\"156\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/tags-1.png 471w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/tags-1-300x99.png 300w\" data-sizes=\"(max-width: 471px) 100vw, 471px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 471px; --smush-placeholder-aspect-ratio: 471\/156;\" \/><\/p>\n<p>Now, go to &#8220;Monitor Tags&#8221; at the bottom of your Controller Tag Database, and place some values into Celsius tags as shown:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-675 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/tagvalues.png\" alt=\"Tag Values\" width=\"322\" height=\"177\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/tagvalues.png 322w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/tagvalues-300x165.png 300w\" data-sizes=\"(max-width: 322px) 100vw, 322px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 322px; --smush-placeholder-aspect-ratio: 322\/177;\" \/><\/p>\n<p>We know that if our subroutine is working, BearingTempC will be converted to a 212, and stored into BearingTempF. \u00a0OilTempC will be converted to a value of 32, and the answer will be stored into OilTempF. \u00a0Similarly, WaterTempC should return an answer of -40, and be stored into WaterTempF. \u00a0(-40C = -40F)<\/p>\n<p>Next, Right click on the MainRoutine, and create a new Ladder Diagram named &#8220;CTOF&#8221;. \u00a0 When finished, your project should look similar to this:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-676 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/createctof.png\" alt=\"Create CTOF\" width=\"261\" height=\"145\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 261px; --smush-placeholder-aspect-ratio: 261\/145;\" \/><\/p>\n<h2>Add the JSR\u00a0to the MainRoutine<\/h2>\n<p>Now we&#8217;ll go to the MainRoutine and add our JSR Statement. \u00a0 We will add our first Input parameter and Return parameter. \u00a0On the end rung, type: jsr ctof. \u00a0 To add the parameters, right click CTOF within the JSR instruction to add these parameters. \u00a0 \u00a0Parameters are a little tricky to work with. \u00a0 You will have to remove any extra question marks. \u00a0 Make sure when you are finished, you have just ONE Input parameter, and ONE return parameter as shown.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-677 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/parametersjsr.png\" alt=\"JSR Parameters\" width=\"365\" height=\"109\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/parametersjsr.png 365w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/parametersjsr-300x90.png 300w\" data-sizes=\"(max-width: 365px) 100vw, 365px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 365px; --smush-placeholder-aspect-ratio: 365\/109;\" \/><\/p>\n<h2>Set up the Subroutine (CTOF)<\/h2>\n<p>Next, open the CTOF Routine. \u00a0 Let&#8217;s build the structure of our logic first, then I&#8217;ll explain the purpose of each instruction. \u00a0 On the first line, type SBR CPT (SBR then a space, followed by CPT)<\/p>\n<p>On the next rung, just type RET. \u00a0 At this point, your logic in the CTOF routine should look like this:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-678 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/sbrlogicstructure.png\" alt=\"Subroutine Structure\" width=\"445\" height=\"164\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/sbrlogicstructure.png 445w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/sbrlogicstructure-300x111.png 300w\" data-sizes=\"(max-width: 445px) 100vw, 445px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 445px; --smush-placeholder-aspect-ratio: 445\/164;\" \/><\/p>\n<p>Now we need to add our parameters. \u00a0 We&#8217;ll start with the SBR statement. \u00a0 The SBR statement will receive the VALUE of BearingTempC. \u00a0 The SBR itself does not know where this value is coming from. \u00a0 \u00a0It doesn&#8217;t care where it comes from, but it needs to store the value somewhere, so we&#8217;ll store this to our workspace tag. \u00a0 Right click the SBR instruction and add the INPUT parameter &#8220;Workspace&#8221;<\/p>\n<p>Next, we have the value stored in the workspace tag that we need to convert. \u00a0 Right now, the workspace tag contains the value of 100.<\/p>\n<p>Now, we&#8217;ll look at the CPT instruction. \u00a0 The CPT instruction will be used to convert the 100 to 212 (Celsius to Fahrenheit). \u00a0 Since we no longer need the value of 100, we will store the answer of 212 back to the workspace. \u00a0 \u00a0Set the Destination of the CPT to &#8220;workspace&#8221; \u00a0The expression of the CPT instruction will be &#8220;workspace * 1.8 + 32&#8221; \u00a0Remember, \u00a0within this subroutine, we don&#8217;t know where the values are coming from, or where they are going to. \u00a0 Only the JSR knows that. \u00a0 Our job here in the subroutine is just to receive a value, convert the value, and return the answer back to the JSR. \u00a0 Therefore, we need to add the return parameter to the RET instruction. \u00a0 The return parameter will also be &#8220;workspace&#8221;. \u00a0 You logic should appear as shown here:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-680 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/ctofcomplete.png\" alt=\"CTOF complete\" width=\"446\" height=\"171\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/ctofcomplete.png 446w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/ctofcomplete-300x115.png 300w\" data-sizes=\"(max-width: 446px) 100vw, 446px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 446px; --smush-placeholder-aspect-ratio: 446\/171;\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Review<\/h2>\n<p>To recap: \u00a0The JSR instruction in the MainRoutine passes the value of 100 from BearingTempC. \u00a0 The CTOF routine stores this value to the workspace tag using the SBR instruction. \u00a0 The, the CPT manipulates this value, and stores the answer back to workspace. \u00a0\u00a0Next, the\u00a0RET statement returns the value of 212 back to the JSR in the MainRoutine. \u00a0 The JSR is configured to store the result to BearingTempF.<\/p>\n<p>The advantage of using this method is that anytime we need to convert Celsius to Fahrenheit, we only need another JSR instruction that is configured to pass any tag containing a Celsius value, and store the answer back to a tag representing the Fahrenheit value.<\/p>\n<p>Now, let&#8217;s add the other two JSR instructions to the MainRoutine now. \u00a0 No other changes are necessary to the CTOF routine. \u00a0 It&#8217;s already configured to do it&#8217;s job!<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-681 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/finaljsrs.png\" alt=\"Final JSRs\" width=\"443\" height=\"306\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/finaljsrs.png 443w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/finaljsrs-300x207.png 300w\" data-sizes=\"(max-width: 443px) 100vw, 443px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 443px; --smush-placeholder-aspect-ratio: 443\/306;\" \/><\/p>\n<p>Finally, download to your processor (or finalize your edits if you are online). \u00a0Open the controller tag database, and look at the Fahrenheit tags. \u00a0They should have the correct answers. \u00a0Modify one of the Celsius values. \u00a0 \u00a0The Fahrenheit counterpart will also be updated.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-682 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/ParamterTagAnswers.png\" alt=\"Tag Answers\" width=\"425\" height=\"136\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/ParamterTagAnswers.png 425w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/ParamterTagAnswers-300x96.png 300w\" data-sizes=\"(max-width: 425px) 100vw, 425px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 425px; --smush-placeholder-aspect-ratio: 425\/136;\" \/><\/p>\n<p><strong><em>Warning: \u00a0 You could fault the possessor if the number of parameters being passed and returned from the JSR instruction is not the same number as the subroutine expects! \u00a0When passing parameters, it&#8217;s best to check your logic offline, or in a non-production processor.<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&#8212; Ricky Bryce<\/p>\n<div id=\"bryce-1365341906\" class=\"bryce-after-content bryce-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-8316758073402323\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-8316758073402323\" \ndata-ad-slot=\"4667596182\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Introduction to Passing Parameters to Subroutines We&#8217;ve already discussed simple subroutines. \u00a0In most cases, subroutines are just used for the purpose of organization. \u00a0 Now, we will use subroutines as functions. \u00a0We will create a subroutine that converts Celsius to Fahrenheit. \u00a0 Once we create the subroutine, we will use the subroutine any time we <a class=\"moretag btn btn-primary\" href=\"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/\">Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":681,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[11,14,13],"class_list":{"0":"post-673","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-controllogix","8":"tag-controllogix","9":"tag-parameters","10":"tag-subroutines","11":"czr-hentry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to pass parameters to subroutines in the ControlLogix processor.<\/title>\n<meta name=\"description\" content=\"How to use subroutines as a function by passing parameters using the JSR Instruction. How to configure a subroutine to receive parameters.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to pass parameters to subroutines in the ControlLogix processor.\" \/>\n<meta property=\"og:description\" content=\"How to use subroutines as a function by passing parameters using the JSR Instruction. How to configure a subroutine to receive parameters.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/\" \/>\n<meta property=\"og:site_name\" content=\"Bryce Automation\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ricky.bryce.7\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-28T16:16:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-05-28T16:19:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/finaljsrs.png\" \/>\n\t<meta property=\"og:image:width\" content=\"443\" \/>\n\t<meta property=\"og:image:height\" content=\"306\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ricky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/\"},\"author\":{\"name\":\"Ricky\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\"},\"headline\":\"Passing Parameters to Subroutines\",\"datePublished\":\"2017-05-28T16:16:43+00:00\",\"dateModified\":\"2017-05-28T16:19:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/\"},\"wordCount\":993,\"commentCount\":6,\"image\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2017\\\/05\\\/finaljsrs.png\",\"keywords\":[\"ControlLogix\",\"Parameters\",\"Subroutines\"],\"articleSection\":[\"ControlLogix\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/\",\"name\":\"How to pass parameters to subroutines in the ControlLogix processor.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2017\\\/05\\\/finaljsrs.png\",\"datePublished\":\"2017-05-28T16:16:43+00:00\",\"dateModified\":\"2017-05-28T16:19:06+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\"},\"description\":\"How to use subroutines as a function by passing parameters using the JSR Instruction. How to configure a subroutine to receive parameters.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/#primaryimage\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2017\\\/05\\\/finaljsrs.png\",\"contentUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2017\\\/05\\\/finaljsrs.png\",\"width\":443,\"height\":306,\"caption\":\"Final JSRs\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2017\\\/05\\\/28\\\/passing-parameters-to-subroutines\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/bryceautomation.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Passing Parameters to Subroutines\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#website\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/\",\"name\":\"Bryce Automation\",\"description\":\"Automating Home and Industry...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/bryceautomation.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\",\"name\":\"Ricky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"contentUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"caption\":\"Ricky\"},\"sameAs\":[\"http:\\\/\\\/bryceautomation.com\",\"https:\\\/\\\/www.facebook.com\\\/ricky.bryce.7\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ricky-bryce-4367a416\\\/\"],\"url\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/author\\\/ricky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to pass parameters to subroutines in the ControlLogix processor.","description":"How to use subroutines as a function by passing parameters using the JSR Instruction. How to configure a subroutine to receive parameters.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/","og_locale":"en_US","og_type":"article","og_title":"How to pass parameters to subroutines in the ControlLogix processor.","og_description":"How to use subroutines as a function by passing parameters using the JSR Instruction. How to configure a subroutine to receive parameters.","og_url":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/","og_site_name":"Bryce Automation","article_author":"https:\/\/www.facebook.com\/ricky.bryce.7","article_published_time":"2017-05-28T16:16:43+00:00","article_modified_time":"2017-05-28T16:19:06+00:00","og_image":[{"width":443,"height":306,"url":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/finaljsrs.png","type":"image\/png"}],"author":"Ricky","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/#article","isPartOf":{"@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/"},"author":{"name":"Ricky","@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7"},"headline":"Passing Parameters to Subroutines","datePublished":"2017-05-28T16:16:43+00:00","dateModified":"2017-05-28T16:19:06+00:00","mainEntityOfPage":{"@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/"},"wordCount":993,"commentCount":6,"image":{"@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/#primaryimage"},"thumbnailUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/finaljsrs.png","keywords":["ControlLogix","Parameters","Subroutines"],"articleSection":["ControlLogix"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/","url":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/","name":"How to pass parameters to subroutines in the ControlLogix processor.","isPartOf":{"@id":"https:\/\/bryceautomation.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/#primaryimage"},"image":{"@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/#primaryimage"},"thumbnailUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/finaljsrs.png","datePublished":"2017-05-28T16:16:43+00:00","dateModified":"2017-05-28T16:19:06+00:00","author":{"@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7"},"description":"How to use subroutines as a function by passing parameters using the JSR Instruction. How to configure a subroutine to receive parameters.","breadcrumb":{"@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/#primaryimage","url":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/finaljsrs.png","contentUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2017\/05\/finaljsrs.png","width":443,"height":306,"caption":"Final JSRs"},{"@type":"BreadcrumbList","@id":"https:\/\/bryceautomation.com\/index.php\/2017\/05\/28\/passing-parameters-to-subroutines\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bryceautomation.com\/"},{"@type":"ListItem","position":2,"name":"Passing Parameters to Subroutines"}]},{"@type":"WebSite","@id":"https:\/\/bryceautomation.com\/#website","url":"https:\/\/bryceautomation.com\/","name":"Bryce Automation","description":"Automating Home and Industry...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bryceautomation.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7","name":"Ricky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","url":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","contentUrl":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","caption":"Ricky"},"sameAs":["http:\/\/bryceautomation.com","https:\/\/www.facebook.com\/ricky.bryce.7","https:\/\/www.linkedin.com\/in\/ricky-bryce-4367a416\/"],"url":"https:\/\/bryceautomation.com\/index.php\/author\/ricky\/"}]}},"_links":{"self":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts\/673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/comments?post=673"}],"version-history":[{"count":0,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts\/673\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/media\/681"}],"wp:attachment":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/media?parent=673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/categories?post=673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/tags?post=673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}