By using "if (Serial.available() > 0) x = Serial.read()", we can collect data into variable x, only if we type the required string within the "Serial Monitor" of arduino.
Definitely NOT true.
Serial.print() writes to the hardware tx pin, Serial.Read() reads from the hardware rx pin.
You don't need to use UART.Read() but you can.
The serial monitor of the IDE can connect to the COM port (/dev/tty...) the Arduino has. This port is connected to the pins 0 and 1 too.
Any serial application can connect to the COM port (/dev/tty...) and read data from the Arduino. That is not restricted to the IDE.
My requirement, in short, is to collect a serial data into a variable.
x = Serial.Read() does just that.
What i am trying is, to transmit a data, for example, "Serial.myPrint("arduino");", which will be transmitted via the 'tx' pin 3(which is set as my software 'tx' pin; pin 2 is the software 'rx') and collect the same into a variable, via the 'rx' pin of arduino. I have shorted the 'tx' pin of arduino with the software 'rx' pin 2 and 'rx' pin of arduino with the software 'tx' pin 3.
The Arduino is single tasking and software serial is quite time critical so having it interrupted by the hardware serial my corrupt timing especially at higher baud rates.
What baud rate are you using?
As i mentioned, if we use "x=UART.Read()", i can read and collect a data being received by the 'rx' pin of arduino.
Does that mean you have it working now?