Digital input and output handler. More...
Public Member Functions | |
| def | __init__ |
| Documentation for method. | |
| def | switch |
| Documentation for method. | |
| def | switchoffall |
| Documentation for method. | |
| def | sendoutputs |
| def | registeroutchannel |
| Documentation for method. | |
| def | removeoutchannel |
| Documentation for method. | |
| def | registerinoneventaliases |
| Documentation for method. | |
| def | registerinoffeventaliases |
| Documentation for method. | |
| def | registerinchannel |
| Documentation for method. | |
| def | removeinchannel |
| Documentation for method. | |
| def | chekinchannelschanges |
| Documentation for method. | |
| def | inputevent |
| Documentation for method. | |
| def | getinputblockdata |
| Documentation for method. | |
Public Attributes | |
| CAEIF | |
| IOIF | |
| OutChannels | |
| OutBytes | |
| OutBytesPrev | |
| InChannels | |
| InBytes | |
| InBytesPrev | |
| InOnAliases | |
| InOffAliases | |
| BM | |
Digital input and output handler.
This class makes handling of digital in, and output cards easy. All input, and output channel can have a functional name, which can be used as reference. Output channels can be switched off and on independently. Changes of the input channels can be handled via eventhandlers. Eventhandlers can be named as "Alias", so event names can be changed to logical names, for example "PUSH" instead of "ON" in the case of a pushbutton. Output channels can be switched off together in one time, what is useful in the case of quiting from the controller program. Input block's last stored data can be inquired by cardaddress and blocknumber, and result can be forwarded to an own eventhandler.
| def cpphlib.PPDIGINOUTHANDLER.__init__ | ( | self, | |
| CAEIF, | |||
| IOIF | |||
| ) |
Documentation for method.
Constructs PPDIGINOUTHANDLER class.
| CAEIF | CAE interface instance is already connected to ppds. |
| IOIF | IO interface instance is already connected to ppds. Short description: Constructs PPDIGINOUTHANDLER class |
| def cpphlib.PPDIGINOUTHANDLER.chekinchannelschanges | ( | self, | |
| MasterOrFwdData | |||
| ) |
Documentation for method.
It checks input channel changes. All PP eventhandler classes has method like this. Only one reading method can handle incoming data, because only one clientsocket can be connected to the ppds IO interface. Due to this, a master one, which reads out the receivequeue in the working loop, and the processes incoming data is required to have in the case of using more than one eventhandler. After processing the master passes raw data to the next eventhandlers. This way all data will be processed. If chekinchannelschanges method of eventhandler class is called as master, then it always reads out the receive queue of the IO interface. The master checkinchannelschanges must run first. All the other eventhandlers must receive the data read by the first after each-other, in consequence.
| MasterOrFwdData | It can be the "MASTER", or forwarded input data. Short description: It checks input channel changes |
| def cpphlib.PPDIGINOUTHANDLER.getinputblockdata | ( | self, | |
| CardAddress, | |||
| BlockNumber | |||
| ) |
Documentation for method.
It returns the last stored data of the input blocks.
| CardAddress | CardAddress The address of the digital input card, what the readable block is on |
| BlockNumber | The number of the block, what is to be known. Short description: It returns the last stored data of the input blocks |
| def cpphlib.PPDIGINOUTHANDLER.inputevent | ( | self, | |
| ChannelName, | |||
| EventName | |||
| ) |
Documentation for method.
It is the PPDIGINOUTHANDLER's eventhandler. It manages "ON" and "OFF" events on input channels, which can be represented by registered aliases as well. Return value is True if the event happened, False, if the event did not happened.
| ChannelName | The functional name of the channel |
| EventName | The name of the event Short description: It is the eventhandler |
| def cpphlib.PPDIGINOUTHANDLER.registerinchannel | ( | self, | |
| ChannelName, | |||
| CardAddress, | |||
| BlockNumber, | |||
| BitPosition | |||
| ) |
Documentation for method.
It registers digital input channels, and names them with a functional name. You can define the name of the channel, regarding the function of it. For example if you connect a pushbutton to the channel, and you want to use it to exit the process, it is useful to name it as "EXIT BUTTON".
| ChannelName | The functional name of the channel |
| CardAddress | The jumpered address of the digital input card, what is the channel to read is on |
| BlockNumber | The name of the block which contains the channel to be used. It's value can be 0..1 |
| BitPosition | The bitposition of the cannel within the certain block, which you want to use. It's value can be 0..7 Short description: It registers digital input channels |
| def cpphlib.PPDIGINOUTHANDLER.registerinoffeventaliases | ( | self, | |
| Aliases | |||
| ) |
Documentation for method.
It registers switching off eventname aliases to input channels
| Aliases | String list containing alias names Short description: It registers switching off eventname aliases |
| def cpphlib.PPDIGINOUTHANDLER.registerinoneventaliases | ( | self, | |
| Aliases | |||
| ) |
Documentation for method.
It registers switching on eventname aliases to input channels
| Aliases | String list containing alias names Short description: It registers switching on eventname aliases |
| def cpphlib.PPDIGINOUTHANDLER.registeroutchannel | ( | self, | |
| ChannelName, | |||
| CardAddress, | |||
| BlockNumber, | |||
| BitPosition | |||
| ) |
Documentation for method.
It registrates the digital output channel, and gives a functional name. Channel name is named by you regarding the used function. For example if a relay is on a channel, and you control a light with that, it is useful to name as "LAMP SWITCH RELAY".
| ChannelName | The functional name of the channel |
| CardAddress | The jumpered address of the digital output card, which is the relevant channel is on. |
| BlockNumber | The number of the block, which contains the channel required to be used. It's value can be 0...1. |
| BitPosition | The position of the channel within the defined block, you want to use. It's value can be 0...7. Short description: It registrates the digital output channel |
| def cpphlib.PPDIGINOUTHANDLER.removeinchannel | ( | self, | |
| ChannelName | |||
| ) |
Documentation for method.
It clears digital input channel from the storage of the class.
| ChannelName | The functional name of the channel you want to clear. Short description: It clears digital input channel |
| def cpphlib.PPDIGINOUTHANDLER.removeoutchannel | ( | self, | |
| ChannelName | |||
| ) |
Documentation for method.
It clears digital output channel from the storage of the class
| ChannelName | The functional name of the channel to delete Short description: It clears digital output channel |
| def cpphlib.PPDIGINOUTHANDLER.sendoutputs | ( | self | ) |
Short description: It sends all output channel's value changes to the cards
| def cpphlib.PPDIGINOUTHANDLER.switch | ( | self, | |
| ChannelName, | |||
| SwitchState, | |||
Send = False |
|||
| ) |
Documentation for method.
Switches certain chanels to certain states.
| ChannelName | The functional name of the out channel |
| SwithState | Output channel's state can be "ON", or "OFF" |
| Send | If the values is True, then it sends the new output value to the card immediately. If Send parameter is not given, method does not send anything to the card. In this case, one has to make sure if there is the method sendoutputs called at the end of the working loop, otherwise the output channel's value canges can't be sent to the output card. Short description: Switches certain chanels |
| def cpphlib.PPDIGINOUTHANDLER.switchoffall | ( | self, | |
Send = False |
|||
| ) |
Documentation for method.
It turns all output channels off.
| Send | If the values is True, then it sends the new output value to the card immediately. If Send parameter is not given, it does not send anything to the card. In this case, one has to make sure if there is the method sendoutputs called at the end of the working loop, otherwise the output channel's value canges can't be sent to the output card. Short description: It turns all output channels off |
1.7.6.1