Moderator: RevPiModIO

 
akash.sharma
Topic Author
Posts: 6
Joined: 31 May 2019, 18:47

How to disconnect a process from RevPiModIO?

09 Jun 2019, 15:47

This question is related to the following post for which I have not received a reply: https://revolution.kunbus.de/forum/view ... sing#p5180

Briefly I have two processes that need to access DIFFERENT outputs on the RevpiDIO. In the post above I explained that I had unexpected behavior when I tried to have each process connect to the DIO module using its own revpmodio2.RevPiModIO object. I was wondering if I could have each process CONNECT to the DIO right before it needs to use it (using conn = revpmodio2.RevPiModIO(autorefresh=True)) and then DISCONNECT right after it uses it? That would be inefficient (connecting every time the process needs to output a DO and then disconnecting) but the inefficiency might be acceptable, and it might solve the problem of one process stepping on the other that I described in the other post).

However I don't see how to explicitly DISCONNECT from the DIO. I looked in https://revpimodio.org/en/doc2/io/ for any method called "close" or "disconnect" or "release" but I did not find anything. I also looked for attributes of revpimodio2 (using print(dir(revpimodio2))) and again didn't see any attribute that intuitively seemed like a DISCONNECT. Any suggestions.

Thanks in advance!
 
pmdevigne
Posts: 3
Joined: 28 Mar 2019, 15:33

Re: How to disconnect a process from RevPiModIO?

21 Jun 2019, 15:56

Hello

Maybe, you can create a communication channel between the two processes.
Thus, the first process can tell the second to write outputs. The second process can also write its own outputs.
With that, only one process really writes the outputs.
You can use sockets for this.

Regards

Who is online

Users browsing this forum: No registered users and 1 guest