RevPi DIO input signals go to zero?

Topics about the Software of Revolution Pi
Post Reply
reitanaka
Posts: 3
Joined: 03 Mar 2021, 05:28
Answers: 0

RevPi DIO input signals go to zero?

Post by reitanaka »

Hi.

I am currently working on a project to control an industrial machine using RevPi Core 3+, RevPi DIO and RevPiModIO.

The machine has a problem where, after running the machine for a few hours, the button input signal switches even though I haven't touched it.
As a countermeasure, I have managed to get it to work by ignoring the short signal changes, but it still malfunctions sometimes.
At first I thought it was due to noise, but after logging the input signals during operation, I figured it was not so.

The log is as follows

Code: Select all

2021-03-03 13:08:08.373686,1,0,0,0,0,1,0,1,1,0,0
2021-03-03 13:41:32.459371,0,0,0,0,0,0,0,1,53578,40746
2021-03-03 13:41:32.467554,1,0,0,0,0,1,0,1,1,0,0
From left column to right: Time, I_1, I_2, I_3, I_4, I_5, I_6, I_7, O_1, Status, Output_Status.
I_1, I_2, I_3, and I_4 are connected to buttons, I_5, I_6, and I_7 are connected to photosensors, and O_1 is connected to a relay.
Status and Output_Status are in decimal format.
This log is only recorded when the signal being recorded changes.
Other terminals are connected to sensors, solenoid valves, etc. and are constantly changing.

While I was recording this log, I did not do anything about the buttons or photo sensors, but the input signals suddenly switched.
On the other hand, the output signals seem to be unchanged.
After that, the input signals return to normal immediately.

The moment the signals switch, the Status and Output_Status change, indicating that an error has occurred.
However, the content of the error is puzzling.
I have no idea about the cause of the undervoltage or overheating.
Inputs 1-8 and 9-16 share a voltage, so I would expect two errors to occur at the same time, but actually only one is occurring.
It is also odd that it overheats for a moment and then the error disappears immediately.

What could be the cause of this malfunction?
And is there any way to resolve it?

The recording was taken with the following python script.

Code: Select all

import datetime
import csv
import sys

import revpimodio2


def main():
    revpi = revpimodio2.RevPiModIO(autorefresh=True, monitoring=True)

    monitoring_io = [
        revpi.io.I_1,
        revpi.io.I_2,
        revpi.io.I_3,
        revpi.io.I_4,
        revpi.io.I_5,
        revpi.io.I_6,
        revpi.io.I_7,

        revpi.io.O_1,

        revpi.io.Status,
        revpi.io.Output_Status,
    ]

    with open('signals.log', 'a') as f:
        file_writer = csv.writer(f)
        stdout_writer = csv.writer(sys.stdout)

        previous_ios = None

        def _callback_function(cycle_tools=None) -> None:
            nonlocal previous_ios

            ios = [int(io.value) for io in monitoring_io]

            if previous_ios != ios:
                previous_ios = ios

                values = [str(datetime.datetime.now())] + ios

                file_writer.writerow(values)
                stdout_writer.writerow(values)

        print('Start logging.')
        revpi.cycleloop(_callback_function, cycletime=10)


if __name__ == '__main__':
    main()
Thank you.
User avatar
dirk
KUNBUS
Posts: 1948
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: RevPi DIO input signals go to zero?

Post by dirk »

Hi reitanaka, thanks for your detailed information, the source code and all the analysis you did.
For us it looks like the status bytes do not contain any meaningful values.
In the past we had a bug about swapped values in the process image which we fixed.
Could you please update the system?

Code: Select all

sudo apt update
sudo apt upgrade
sudo reboot
reitanaka
Posts: 3
Joined: 03 Mar 2021, 05:28
Answers: 0

Re: RevPi DIO input signals go to zero?

Post by reitanaka »

Thanks for your reply.

I have tried apt update, apt upgrade and upgrading the pip libraries, but the problem still remains.

While testing, I got again a value of Status = 53578 and Output_Status = 40746.
After that, I got another value, Status = 20810 and Output_Status = 40875.
After a while, I got Status = 53578 and Output_Status = 40746 again.

Since the same values occurred repeatedly, it seems that Status and Output_Status don't simply change to random values.
User avatar
dirk
KUNBUS
Posts: 1948
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: RevPi DIO input signals go to zero?

Post by dirk »

Hi thank you for your patience. Please send us a SOS report to support@kunbus.com
Here is how it works:
viewtopic.php?f=3&t=2487&p=9007&hilit=sos+report#p8997
Hopefully we are able to examine the the root cause of the malfunction.
reitanaka
Posts: 3
Joined: 03 Mar 2021, 05:28
Answers: 0

Re: RevPi DIO input signals go to zero?

Post by reitanaka »

Thanks for your reply.

I don't know the cause of the problem, but I reinstalled the RevPi OS and the problem seems to have stopped occurring.
If the same problem occurs in the future, I will use revpi-sos.
User avatar
dirk
KUNBUS
Posts: 1948
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: RevPi DIO input signals go to zero?

Post by dirk »

Hello reitanaka, thank you for your feedback. Let's keep our fingers crossed that the problem will not occur again.
Post Reply