Asia .ru - поставки из Китая опт, китайские товары, производители в Китае, Японии, Корее, КНР и др. странах Азии.
доставка цветов по краснодару . help-my-gadget.ru
Asia .ru - поставки из Китая опт, китайские товары, производители в Китае, Японии, Корее, КНР и др. странах Азии.
доставка цветов по краснодару . help-my-gadget.ru
Motor Frame Size - VintageMachinery.org Knowledge Base (Wiki)
INTRODUCTIONOver the last century or so electric motors for industrial use have evolved significantly. They have increased in efficiency and reduced in size. In addition, the motor ratings have been standardized by the National Electric Manufacturers Association (NEMA).
One of the primary standardizations has been in the area of motor frame sizes. Motors rated with the same horsepower, speed, and enclosure will normally have the same frame size from different motor manufacturers. Obviously, this has great benefits for equipment owners faced with the prospect of changing motors.
THREE GENERATIONS (pre 1952,1952-1964, 1964-present)The standardization effort over the last forty years has resulted in one original grouping of frame sizes called original. In 1952, new frame assignments were made. These were called U frames. The current T frames were introduced in 1964 and continue to be the standard frame designation for electric motors. There are still many U frame motors in service that will have to be replaced in the future. There are fewer original frame size motors (pre-1952) but they may be found on some OWWM. The replacement of these motors continues to be a challenge and it is hoped that this information will assist in finding suitable replacement motors for your OWWM.
FRAME SIZESThe attached PDF file shows the standard frame size assignments for the three different generations of motors. There are separate tables for open drip proof (table 1) and totally enclosed fan cooled (table 2) motors. For each horsepower rating and speed, there are three different frame sizes. The first is the original frame size, the middle one is the U (1952-1964) frame size, and the third one is the T (1964-present) frame.
Base mounting hole spacing (also referred to as the E and F dimensions) and shaft height (referred to as the D dimension) will remain constant for all frames having the same three digits regardless of vintage. Most of the dimensions are standard dimensions that are common to all motor manufacturers.
HORSEPOWER RATING vs TEMPERATUREOver the years, motors' horsepower ratings have continued to increase. This is in part due to improvements made in insulating materials. As a result of this improved insulation, motors can be run much hotter than they could in the past. This allows more horsepower to be developed from a given motor size. The original NEMA frame sizes ran at very low temperatures. The U frame motors were designed for use with Class A insulation, which has a rating of 105 degrees Celsius. T frame motor designs are based on utilization of Class B insulation with a temperature rating of 130 degrees Celsius. In order to address the increase in horsepower available from a motor, the shaft and bearing sizes had to be increased. You will find that the original 254 frame motor (5 HP at 1800 RPM) had a 1-1/8 inch shaft. The 254U frame (7-1/2 HP at 1800 RPM) has a 1-3/8 inch shaft, and the current 254T frame (15 HP at 1800 RPM) has a 1-5/8 inch shaft. Bearing diameters were also increased to accommodate the larger shaft sizes and heavier loads associated with the higher horsepowers. Of course this means changing motors may necessitate sourcing of new pulleys, etc.
FRACTIONAL HORSEPOWER MOTORSThe term "fractional horsepower" is used to cover those frame sizes having two digit designations as opposed to the three digit designations that are found in Tables 1 and 2. The frame sizes that are normally associated with industrial fractional horsepower motors are 42, 48, and 56. For these motors, the frame size designates a particular shaft height, shaft diameter, and face or base mounting hole pattern. Frame designations are not based upon horsepower and speed, so it is possible that a given horsepower and speed combination may be available in one, two or even three three different frame sizes. The two digit frame number is based on the shaft height in sixteenths of an inch. Therefore, a size 48 frame motor will have a shaft height of 48 ÷ 16 = 3 inches. A 56 sized frame motor would have a shaft height of 3-1/2 inches. Size 56 frame motors are the largest of the fractional horsepower rated motors are may actually be found in horsepower ratings up to 3 HP and in some rare cases, 5 HP. This makes the term "fractional" somewhat misleading.
INTEGRAL HORSEPOWER MOTORSThe term Integral Horsepower Motors generally refers to those motors having three digit frame sizes such as 143T or larger. In these motors, the centerline shaft height (D dimension) above the bottom of the base is the first two digits of the frame size divided by four. For example, a 254T frame would have a shaft height of 25 ÷ 4 = 6.25 inches. Although the last digit does not directly relate to an inch dimension, larger numbers do indicate that the rear bolt holes are moved further away from the shaft end bolt holes (the F dimension becomes larger).
FRAME SIZE VARIATIONS (NEMA SUFFIXES)In addition to the standard numbering system for frames, there are some standardized variations that are denoted by the following suffixes to the NEMA number.
C Designates a C flange/face mounted motor, e.g., "NEMA 56C frame". This is the most popular type of face mounted motor and has a specific bolt pattern on the shaft end to allow mounting. The critical items on C face motors are the bolt circle (AJ dimension), rabbet diameter (AK dimension) and the shaft size (U dimension). C flange motors always have threaded mounting holes in the face of the motor.
D The D flange/face mounted motor. This motor has a special type of mounting flange installed on the shaft end. In the case of the D flange, the flange diameter is larger than the body of the motor and it has clearance holes suitable for mounting bolts to pass through from the back of the motor into threaded holes in the mating part. D flange motors are not as popular as C flange motors.
H Used on some 56 frame motors, H indicates that the base is suitable for mounting in either 56, 143T, or 145T mounting dimensions.
J This designation is used with 56 frame motors and indicates that the motor is made for jet pump service with a threaded stainless steel shaft and standard 56C face.
JM JM designate a special pump shaft originally designed for a mechanical seal. This motor also has a C face.
JP Similar to the JM style of motor having a special shaft, the JP motor was originally designed for a packing type of seal. The motor also has a C face.
S S in a motor frame designates that the motor has a short shaft. Short shaft motors have shaft dimensions that are smaller than the shafts associated with the normal frame size. short shaft motors are designed to be directly coupled to a load through a flexible coupling (Love-Joy, etc.). They are not designed for use in belt drive applications.
T A T indicates that the motor is of the 1964 and later T frame vintage.
U A U indicates that the motor is of the 1952-1964 U frame vintage.
Y A Y indicates that the motor has a special mounting configuration. No details may be assumed regarding this designation. These motors are generally made to manufacturers specifications. These are the hardest motors to find suitable replacements.
Z A Z indicates the existence of a special shaft. The shaft may be longer, larger, or have special features such as threads, holes, etc.
MANUFACTURER VARIATIONS (NEMA PREFIXES)Manufacturers use prefixes to specify variations within a frame size, such as the overall motor length. There is no standardization of prefixes and you must check with the manufacturer to learn the meaning of a prefix.
FRAME SIZE CHARTFrame sizes (PDF)
Vehicle frame - WikipediaA vehicle's bare ladder frame
A vehicle frame is the main supporting structure of a motor vehicle to which all other components are attached, comparable to the skeleton of an organism.
Until the 1930s, virtually every car had a structural frame, separate from its body. This construction design is known as body-on-frame. Over time, nearly all passenger cars have migrated to unibody construction, meaning their chassis and bodywork have been integrated into one another.
Nearly all trucks, buses, and most pickups continue to use a separate frame as their chassis.
The main functions of a frame in motor vehicles are:
- To support the vehicle's mechanical components and body
- To deal with static and dynamic loads, without undue deflection or distortion.
- Weight of the body, passengers, and cargo loads.
- Vertical and torsional twisting transmitted by going over uneven surfaces.
- Transverse lateral forces caused by road conditions, side wind, and steering the vehicle.
- Torque from the engine and transmission.
- Longitudinal tensile forces from starting and acceleration, as well as compression from braking.
- Sudden impacts from collisions.
Types of frame according to the construction:
- Ladder type frame
- X-Type frame
- Off set frame
- Off set with cross member frame
- Perimeter Frame
Frame railsPickup truck frame. Notice hat-shaped crossmember in the background, c-shape rails and cross member in center, and a slight arc over the axle.
Typically the material used to construct vehicle chassis and frames is carbon steel; or aluminum alloys to achieve a more light-weight construction. In the case of a separate chassis, the frame is made up of structural elements called the rails or beams. These are ordinarily made of steel channel sections, made by folding, rolling or pressing steel plate.
There are three main designs for these. If the material is folded twice, an open-ended cross-section, either C-shaped or hat-shaped (U-shaped) results. "Boxed" frames contain chassis rails that are closed, either by somehow welding them up, or by using premanufactured metal tubing.
C-shapeBy far the most common, the C-channel rail has been used on nearly every type of vehicle at one time or another. It is made by taking a flat piece of steel (usually ranging in thickness from 1/8" to 3/16") and rolling both sides over to form a c-shaped beam running the length of the vehicle.
HatHat frames resemble a "U" and may be either right-side-up or inverted with the open area facing down. Not commonly used due to weakness and a propensity to rust, however they can be found on 1936–1954 Chevrolet cars and some Studebakers.High performance custom frame, using boxed rails and tube sections
Abandoned for a while, the hat frame gained popularity again when companies started welding it to the bottom of unibody cars, in effect creating a boxed frame.
BoxedOriginally, boxed frames were made by welding two matching C-rails together to form a rectangular tube. Modern techniques, however, use a process similar to making C-rails in that a piece of steel is bent into four sides and then welded where both ends meet.
In the 1960s, the boxed frames of conventional American cars were spot-welded here and there down the seam; when turned into NASCAR "stock car" racers, the box was continuously welded from end to end for extra strength.
Design featuresPickup truck chassis holding the vehicle's engine, drivetrain, suspension, and wheels
While appearing at first glance as a simple form made of metal, frames encounter great amounts of stress and are built accordingly. The first issue addressed is beam height, or the height of the vertical side of a frame. The taller the frame, the better it is able to resist vertical flex when force is applied to the top of the frame. This is the reason semi-trucks have taller frame rails than other vehicles instead of just being thicker.
As looks, ride quality, and handling became more important to consumers, new shapes were incorporated into frames. The most visible of these are arches and kick-ups. Instead of running straight over both axles, arched frames sit lower—roughly level with their axles—and curve up over the axles and then back down on the other side for bumper placement. Kick-ups do the same thing, but don't curve down on the other side, and are more common on front ends.
Another feature seen are tapered rails that narrow vertically and/or horizontally in front of a vehicle's cabin. This is done mainly on trucks to save weight and slightly increase room for the engine since the front of the vehicle does not bear as much of a load as the back. Design developments include frames that use more than one shape in the same frame rail. For example, some pickup trucks have a boxed frame in front of the cab, shorter, narrower rails underneath the cab, and regular C-rails under the bed.
On perimeter frames, the areas where the rails connect from front to center and center to rear are weak compared to regular frames, so that section is boxed in, creating what is known as torque boxes.
So named for its resemblance to a ladder, the ladder frame is one of the simplest and oldest of all designs. It consists of two symmetrical beams, rails, or channels running the length of the vehicle, and several transverse cross-members connecting them. Originally seen on almost all vehicles, the ladder frame was gradually phased out on cars in favor of perimeter frames and unitized body construction. It is now seen mainly on trucks. This design offers good beam resistance because of its continuous rails from front to rear, but poor resistance to torsion or warping if simple, perpendicular cross-members are used. Also, the vehicle's overall height will be greater due to the floor pan sitting above the frame instead of inside it.
Unibody1942 Nash Ambassador 600 cutaway drawing Saab 9000 "safety cell" in red and orange (2005)
The term unibody or unit body is short for unitized body, or alternatively unitary construction design. This engineering approach of a vehicle describes "of a vehicle, a one-piece frame and body structure"
A type of body/frame construction in which the body of the vehicle, its floor plan and chassis form a single structure. Such a design is generally lighter and more rigid than a vehicle having a separate body and frame.
Traditional body-on-frame architectures has shifted to the lighter unitized body structure that is now used on most cars. The last UK mass-produced car with a separate chassis was the Triumph Herald, which was discontinued in 1971.
Integral frame and body construction requires more than simply welding an unstressed body to a conventional frame. In a fully integrated body structure, the entire car is a load-carrying unit that handles all the loads experienced by the vehicle—forces from driving as well as cargo loads. Integral-type bodies for wheeled vehicles are typically manufactured by welding preformed metal panels and other components together, by forming or casting whole sections as one piece, or by a combination of these techniques. Although this is sometimes also referred to as a monocoque structure, because the car's outer skin and panels are made load-bearing, there are still ribs, bulkheads and box sections to reinforce the body, making the description semi-monocoque more appropriate.
The first attempt to develop such a design technique was on the 1922 Lancia Lambda to provide structural stiffness and a lower body height for its torpedo car body. The Lambda though its open layout, with unstressed roof, made it less a monocoque shell and more a bowl - 11,000 were produced.
A key role in developing the unitary body was played by the American firm the Budd Company, now ThyssenKrupp Budd. Budd supplied pressed-steel bodywork, fitted to separate frames, to automakers Dodge, Ford, Buick, and the French company, Citroën.
In 1930, Joseph Ledwinka, an engineer with Budd, designed an automobile prototype with full unitary construction.
Citroën purchased this fully unitary body design for the Citroën Traction Avant. This high volume, mass production car was introduced in 1934 and sold 760,000 units over the next 23 years of production. This application was the first iteration of the modern structural integration of body and chassis, using spot welded deep stamped steel sheets into a structural cage, including sills, pillars and roof beams. In addition to a unitary body with no separate frame, the Traction Avant also featured other innovations such as four-wheel independent suspension, and front-wheel drive. The result was a low-slung vehicle with an open, flat-floored interior.
For the Chrysler Airflow (1934–1937) Budd supplied a variation - three main sections from the Airflow's body were welded into what Chrysler called a bridge-truss construction. For the Chrysler Airflow unfortunately, this method was not ideal - panel fits were poor. To convince a skeptical public of the strength of unibody both Citroën and Chrysler created advertising films showing cars surviving after being pushed off a cliff.
Opel was the second European and the first German car manufacturer to produce a car with unibody structure - production of the compact Olympia started in 1935. A larger Kapitän went into production in 1938, although its front longitudinal beams were stamped separately and then attached to the main body.
The streamlined 1936 Lincoln-Zephyr with conventional front-engine, rear-wheel-drive layout utilized a unibody structure. By 1941, unit construction was no longer a new idea for cars, "but it was unheard of in the [American] low-price field [and] Nash wanted a bigger share of that market." The single unit body construction of the Nash 600 provided weight savings and Nash's Chairman and CEO, George W. Mason was convinced "that unibody was the wave of the future."
Since then more cars were redesigned to the unibody structure, which is now "considered standard in the industry". By 1960, unitized body design was used by Detroit's Big Three on their compact cars (Ford Falcon, Plymouth Valiant, and Chevrolet Corvair). After Nash merged with Hudson Motors to form American Motors, its Rambler-badged automobiles continued exclusively building variations of the unibody.
Although the 1934 Chrysler Airflow had a weaker than usual frame and body framework welded to the chassis to provide stiffness, in 1960, Chrysler moved from body-on-frame construction to a unit-body design for most of its cars.
Most of the American-manufactured unibody automobiles used torque boxes in their vehicle design to reduce vibrations and chassis flex, with the exception of the Chevy II which had a bolt-on front apron (erroneously referred to as a subframe). American Motors (with its partner Renault) during the late-1970s incorporated unibody construction when designing the Jeep Cherokee (XJ) platform using the manufacturing principles (unisides, floorpan with integrated frame rails and crumple zones, and roof panel) used in its passenger cars, such as the Hornets and all-wheel-drive Eagles for a new type of frame called the "Uniframe ... a robust stamped steel frame welded to a strong unit-body structure, giving the strength of a conventional heavy frame with the weight advantages of Unibody construction." This design was also used with the XJC concept developed by American Motors prior to its absorption by Chrysler, which later became the Jeep Grand Cherokee (ZJ). —including modern day sport utility vehicles (Jeep Grand Cherokee et al.).
The unibody is now the preferred construction for mass market automobiles and crossovers. This design provides weight savings, improved space utilisation, and ease of manufacture. Acceptance grew dramatically in the wake of the two energy crises of the 1970s and the 2000s where compact SUVs using a truck platform (primarily the USA market) were subjected to CAFE standards after 2005 (by the late-2000s truck-based compact SUVs were phased out and replaced with crossovers). An additional advantage of a strong-bodied car lies in the improved crash protection for its passengers.
A backbone chassis is a type of automobile construction chassis that is similar to the body-on-frame design. Instead of a two-dimensional ladder type structure, it consists of a strong tubular backbone (usually rectangular in cross section) that connects the front and rear suspension attachment areas. A body is then placed on this structure.
This is the design used for the full-size American models of General Motors in the late 1950s and early 1960s in which the rails from alongside the engine seemed to cross in the passenger compartment, each continuing to the opposite end of the crossmember at the extreme rear of the vehicle. It was specifically chosen to decrease the overall height of the vehicles regardless of the increase in the size of the transmission and propeller shaft humps, since each row had to cover frame rails as well. Several models had the differential located not by the customary bar between axle and frame, but by a ball joint atop the differential connected to a socket in a wishbone hinged onto a crossmember of the frame.
The X-frame was claimed to improve on previous designs, but it lacked side rails and thus did not provide adequate side-impact and collision protection. This design was replaced by perimeter frames.
Similar to a ladder frame, but the middle sections of the frame rails sit outboard of the front and rear rails just behind the rocker / sill panels. This was done to allow for a lower floor pan, especially at the passenger footwells, to lower the passengers' seating height and therefore reduce the overall vehicle height in passenger cars. This became the prevalent design for body-on-frame cars in the United States, but not in the rest of the world, until the uni-body gained popularity. It allowed for annual model changes introduced in the 1950s to increase sales, but without costly structural changes. As of 2014, there are no perimeter frame automobiles sold in the United States after the Ford Motor Company phased out the Panther platform in 2011, which ended the perimeter frame passenger car in the United States (the Chevrolet Corvette has used a variation of the perimeter frame since 1963, but its fourth generation variant to its current generation as of 2016 has elements of the perimeter frame integrated with an internal endoskeleton which serves as a clamshell).
In addition to a lowered roof, the perimeter frame allows lower seating positions when that is desirable, and offers better safety in the event of a side impact. However, the design lacks stiffness, because the transition areas from front to center and center to rear reduce beam and torsional resistance, hence the use of torque boxes, and soft suspension settings.
VW Beetle "platform frame" chassis.
Renault 4 "platform frame" chassis.
Where the Volkswagen frame design relies heavily on a strong backbone, the Renault design is much closer to that of a typical perimeter frame.
This is a modification of the perimeter frame, or of the backbone frame, in which the passenger compartment floor, and sometimes also the luggage compartment floor have been integrated into the frame as loadbearing parts, for extra strength and rigidity. Neither floor pieces are simply sheet metal straight off the roll, but have been stamped with ridges and hollows for extra strength.
Platform chassis were used on several successful European cars. The most well-known of this is the Volkswagen Beetle, on which it is called body on pan construction. Another German example are the Mercedes-Benz "Ponton" cars of the 1950s and 1960s, where it was called a "frame floor" in English-language advertisements.
The French Renault 4 of which over eight million were made, also used a platform frame. The frame of the Citroen 2CV represents a more minimal interpretation of a platform chassis.
In a (tubular) spaceframe chassis, the suspension, engine, and body panels are attached to a three-dimensional skeletal frame of tubes, and the body panels have little or no structural function. In order to maximise rigidity and minimise weight, the design makes maximum use of triangles, and all the forces in each strut are either tensile or compressive, never bending, so they can be kept as thin as possible.
The first true spaceframe chassis were produced in the 1930s by Buckminster Fuller and William Bushnell Stout (the Dymaxion and the Stout Scarab) who understood the theory of the true spaceframe from either architecture or aircraft design.
The 1951 Jaguar C-Type racing sports car that won the Le Mans 24 hours twice, had a lightweight multi-tubular, triangulated frame, over which an aerodynamic aluminium body was crafted.
The Italian term Superleggera (meaning "super-light") was trademarked by Carrozzeria Touring for lightweight sports-car body construction that only resembles a space-frame chassis. Using a three-dimensional frame that consists of a cage of narrow tubes that, besides being under the body, run up the fenders and over the radiator, cowl, and roof, and under the rear window, it resembles a geodesic structure. A skin is attached to the outside of the frame and is often made of aluminium. This body construction is however not stress-bearing, and still requires the addition of a chassis.The Lamborghini Aventador has a carbon fibre central monocoque, with front and rear steel subframes, mounting the mechanicals
A subframe is a distinct structural frame component, to reinforce or complement a particular section of a vehicle's structure. Typically attached to a unibody or a monocoque, the rigid subframe can handle high chassis forces and can transfer them evenly over a wide area of relatively thin sheet metal of a unitized body shell. Subframes are often found at the front or rear end of cars, and are used to attach the suspension to the vehicle. A subframe may also contain the engine and transmission. It is normally of box steel construction, but may be tubular.
Examples of passenger car use include the 1967–1981 GM F platform, the numerous years and models built on the GM X platform (1962), GM's M/L platform vans(Chevrolet Astro/GMC Safari, which included an all-wheel drive variant), and the unibody AMC Pacer that incorporated a front subframe to isolate the passenger compartment from engine, suspension, and steering loads.
- ^ Rajput, R. K. (2007). A textbook of automobile engineering. Laxmi Publications. p. 410. ISBN 9788170089919. Retrieved 28 February 2015.
- ^ "unibody". Dictionary.com. Retrieved 28 March 2016.
- ^ "unit body". engineering-dictionary.org. Retrieved 28 March 2016.
- ^ Visnic, Bill (1 September 2008). "Shift to Unitized Body No Slam Dunk". Wards Auto. Retrieved 28 March 2016.
- ^ a b Genta, Giancarlo; Morello, Lorenzo; Cavallino, Francesco; Filtri, Luigi (2014). The Motor Car Past, Present and Future. Springer. pp. 23–26. ISBN 9789400785519. Retrieved 28 March 2016.
- ^ a b c d e Simanaitis, Dennis (5 October 2011). "From the Carriage Trade to Carbon Fiber All about an automobile's body/chassis". Road and Track. Retrieved 10 August 2016.
- ^ "Joseph Ledwinka". Hagley Museum and Library. 29 May 2013. Retrieved 10 August 2016.
- ^ "20 Cars that Changed the Automotive Industry Forever". Magic Online. 13 October 2014. Retrieved 10 August 2016.
- ^ "The Designs of John Tjaarda Result in the 1936 Lincoln Zephyr". The Old Motor. 27 December 2014. Retrieved 28 March 2016.
- ^ Consumer Guide Auto Editors (1985). Great cars of the forties. Louis Weber. p. 54. ISBN 9780881762808. Retrieved 28 March 2016.
- ^ Ted, Tidious (8 July 2014). "Great American Cars Of The Forties – 1941 Nash 600". Retrorambling. Retrieved 28 March 2016.
- ^ "My Mother's Compact Car: Twenty Years Of Rambler". Automobile Quarterly. 33 (2): 33. Retrieved 28 March 2016.
- ^ a b Narus, Donald J. (2012). Nash, 1939-1954. New Albany Books. p. 27. ISBN 9781467521246. Retrieved 28 March 2016.
- ^ "Chrysler moves to Unibody (unit-body construction): 1960". allpar.com. Retrieved 28 March 2016.
- ^ Bruzek, Joe (22 October 2008). "What is unibody construction?". Ask.Cars.com. Retrieved 28 February 2015.
- ^ Foster, Patrick R. (2014). Jeep: The History of America's Greatest Vehicle. Motorbooks. p. 124. ISBN 9781627882187. Retrieved 28 March 2016.
- ^ Niedermeyer, Paul (19 January 2012). "Automotive History: An X-Ray Look At GM's X Frame (1957 – 1970)". Curb Side Classic. Retrieved 28 February 2015.
- ^ "Thread: Mercedes Benz 190SL, the "Teutonic T-bird" is born, 1954.." vwvortex.com. Retrieved 28 February 2015.
- ^ Ludvigsen, Karl (2010). Colin Chapman: Inside the Innovator. Haynes Publishing. pp. 150–164. ISBN 1-84425-413-5.
- ^ Burger, Gerry; Hendrickson, Steve (2000). Hot rodder's bible. MBI Publishing. pp. 123–124. ISBN 9780760307670. Retrieved 28 February 2015.
- ^ "AMC Pacer station wagon". Car and Driver. 22: 24. 1977. Retrieved 28 February 2015.
Рецепты крафта для RedPower 2 (часть 2) - 4 Июня 2012
2 2 +Но нажав ввод ничего не происходит. В чем же ошибка? Ошибка в том, что мы не указали что же надо вывести. Для вывода результата требуется добавить в конце ".".Выглядеть запись будет так:
2 2 + .Что мы узнали:1. Немного о структуре FORTh3. Вычисление в FORTh4. "." требуется для выведения результата
2. Более интересные вещи
Теперь пора научиться выводить тексты. Разберем на простом примере: "Hi!".
Для начала нужно создать саму программу:
: test"test" всего лишь название программы и может быть любым.
Программа создана, и мы приступаем к её написание.Пишем сообщение для вывода:
." Hi!"Нажимаем enter.Само сообщение заключается в кавычки. Пробел между первой кавычкой и сообщением обязателен.
Теперь осталось завершить программу с помощью ";". Точка с запятой сообщается компьютеру о завершении программа.
: test." Hi!";Теперь при вводе названия программы, в данном случае "test", будет выводиться ваше сообщение.
Что мы узнали:1. Как создать программу2. Как вывести сообщение на экран3. Как запустить программу
Пора научиться работать с редстоун сигналами. Для этого потребуется Декодер IO.
Для работы с сигналами используется слово IOX. У него есть несколько разновидностей:
IOX!IOX@IOXSETIOXRSTВначале рассмотрим IOX!. Он отправит сигнал в Декодер IO, который переведет 16 битный сигнал в связку проводов.Используется это так:
1 IOX!Будет послан 1 сигнал в белый провод, так как его код равен 1.
Узнать какой цвет задействован можно с помощью следующей команды:
IOX@ .Не забываем что для вывода информации требуется "."
Что же делать, если вам нужно отредактировать 1 сигнал, при этом не задев другие? Для этого используются команды IOXSET и IOXRST. IOXSET установит указанный бит в 1. IOXRST сбросит же к 0.Работает это так:
4 IOXSET4 IOXRSTБудет подан сигнал на розовый провод (3-ий провод = 4) и потом снова убран.
Что мы узнали:1. Как послать и получить редстоун сигнал через IOX2. Более продвинутые способы управлять битами
Следующее что мы будем рассматривать - переменные и константы.
Переменные - это места, где числа могут быть введены и сохранены пока не потребуются программы, могут меняться во время программы.Константы - подобные переменным, но не могут измениться, они постоянны, как число Пи.
Переменные и константы должны быть записаны перед запуском программы.
Определить переменную или константу можно так:
0 VARIABLE var0 CONSTANT constМы создаем переменную "var" и устанавливаем её на 0.
Если вам нужно модифицировать существующую переменную во время программы, то можно поступить так:
*Значение* *Имя переменной* !Новое значение переменной указывается с помощью пометки "!"
Программы, где переменные могут быть полезны:
VARIABLE time1 CONSTANT lump: testvar20 time !lump IOXSETtime @ TICKSlump IOXRST;Лампа присоединена к белому проводу, который является проводом 1, мы используем константу, чтобы сохранить число провода для использования позже в качестве постоянной "lump".time - отрезок времени, когда лампа включена, который равен 20 тикам или 1 секунде. Команду IOX мы рассматривали выше, так что нового в ней ничего. Команда TICKS очень проста - это задержка перед следующей функцией.Программа включает лампу и после одной секунды выключает её.
Что мы узнали:1. Что такое переменные и константы2. Как изменять переменные3. Узнали о практическом применении переменных и констант
Каждый раз вводить команду не очень удобно. Поэтому научимся работать с циклами. Для этого мы используем DO. DO будет повторять заданное действие указанное количество раз.Рассмотрим простой пример, в котором "test do loop" будет выведено на экран 10 раз:
: doloop10 0 DO." test do loop"LOOP;Второе число может использоваться в цикле, как разность между первым и вторым числом.
: doloop210 5 DO." test do loop 2"LOOP;Нам выведет "test do loop 2" 5 раз.
Рассмотрим теперь на примере с лампами, присоединенными к соответствующим проводам:
: doloop35 0 DO1 IOXSET40 TICKS1 IOXRST60 TICKSLOOP;
Лампа будет включена на 2 секунды (40 тиков) и потом выключится, через 3 секунды (60 тиков) снова будет включена. И так будет 5 раз.
На этом я заканчиваю краткий курс по FORTH.