When the nation's traveling-carnival operators invited a Nevada-based federal highway official to address their Las Vegas convention last month, the speech he delivered was not exactly what they expected.

The official, Douglas M. Irwin of the Bureau of Motor Carrier Safety in Carson City, told the carnivals to shape up.

Federal and state highway officials are cracking down on unsafe commercial vehicles, he said. Inspection stations are being beefed up, newly trained crews will be looking to make sure that tire treads are adequate, brakes are in good shape, drivers have had enough sleep and their log books have been properly completed.

As if to punctuate his warning in advance, just before the convention a traveling carnival in New Jersey was charged with more than 500 violations and hit with a $500 fine for each violation. That carnival owner later pleaded guilty and negotiated a lower fine.

While much of the federal government under the Reagan administration is in the business of deregulating, the Bureau of Motor Carrier Safety in the Federal Highway Administration is stepping up its role. For about 200,000 interstate carriers on the nation's highways, that means meet the standards or be prepared to face stiff fines or even jail terms.

With a grant made possible by a 5-cent-a-gallon gasoline-tax increase passed by a lame-duck Congress in November 1982, Nevada and 44 other states -- as well as the District of Columbia, Puerto Rico and the Virgin Islands -- have begun tough new enforcement of federal highway standards that officials said have previously been neglected and ignored.

"Up until now, it's always been a mild rap on the fingers when you get caught because there's not that much enforcement," said R.K. Larson, executive director of the Outdoor Amusement Business Association. "I would say that every traveling carnival in the United States has some minor violation -- treads too thin, drivers working too many hours." But now, he added, "Uncle Sam has embarked on a whole new mission."

Said Irwin, "They get us confused with ICC Interstate Commerce Commission , which is deregulating. We're not deregulating -- we're going to get tougher as far as safety is concerned."

The nickle gasoline-tax increase, approved with much White House fanfare as a way to restore the nation's crumbling infrastructure, also authorized money for motor-carrier safety, in the form of grants to states whose highway standards meet federal guidelines. Congress approved $14 million for the current fiscal year, the first full year that the program will be financed.

The legislation calls for an 80 percent federal contribution to be "matched" by 20 percent in state money. "We're not going to fund what they've already been doing," said William R. Fiste, deputy director of the Bureau of Motor Carrier Safety in Washington. "This program goes above and beyond that. It's an enhancement of what the states are doing."

The money is available either to develop a carrier-safety program, or to better implement an existing program.

Only Alaska, Florida, Oklahoma, South Carolina, Wyoming and the Northern Mariana trust territory in the Pacific Ocean are now excluded, mainly because of local political bickering over how to bring their existing regulations into compliance with the U.S. standards.

The District of Columbia has received $50,000 this year to develop a program, the maximum allowable for an area still in the development phase.

Fiste said the crackdown is aimed at improving safety by finding minor violations and at better regulating the transport of hazardous materials. Basically, the money will allow states to step up the number and staffing of roadside-inspection stations, supplementing the skeletal 150-person federal inspection force.

Besides closer inspection of tires and brakes, crews will be better trained to inspect hazardous materials. Dogs at some stations will be used to sniff out drugs, and computer hook-ups at some stations will allow inspectors to check whether a driver has been charged elsewhere with other violations.

Traveling carnivals are among the worst highway offenders, according to transportation officials and the head of the carnival-owners' group. There are about 500 carnivals in the country, with more than 25,000 vehicles, hauling amusement rides and portable concession stands to county fairs and festivals across the country.

The show packs up and drives overnight to the next stop, often after working long hours, with the drivers getting little or no rest along the way.

"They've had a bad reputation for years because they have a lot of transient-type people," Irwin said. "For them, transportation is a secondary business."

One federal regulation requires that log books -- detailing such information as the drivers' hours on the road right down to the length of his coffee breaks -- be sent back to a main office. But for many traveling carnivals, the "main office" is the cab of the lead truck.

"They might have to hire a secretarial service," said Larson of the Outdoor Amusement Business Association. "Once a carnival hits the road, he brings his secretary and everybody with him. They follow the sun. It's a whole new set of compliance problems for us."

With winter coming, Larson said, "Carnivals right now are in the barn. What we're trying to do is bring our members up to date, so when they hit the road next spring they won't have to be late for the next county fair."

Neill Darmstadter, senior safety engineer of the American Trucking Association, said, "Basically, it's a program the American trucking industry supports. Those fly-by-night operations are going to have to straighten up." But he added that the program must be enforced uniformly around the country to be fair.