Analogue input handler. More...
Public Member Functions | |
| def | __init__ |
| Documentation for method. | |
| def | registerinchannel |
| Documentation for method. | |
| def | removeinchannel |
| Documentation for method. | |
| def | chekinchannelschanges |
| Documentation for method. | |
| def | inputevent |
| Documentation for method. | |
| def | getvalue |
| Documentation for method. | |
Public Attributes | |
| CAEIF | |
| IOIF | |
| InChannels | |
| InBytes | |
| InBytesPrev | |
| BM | |
Analogue input handler.
This class helps to get data from cards with analog inputs. The "CHANGE" event indicates changes of input channels, this time measured values can be read out. To do all of this you should name analog input channels.
| def cpphlib.PPAINHANDLER.__init__ | ( | self, | |
| CAEIF, | |||
| IOIF | |||
| ) |
Documentation for method.
Constructs PPAINHANDLER class.
| CAEIF | CAE interface instance is already connected to ppds. |
| IOIF | IO interface instance is already connected to ppds. Short description: Constructs PPAINHANDLER class |
| def cpphlib.PPAINHANDLER.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 receive queue 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 the chekinchannelschanges method is called as master, then it always reads out the receivequeue 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.PPAINHANDLER.getvalue | ( | self, | |
| ChannelName | |||
| ) |
Documentation for method.
It reads out the actual value of the channel
| ChannelName | The functional name of the channel Short description: It reads out the actual value of the channel |
| def cpphlib.PPAINHANDLER.inputevent | ( | self, | |
| ChannelName, | |||
EventName = "CHANGE" |
|||
| ) |
Documentation for method.
It is evendhandler of the PPAINHANDLER. It handles only one event, as "CHANGE". If the analog value mesured by the certain channel changes, then it comes back with value True, if there is no changes, the value is False. If the method indicates changes, it is useful to read out using getvalue method as soon as possible, because the changed data is stored only for the term of the cycle.
| ChannelName | The functional name of the channel Short description: Event handler for "CHANGES" event |
| def cpphlib.PPAINHANDLER.registerinchannel | ( | self, | |
| ChannelName, | |||
| CardAddress, | |||
| BlockNumber | |||
| ) |
Documentation for method.
It registers the analog channel, and it pairs a functional name with the channel. Channel name can be defined by you regarding the function it is used for. For example if a variable resistor is connected to one channel, and you want to used it to control speed, it is practical to name as "SPEED CONTROL".
| ChannelName | The functional name of the cannel |
| CardAddress | The jumpered address of the analog input card what the channel to read is on. |
| BlockNumber | The number of the chanel you want to use. Value can be 0..5 Short description: It registers the analog channel |
| def cpphlib.PPAINHANDLER.removeinchannel | ( | self, | |
| ChannelName | |||
| ) |
Documentation for method.
It purges the analog channel from the store of the class.
| ChannelName | The functional name of the channel to be purged. Short description: It purges the analog channel |
1.7.6.1