Hello, I'm trying to manage some little 12v relays by using the outputs of an DIO module. I've been using the module without problems but only the high side function, wiring the outputs to 12V relays and activating them.
Now I want to use the outputs to sink current, wiring the relay to 12V and putting a 0 in the port to drive the relay to ground, but I could not make the output go to 0. I've tried to change OutputPushPull to 255 and 65535, but it seems don't affect to the outputs. When setting a 0 in the port I still see almost 12V (the 12v through the relay coil). These relays are very little ones, the coil is for 12V, the power supply for the outputs is 12v, everything seems correct but I could not make the DIO sinks current. I've also tried with some 12V leds, same result.
What could be the issue? Is the offset correct?
The piTest -v returns:
variable name: OutputPushPull
offset: 195
length: 16
bit: 0
I've been working with the RevPi for a month and this is the first issue I've found, it's a great product, thanks for your help.
OutputPushPull register seems not to work
OutputPushPull register seems not to work
https://www.circontrol.com - Mobility & eMobility Solutions
Re: OutputPushPull register seems not to work
Abel, with the variable "OutputPushPull" you select which channels you want to switch to push-pull.
E.g. channel 1 and 3 are 0101 binary => 4+1 decimal => 5 decimal.
Maybe you have switched the channel successfull to push-pull mode.
But to enable them you have to write a "1" instead of a "0" to the variable "Output" so that they connect to GND.
Maybe this was the thing that went wrong here.
So like above i.e. in case you write a "5" you are switching channel 1 and 3 (0101).
E.g. channel 1 and 3 are 0101 binary => 4+1 decimal => 5 decimal.
Maybe you have switched the channel successfull to push-pull mode.
But to enable them you have to write a "1" instead of a "0" to the variable "Output" so that they connect to GND.
Maybe this was the thing that went wrong here.
So like above i.e. in case you write a "5" you are switching channel 1 and 3 (0101).
Re: OutputPushPull register seems not to work
Hello Dirk, these are the commands that I'm sending:
1) Set to 1 all the bits of the OutputPushPull register:
pi@RevPi30661:~ $ piTest -w OutputPushPull,65535
Write value 65535 dez (=ffff hex) to offset 195.
2) Set to 1 the output 11:
pi@RevPi30661:~ $ piTest -w O_11,1
Set bit 2 on byte at offset 160. Value 1
3) Measure the voltage at the O_11 pin: 12.06V
4) Set to 0 the output 11:
pi@RevPi30661:~ $ piTest -w O_11,0
Set bit 2 on byte at offset 160. Value 0
5) Measure the voltage at the O_11 pin: 11.74V.
The O_11 is sinking some current but not enough to set the output to 0. I've tested other outputs with same result.
The voltage supply for the output part (upper connector) is 12V
The voltage supply for the logic (down connector) is 24V.
Their gnd's are not shared, but I've tried to join them with same results.
Also, if I remove the relay, the voltage at the output when set to 1 is 12.06, and when set to 0 is 10.16V!
If i set the register OutputPushPull to 1024 (bit to set to pushpull the O_11), I've same results.
Seems like the OutputPushPull don't do nothing to the outputs, or there is some hardware problem.
I will try the same with a DO module to check it.
Edit: tested with a brand new DO module, same results: I can not achieve a 0V output, only 10V when is open circuit and 11.75V when is the relay connected.
1) Set to 1 all the bits of the OutputPushPull register:
pi@RevPi30661:~ $ piTest -w OutputPushPull,65535
Write value 65535 dez (=ffff hex) to offset 195.
2) Set to 1 the output 11:
pi@RevPi30661:~ $ piTest -w O_11,1
Set bit 2 on byte at offset 160. Value 1
3) Measure the voltage at the O_11 pin: 12.06V
4) Set to 0 the output 11:
pi@RevPi30661:~ $ piTest -w O_11,0
Set bit 2 on byte at offset 160. Value 0
5) Measure the voltage at the O_11 pin: 11.74V.
The O_11 is sinking some current but not enough to set the output to 0. I've tested other outputs with same result.
The voltage supply for the output part (upper connector) is 12V
The voltage supply for the logic (down connector) is 24V.
Their gnd's are not shared, but I've tried to join them with same results.
Also, if I remove the relay, the voltage at the output when set to 1 is 12.06, and when set to 0 is 10.16V!
If i set the register OutputPushPull to 1024 (bit to set to pushpull the O_11), I've same results.
Seems like the OutputPushPull don't do nothing to the outputs, or there is some hardware problem.
I will try the same with a DO module to check it.
Edit: tested with a brand new DO module, same results: I can not achieve a 0V output, only 10V when is open circuit and 11.75V when is the relay connected.
Last edited by Abel on 13 Oct 2020, 11:06, edited 2 times in total.
https://www.circontrol.com - Mobility & eMobility Solutions
Re: OutputPushPull register seems not to work
Hello Abel,
The outputs are only configured after a driver reset (piTest -x) or at startup. When a driver reset is performed the register in the process image is overwritten with the value set in pictory.
In your case this means if you run piTest -x after your first step and you readout the OutputPushPull (piTest -r OutputPushPull) there should be 0 instead of 65535 in this register.
So just set the OutputPushPull-value to 65535 in pictory and try again.
The outputs are only configured after a driver reset (piTest -x) or at startup. When a driver reset is performed the register in the process image is overwritten with the value set in pictory.
In your case this means if you run piTest -x after your first step and you readout the OutputPushPull (piTest -r OutputPushPull) there should be 0 instead of 65535 in this register.
So just set the OutputPushPull-value to 65535 in pictory and try again.
Re: OutputPushPull register seems not to work
Ok, now it's working, but not by using the console commands:
1) I've set the OutputPushPull to 65535 in the Pictory config.
2) I've selected 'Save as Start-Config' in the File menu
3)I've made a reset driver from the Tools menu.
The voltage read at the output is 0.08V!
As you said, writing to OutputPushPull and doing a reset driver from command line don't work. A 'Save as Start-Config' step is needed.
This saving of the configuration can be done from the command line?
1) I've set the OutputPushPull to 65535 in the Pictory config.
2) I've selected 'Save as Start-Config' in the File menu
3)I've made a reset driver from the Tools menu.
The voltage read at the output is 0.08V!
As you said, writing to OutputPushPull and doing a reset driver from command line don't work. A 'Save as Start-Config' step is needed.
This saving of the configuration can be done from the command line?
https://www.circontrol.com - Mobility & eMobility Solutions
Re: OutputPushPull register seems not to work
You have to set the OutputPushPull-value via Pictory the way you did.
Writing it via commandline will not work because it will be overwritten with the pictory-value on the the next driver reset. Once your pictory configuration is saved as start-config this setup will be used on every startup/driver reset.
The output-status can of course still be changed on the commandline with piTest -w O_11,0 and piTest -w O_11,1 .
Writing it via commandline will not work because it will be overwritten with the pictory-value on the the next driver reset. Once your pictory configuration is saved as start-config this setup will be used on every startup/driver reset.
The output-status can of course still be changed on the commandline with piTest -w O_11,0 and piTest -w O_11,1 .
With this i just wanted to show that the value is being overwritten with the pictory-value on a driver reset. I guess this was a bit misleading.In your case this means if you run piTest -x after your first step and you readout the OutputPushPull (piTest -r OutputPushPull) there should be 0 instead of 65535 in this register.