Saturday, November 30, 2019

Function: strcmp()

C/C++ Programing:

strcmp( leftString[], rightString[] ) 

This function can return three different integer values based on the comparison:

1. Zero

2. An integer greater than zero

3. An integer less than zero.

......................................................................

Code:

int main()

      
    char leftStr[] = "g f g";
    char rightStr[] = "g f g";
      
    // Using strcmp()
    int res = strcmp(leftStr, rightStr);
      
    if (res==0)
        printf("Strings are equal");
    else 
        printf("Strings are unequal");
      
    printf("\nValue returned by strcmp() is:  %d" , res);
    return 0;
}
.........................................................................

Output: when both string are same it will return zero.

Strings are equal
Value returned by strcmp() is:  0


Source

Wednesday, November 13, 2019

What is control valve?

  • A valve with a pneumatic, hydraulic, electric or other externally powered actuator that automatically opens or closes the valve fully or partially by the signals received from controlling instruments is called control valve.
"A control valve is a valve used to control fluid flow by varying the size of the flow passage as controlled by a signal from a controller."
Parts of Control Valve:
  1. Bellows
  2. Positioner
  3. Stem
Input Signals:

How to check a capacitor?


The capacitor can be checked with a battery operated avometer as below:
  • At first a good capacitor shows "dead short" any two terminals  then the resistance reading gradually starts build up as the capacitor begins to charge up to the battery voltage.
  • A good capacitor shows almost an infinite resistance between the terminals and the earthing points from the very beginning.

Friday, November 1, 2019

What is battery power density?

Power density:

It defines power capacity of a battery for a given mass of volume.

For example 100 Wh/Kg (Alkaline battery standard power density) implies that for 1 Kg of chemical composition it provides 100 Wh of power capacity.

Now, volume of a AAA alkaline battery is 11.5 grams. So if 1Kg can give 100 Wh capacity, then how much a 11.5 gram AAA battery can give?? 

Let’s calculate.

Wh (for 11.5 gm) = 100*11.5/1000 = 1.15 Wh

 

So, we know the nominal voltage of alkaline battery is 1.5V. So it provides 1.5V * (1.15/1.5)A * 1 hour gives 0.76 Ah = 760 mAh of power capacity which is almost equal to the power capacity of a standard AAA alkaline battery.