Hello,
Thank you for contacting National Instruments.
"1.What is the difference between Port and Line?"
A Port is a collection of lines. Usually 8 lines to a port.
"What's the difference of Line nad Portin these function DIG_In_Line, DIG_Out_Prt, DIG_Line_Config, DIG_In_Prt, DIG_Out_Prt, DIG_Prt_Config"
These functions either perform an output or input, or configure your digital ports and lines. Please see the Traditional NI-DAQ Function Reference Help found under Start >> All Programs >> National Instruments >> NI-DAQ >> Traditional NI-DAQ Function Reference Help for more information on these functions.
"2.If I would like to apply gate to my counter application, is it possible that we give the gate signal via software? Or I need to connect signal from hardware? If hardware is needed, is it possible to apply another counter's output as my counter's gate input?"
You can apply a gate signal from software. For example you can use the 6602's Timebase to gate your counter during pulse measurement applications. You can also route a counter's output to the gate of another counter internally. Look up Select_Signal in the Function Reference Help for more details.
"3.Can we apply gate to this function ND_PULSE_TRAIN_GNR?"
I am not sure what you are asking here. ND_PULSE_TRAIN_GNR is a parameter used in the GPCTR_Set_Application function to set up a counter for pulse generation. Please see the page titled "application = ND_PULSE_TRAIN_GNR: GPCTR_Set_Application" in the Function Reference Help more more information about this parameter.
"4.Can we detect the counter's source is High or Low ?Is there any fuction to read out the source status?"
There is no function to read the state of the source pin. You will need to route the source pin to a PFI line and perform a digital read on that line.
I hope this answers your questions. Please feel free to reply if you have any further questions.