Page 1 of 1

Using Digital Outputs to mimic line breakage

Posted: 20 Apr 2020, 13:59
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?

Re: Using Digital Outputs to mimic line breakage

Posted: 20 Apr 2020, 15:22
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"

Re: Using Digital Outputs to mimic line breakage

Posted: 20 Apr 2020, 15:41
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?

Re: Using Digital Outputs to mimic line breakage

Posted: 23 Apr 2020, 14:36
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.