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?
Using Digital Outputs to mimic line breakage
Re: Using Digital Outputs to mimic line breakage
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
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
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.
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.