INNER CODE UNIT · Kotlin

start

vogler75/automation-gateway · source/lib-plc4x/src/main/kotlin/Plc4xDriver.kt:46

    override fun start(startPromise: Promise<Void>) {
        super.start(startPromise)
        if (pollingTime>0) {
            vertx.setPeriodic(pollingTime, ::pollingExecutor)
        }
    }

    private var pollingRequestId = 0
    private var pollingResponseId = 0

    @Suppress("UNUSED_PARAMETER")
    private fun pollingExecutor(id: Long) {
        if (isConnected() && pollingTopics.isNotEmpty()) {
            if (pollingRequestId > pollingResponseId) {
                logger.warning("Polling request id [${pollingRequestId}] is still pending (response id [${pollingResponseId})].")
            }
            val localRequestId = ++pollingRequestId
            val builder: PlcReadRequest.Builder = plc!!.readRequestBuilder()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…