Closing a Channel: Difference between revisions
From Phidgets Support
(Created page with "{{Recommended_Flow_Links|{{Flow Page Number|{{PAGENAME}} }} }} When you are finished with a channel, you should close and (in some languages) delete it. Once closed, the phys...") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Recommended_Flow_Links|{{Flow Page Number|{{PAGENAME}} }} }} | [[Category:Programming]]{{Recommended_Flow_Links|{{Flow Page Number|{{PAGENAME}} }} }} | ||
When you are finished with a channel, you should close and (in some languages) delete it. Once closed, the physical Phidget channel the software channel was matched to will be released, and made available to attach to other software channels. | When you are finished with a channel, you should close and (in some languages) delete it. Once closed, the physical Phidget channel the software channel was matched to will be released, and made available to attach to other software channels. | ||
Line 20: | Line 20: | ||
Phidget_close((PhidgetHandle)ch); | Phidget_close((PhidgetHandle)ch); | ||
PhidgetDigitalInput_delete(&ch); //Replace DigitalInput with the channel class of your channel | PhidgetDigitalInput_delete(&ch); //Replace DigitalInput with the channel class of your channel | ||
</syntaxhighlight> | |||
|-| | |||
JavaScript=<syntaxhighlight lang=javascript> | |||
await ch.close() | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</tabber> | </tabber> |
Latest revision as of 20:41, 19 April 2022
Phidget Programming Basics: Closing a Channel Table of Contents
9 . Closing a Channel
When you are finished with a channel, you should close and (in some languages) delete it. Once closed, the physical Phidget channel the software channel was matched to will be released, and made available to attach to other software channels.
For example:
ch.close()
ch.close();
ch.Close();
Phidget_close((PhidgetHandle)ch);
PhidgetDigitalInput_delete(&ch); //Replace DigitalInput with the channel class of your channel
await ch.close()
When you close a channel, it will reset all of the properties of that channel. For example, a digital output will revert back to FALSE when it is closed.