Lt. Gov. Richard J. Davis, the Democratic U.S. Senate candidate, won the resounding endorsement of the Virginia AFL-CIO convention here today a year after that body had refused to back either Davis or his running mate, Gov. Charles S. Robb.

Davis, considered a moderate-to-conservative on labor issues by Virginia standards, won the labor group's support after pledging to keep an open line of communications with union members.

"If the past is any guide to the present, you and I can anticipate some differences over the best path to what we all want--jobs for Virginia," Davis told the 600 delegates attending the union's 22nd constitutional convention. "My door never has been closed to anyone, and never will be closed to anyone."

Union members here acknowledged that Davis' positions on two key labor issues had not changed since the group denied Davis and Robb their endorsement last year. Davis and Robb support the state's Right to Work law, which prohibits union membership as a precondition of employment, and oppose collective bargaining for public employes.

But those issues carried less weight than labor concern over the impact of Reaganomics, which Davis' Republican opponent, Rep. Paul S. Trible Jr. of Newport News, has supported.

"We've got two choices," said Daniel G. Leblanc, president of the 10,000-member Virginia Machinists Council, who led the convention fight against Robb last year. "We can go with a man like Paul Trible, who wants to put unions back in a sweatshop, or we can go with a fellow like Dick Davis, who is proven to be even-handed."

The AFL-CIO support is expected to bring Davis, who lags behind Trible in raising funds by more than 2 to 1, necessary financial contributions and campaign workers. After his speech today, for instance, the sheet metal worker's union presented Davis with a check for $5,000.

In Virginia, a state with less than 10 percent of its work force unionized, the labor endorsement is not crucial. Robb and Davis won without it, and staunch prolabor candidates in Virginia often encounter an antilabor backlash.

Indeed, the Davis endorsement came only hours after Trible distributed a tough antilabor statement that cast Davis in the role of a union sympathizer whose friendship with labor could cost the taxpayers millions of dollars. and which cast the moderate Davis in the role of a union sympathizer whose positions cost the taxpayers millions of dollars.

Trible aides said they had not timed their announcement to steal the spotlight from Davis. "Unlike our opponent, we were not invited to give our views on these matters today, so we must use other methods to discuss them," said Trible's spokesman, Neil Cotiaux.

Yet, Trible's statement ticking off the congressman's conservative views on labor issues spurred Davis to defend and clarify his positions in a hallway press conference.

In his statement, Trible recounted his support for a federal Right-to-Work law and for the repeal of the Davis-Bacon Act, which requires that construction workers on federal projects be paid at union scale. Trible charged that the law has added some $149 million to the cost of building the Metro transit system alone.

Davis sided squarely with union members over the issues raised in Trible's statement. He said he opposed the repeal of Davis-Bacon, as well as the passage of a federal Right-to-Work law.

Davis also said he opposed a measure, cosponsored by Trible, which would make it a federal offense, carrying a penalty of up to 20 years in prison, to engage in violence associated with picket lines or other union activities. Labor unions have argued that such a measure would effectively stifle union organizing activities.

"My opponent tells people to read the want ads if they want a job," Davis told the labor crowd that repeatedly interrupted him with applause. "I can tell you that you can read the want ads until hell freezes over, but it won't give you a job if you don't have a job."