Anugerah Nuri Satria
Posts: 35
Joined: Tue Mar 13, 2018 11:10 am

Define output from terminal

Wed Jul 01, 2020 3:13 am

i am new with raspberry pi. i have a small project. i need to count time if the supplied power to the machine is cut. that's mean when the machine is at 'OFF' state the counter will start counting and if the machine back on to the 'ON' state the counter stop the counting.

the problem is I need to define that time as AR1, AR2 or AR3.
Can we make input before the terminal give ouput?
So I get the off time of the machine and the definition why the machine is off? (AR1, AR2 or AR3)

btw, this is for counting the OEE of a machine.

Thanks in advance

Heater
Posts: 15944
Joined: Tue Jul 17, 2012 3:02 pm

Re: Define output from terminal

Wed Jul 01, 2020 3:38 am

Your question is not clear.

The Pi itself cannot count time at all when it is powered off.

That means that for it to know the time it has been powered off it will need some external hardware, with it's own battery or other power supply, to measure the down time.

Or you could do it by making use of NTP servers over the network.

I think you have to elaborate on what you are actually trying to do there.
Memory in C++ is a leaky abstraction .

Anugerah Nuri Satria
Posts: 35
Joined: Tue Mar 13, 2018 11:10 am

Re: Define output from terminal

Wed Jul 01, 2020 3:44 am

Heater wrote:
Wed Jul 01, 2020 3:38 am
Your question is not clear.

The Pi itself cannot count time at all when it is powered off.

That means that for it to know the time it has been powered off it will need some external hardware, with it's own battery or other power supply, to measure the down time.

Or you could do it by making use of NTP servers over the network.

I think you have to elaborate on what you are actually trying to do there.
sorry its my mistake to not make it clear

yes the pi and the machine have different power supply, the pi just connected to machine only to detect if the supply power to the machine is off and count the duration of that.

probably i will use octocoupler to reduce the voltage to fit the GPIO voltage.

Return to “General discussion”