BEIJING  Defense Secretary Robert M. Gates met his Chinese counterpart, Liang Guanglie, in Vietnam on Monday for the first time since the two militaries suspended talks with each other last winter, calling for the two countries to prevent “mistrust, miscalculations and mistakes.”

His message seemed directed mainly at officers like Lt. Cmdr. Tony Cao of the Chinese Navy.

Days before Mr. Gates arrived in Asia, Commander Cao was aboard a frigate in the Yellow Sea, conducting China’s first war games with the Australian Navy, exercises to which, he noted pointedly, the Americans were not invited.

Nor are they likely to be, he told Australian journalists in slightly bent English, until “the United States stops selling the weapons to Taiwan and stopping spying us with the air or the surface.”

The Pentagon is worried that its increasingly tense relationship with the Chinese military owes itself in part to the rising leaders of Commander Cao’s generation, who, much more than the country’s military elders, view the United States as the enemy. Older Chinese officers remember a time, before the Tiananmen Square protests in 1989 set relations back, when American and Chinese forces made common cause against the Soviet Union.