{"id":3575,"date":"2019-02-12T16:09:25","date_gmt":"2019-02-12T16:09:25","guid":{"rendered":"https:\/\/cyflexdoc.wpengine.com\/usage-help-manual\/17-i-o-systems\/do_pwm_transfer\/"},"modified":"2026-02-03T14:03:21","modified_gmt":"2026-02-03T19:03:21","slug":"do_pwm_transfer","status":"publish","type":"page","link":"https:\/\/cyflex.com\/index.php\/usage-help-manual\/14-i-o-systems\/do_pwm_transfer\/","title":{"rendered":"do_pwm_transfer"},"content":{"rendered":"<div>\n<h3>Purpose:<\/h3>\n<\/div>\n<dl>\n<dd>\n<p>Provide PWM on a Digital Out Bit.<\/p>\n<\/dd>\n<\/dl>\n<h3>Enter:<\/h3>\n<dl>\n<dd>\n<p><strong>do_pwm_transfer<\/strong> &lt;priority&gt; &lt;process_rate&gt; [+c]<\/p>\n<\/dd>\n<\/dl>\n<h3>Where:<\/h3>\n<dl>\n<dd>\n<div>\n<table cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col \/>\n<col \/> <\/colgroup>\n<tbody>\n<tr>\n<td>\n<p>priority<\/p>\n<\/td>\n<td>\n<p>Specify the system level task priority.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>process_rate<\/p>\n<\/td>\n<td>\n<p>Specify the rate at which update the PWM output.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>+c<\/p>\n<\/td>\n<td>\n<p>Optional. Specify this flag to indicate a critical task.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/dd>\n<\/dl>\n<h3>Example:<\/h3>\n<dl>\n<dd>\n<div>1.\u00a0ctrl_specs\u00a0output\u00a0specification: \u00a0<br \/>\n#\u00a0Output\u00a0type\u00a0\u00a0\u00a0DO\u00a0PWM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PWM\u00a0Period\u00a0or\u00a0a\u00a0label\u00a0\u00a0PWM\u00a0enable\u00a0label \u00a0<br \/>\n#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0label\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0containing\u00a0period \u00a0<br \/>\nDO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0air_htr_bit\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a035[sec]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0air_htr_enab<\/div>\n<div>\u00a0<\/div>\n<div>2.\u00a0do_specs\u00a0output\u00a0specification \u00a0<br \/>\n#chan\u00a0\u00a0invert\u00a0\u00a0up\u00a0to\u00a04\u00a0functional\u00a0descriptions \u00a0<br \/>\n0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$-$ \u00a0<br \/>\n#lbl\u00a0\u00a0true_desc\u00a0false_desc\u00a0\u00a0true_event\u00a0\u00a0false_event\u00a0\u00a0hst\u00a0\u00a0arm_dsply \u00a0<br \/>\nair_htr_bit\u00a0\u00a0ON\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OFF\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$-$\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$-$\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OFF\u00a0\u00a0\u00a0\u00a0\u00a0OFF \u00a0<br \/>\nFor this example, the DO bit &#8216;air_htr_bit&#8217; will be used to provide a\u00a0\u00a0\u00a0<br \/>\nPWM\u00a0output\u00a0that\u00a0will\u00a0have\u00a0a\u00a0base\u00a0period\u00a0of\u00a035\u00a0seconds.\u00a0\u00a0The\u00a0duty\u00a0cycle \u00a0<br \/>\nof\u00a0the\u00a0PWM\u00a0will\u00a0be\u00a0the\u00a0value\u00a0of\u00a0the\u00a0_CM\u00a0control\u00a0variable\u00a0for\u00a0the \u00a0<br \/>\nassociated\u00a0control\u00a0loop\u00a0and\u00a0the\u00a0value\u00a0of\u00a0the\u00a0LOGICAL_VARIABLE\u00a0\u00a0<br \/>\n&#8216;air_htr_enab&#8217; will be used to enable\/disable the PWM output. <br \/>\n$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$$-$-$$-$$-$<br \/>\nIf\u00a0the\u00a0PWM\u00a0is\u00a0specified\u00a0via\u00a0do_specs,\u00a0then\u00a0the\u00a0format\u00a0of\u00a0the specification\u00a0is: \u00a0<br \/>\n#chan\u00a0\u00a0invert \u00a0<br \/>\n0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PWM\u00a0\u00a0\u00a0\u00a0\u00a0period\u00a0\u00a0\u00a0\u00a0\u00a0DC_label\u00a0\u00a0[enable_label] \u00a0<br \/>\n#label\u00a0\u00a0\u00a0true_desc\u00a0\u00a0false_desc\u00a0\u00a0true_event\u00a0\u00a0false_event\u00a0\u00a0hst\u00a0\u00a0arm_dsply \u00a0<br \/>\nwater_htr\u00a0\u00a0\u00a0ON\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OFF\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$-$\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$-$\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OFF\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OFF \u00a0<br \/>\nwhere: \u00a0<br \/>\nPWM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0Is\u00a0a\u00a0new\u00a0function\u00a0code\u00a0that\u00a0indicates\u00a0this\u00a0bit\u00a0will\u00a0be used\u00a0as\u00a0a\u00a0PWM\u00a0Output\u00a0bit.\u00a0NOTE:\u00a0If\u00a0the\u00a0PWM\u00a0is\u00a0provided \u00a0<br \/>\nby\u00a0the\u00a0Control\u00a0task,\u00a0the\u00a0PWM\u00a0function\u00a0code\u00a0should not\u00a0be\u00a0specified\u00a0for\u00a0the\u00a0DO\u00a0bit. \u00a0<br \/>\nperiod\u00a0=\u00a0A\u00a0label\u00a0whose\u00a0value\u00a0will\u00a0be\u00a0used\u00a0as\u00a0the base\u00a0period\u00a0of\u00a0the\u00a0PWM\u00a0output.\u00a0If\u00a0the\u00a0label does not exist it will be created. A numeric\u00a0\u00a0<br \/>\nvalue\u00a0may\u00a0be\u00a0specified.\u00a0For\u00a0this\u00a0case,\u00a0the value\u00a0must\u00a0also\u00a0contain\u00a0the\u00a0time\u00a0units, e.g. 30[sec]. \u00a0<br \/>\nDC_label\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0is\u00a0the\u00a0label\u00a0of\u00a0a\u00a0REAL_VARIABLE\u00a0that\u00a0will\u00a0contain desired\u00a0Duty\u00a0Cycle\u00a0for\u00a0the\u00a0PWM\u00a0output.\u00a0If\u00a0the\u00a0label does not exist it will be created. A numeric\u00a0value\u00a0may\u00a0be\u00a0specified.\u00a0For\u00a0this\u00a0case,\u00a0the value\u00a0must\u00a0also\u00a0contain\u00a0units,\u00a0eg.\u00a030[%]. \u00a0<br \/>\nenable_label\u00a0=\u00a0The\u00a0label\u00a0of\u00a0a\u00a0LOGICAL_VARAIBLE\u00a0that is\u00a0used\u00a0to\u00a0disable\/enable\u00a0the\u00a0PWM output. If the label does not exist it will <br \/>\nbe\u00a0created.\u00a0This\u00a0is\u00a0an\u00a0optional\u00a0argument and\u00a0if\u00a0not\u00a0present\u00a0the\u00a0PWM\u00a0will\u00a0always be\u00a0active. \u00a0<br \/>\nwater_htr\u00a0\u00a0\u00a0\u00a0=\u00a0the\u00a0label\u00a0of\u00a0DO\u00a0bit\u00a0that\u00a0will\u00a0provide\u00a0the\u00a0PWM \u00a0<br \/>\nThe\u00a0remaining\u00a0fields\u00a0are\u00a0the\u00a0standard\u00a0DO\u00a0specs\u00a0fields. \u00a0<br \/>\nFor\u00a0example: \u00a0<br \/>\n#chan\u00a0\u00a0invert \u00a0<br \/>\n0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PWM\u00a0\u00a0\u00a0\u00a0\u00a0htr_period\u00a0\u00a0\u00a0\u00a0\u00a0DC_water_htr\u00a0\u00a0wtr_htr_enab \u00a0<br \/>\n#label\u00a0\u00a0\u00a0true_desc\u00a0\u00a0false_desc\u00a0\u00a0true_event\u00a0\u00a0false_event\u00a0\u00a0hst\u00a0\u00a0arm_dsply \u00a0<br \/>\nwater_htr\u00a0\u00a0\u00a0ON\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OFF\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$-$\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$-$\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OFF\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OFF \u00a0<br \/>\nFor this example, the DO bit &#8216;water_htr&#8217; will be used to provide a\u00a0PWM\u00a0output\u00a0that\u00a0will\u00a0have\u00a0a\u00a0base\u00a0period\u00a0as\u00a0defined\u00a0in\u00a0the\u00a0REAL_VARIABLE\u00a0\u00a0<br \/>\n&#8216;htr_period&#8217;.\u00a0\u00a0The duty cycle for the PWM is defined in the REAL_VARIABLE &#8216;DC_water_htr&#8217; and the value of LOGICAL_VARIABLE &#8216;wtr_htr_enab&#8217; will be used\u00a0to\u00a0enable\/disable\u00a0the\u00a0PWM\u00a0output.<\/div>\n<\/dd>\n<\/dl>\n<h3>Notes:<\/h3>\n<dl>\n<dd>\n<p>This task is normally started in the go script. It is configured by either ctrl_specs or do_specs. If the control task is providing the control of the PWM duty cycle, the associated loop should have a &#8216;DO&#8217; output type specified and the DO bit must be specified via do_specs. The syntax of the DO output type for the control specs is: DO &lt;do_bit_label&gt; &lt;period&gt; [enable_label] where:<\/p>\n<p>&lt;do_bit_label&gt; is the label of the DO bit that provides the PWM output<\/p>\n<p>&lt;period&gt; is a label or value for the base period of the PWM output<\/p>\n<p>[enable_label] is an optional label for a variable to enable or disable the PWM output<\/p>\n<\/dd>\n<\/dl>\n<h3>See Also:<\/h3>\n<dl>\n<dd>\n<p><a href=\"https:\/\/cyflex.com\/index.php\/usage-help-manual\/7-control-systems\/user_ctrl_specs\/\">user_ctrl_specs<\/a>, <a href=\"\/index.php\/usage-help-manual\/14-i-o-systems\/do_specs\/\">do_specs<\/a><\/p>\n<\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Purpose: Provide PWM on a Digital Out Bit. Enter: do_pwm_transfer &lt;priority&gt; &lt;process_rate&gt; [+c] Where: priority Specify the system level task priority. process_rate Specify the rate at which update the PWM output. +c Optional. Specify this flag to indicate a critical task. Example: 1.\u00a0ctrl_specs\u00a0output\u00a0specification: \u00a0 #\u00a0Output\u00a0type\u00a0\u00a0\u00a0DO\u00a0PWM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PWM\u00a0Period\u00a0or\u00a0a\u00a0label\u00a0\u00a0PWM\u00a0enable\u00a0label \u00a0 #\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0label\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0containing\u00a0period \u00a0 DO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0air_htr_bit\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a035[sec]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0air_htr_enab \u00a0 2.\u00a0do_specs\u00a0output\u00a0specification \u00a0 #chan\u00a0\u00a0invert\u00a0\u00a0up\u00a0to\u00a04\u00a0functional\u00a0descriptions \u00a0 0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$-$ [&hellip;]<\/p>\n","protected":false},"author":47,"featured_media":0,"parent":1964,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3575","page","type-page","status-publish","hentry"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/3575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/users\/47"}],"replies":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/comments?post=3575"}],"version-history":[{"count":0,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/3575\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/1964"}],"wp:attachment":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/media?parent=3575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}