Using Digital Outputs to mimic line breakage

Topics about the Software of Revolution Pi
Post Reply
xtofl
Posts: 2
Joined: 20 Apr 2020, 13:44

Using Digital Outputs to mimic line breakage

Post by xtofl »

We want to use a PLC for automatic Hardware-in-the-Loop testing: to simulate buttons and switches wired to a device in a vehicle. Some of the tests should mimic a button press (i.e. low voltage), some a button release (i.e. high voltage), and some should mimic a line break.

I understood this could be done with changing the Memory area at offset 106 (https://revolution.kunbus.com/tutorials ... o-modules/): it will update the output pin to PushPull or HighSide mode.

However, we want to do this programmatically during a test run. Can this be done with the RevPiModIO module? Or should it be set by using the Modbus server?
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Using Digital Outputs to mimic line breakage

Post by dirk »

Hi, this settings cannot be changed without a reset of the picontrol driver. So this is hard to implement. One idea is that you switch configurations and reload the driver i.e. a bash script. Like this way:

Code: Select all

sudo cp ~/config1.rec /etc/revpi/config.rsc && piTest -x || echo "failed to copy config1.rsc"
sudo cp ~/config2.rec /etc/revpi/config.rsc && piTest -x || echo "failed to copy config2.rsc"
xtofl
Posts: 2
Joined: 20 Apr 2020, 13:44

Re: Using Digital Outputs to mimic line breakage

Post by xtofl »

dirk wrote: 20 Apr 2020, 15:22 Hi, this settings cannot be changed without a reset of the picontrol driver. So this is hard to implement.
Thanks for this quick reply!

'Hard to implement': does that mean the `picontrol` driver does not yet support it? Can it be added? (https://github.com/RevolutionPi/piContr ... iDIOComm.c)

Or is this just not what the revolutionpi is intended for? Should we revert to use a pin to trigger a relais to mimic line breaks?
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Using Digital Outputs to mimic line breakage

Post by dirk »

Hi, to make it short - please use the relais.
The longer explanation is that the picontrol driver initializes the devices according to the PiCtory settings.
Afterwards the devices go into cyclic data exchange.
Thus you cannot perform this "line break" with the DIO during cyclic data exchange.
A reset of the picontrol driver also sets the outputs to safe state which is "0".
So you could implement it but it would be a relly quirky situation.
Post Reply