AMS DCB-274 manual Programming Example

Page 41

ADVANCED MICRO SYSTEMS, INC.

SMC-27X2 SOFTWARE

The PLC option flag 8 has no affect on the output behavior.

Port 4 as an output (as shipped):

1.Install JP1and JP2 in off (storage) position.

2.Insure that P4 input option flag 32 (“ l” command) is off.

Port 4 is controlled by the “A 8” (flag 8) command and read back with the A 129 command. The step pulse is output to P4 when the step/direction out (option flag 2) is set.

Port 5 is an output only. It is turned on with “A 16” command (flag 16). Setting option flag 4 will convert P4 to a moving status output.

Port

Flag

Port

Flag

 

 

 

 

1

1

4

8

2

2

5

16

3

4

129

Read Port

Reading the port data (A 129) provides the following result information:

Data

Cause (Standard Mode)

Cause (PLC Mode)

 

 

 

1

Low input present on port 1

High input present on port 1

2

Low input present on port 2

High input present on port 2

4

Low input present on port 3

High input present on port 3

8

Low input present on port 4

High input present on port 4

3

Low on ports 1 and 2

High on ports 1 and 2

15

Low on ports 1, 2, 3 and 4

High on ports 1, 2, 3 and 4

Flags are the binary “weight” of the decimal value (0, 1, 2, 4, 8, 16, 32, 64 and 128 for an 8-bit number).

Programming Example

The following example program shows how to turn on an output port. Some uses for this could be illuminating an LED to signal a sequence is complete, or to operate a valve.

P 0 Enter program mode.

A 4 Turn on port 3.

W 60 Wait 600milliseconds.

A 6 Turn on port 2 and 3. W 10 Wait 100ms.

A 0 Turn off all ports.

P0 Exit program mode.

Note: the actual ports usable for output is determined by the hardware design. AMS products generally define ports 4 and 5 as outputs.

3 5

Image 41
Contents Nashua, NH Page Revision Date 07/05/06 Page Advanced Micro SYSTEMS, INC Addenum Limitations or Exceptions for the DCB-274 IntroductionProduct Overview FeaturesSIN-8 Required Hardware for OperationOut of the Box Quick Start Dual Ammeter Circuit After Sign-onConnect the Motor Serial Interface J2, J3 Connections J1, J4 Advanced Micro SYSTEMS, INC HardwareInput Ports Pin 7 VIO Reference InputStandard Mode- Sinking Inputs PLC Mode- Sourcing InputsOutput Ports Typical User Input CircuitTypical Output Circuit Encoder Input Option J1Port Encoder Inputs J1 Power Supply and Motor Connection J5Step and Direction Inputs J1 Baud Rate Jumpers B1, B2 Typical Wiring Diagrams for Step MotorsElectrical SpecificationsEnvironmental PhysicalPhysical Dimensions RS-232 Hardware OverviewRS-232 RS-422RS-232 Daisy Chain connection Single axis, RS-232 connection using AMS SIN-7 adapterRS-422 Party Line Hardware Cable SpecificationsParty Line Connect RS-422 Party LineSIN-8, RS-232 to RS-422 converter SIN-8 Serial AdapterRS-422/485 BUS-drop SIN-10, intelligent serial line converter Other Party Line SignalsSIN-10 Intelligent Serial Adapter Daisy Chain Mode not recommended for more than 1 axis Party Line ModeSerial Communications Overview Serial Communications SoftwareBaud Rate Serial Interface Using EasiEasi Software Sign-OnExamine Command Axis Name Assignment Simple Command ExamplesDaisy Chain Start-Up Execute the Program NV Memory ProgrammingVerify the Program Some Rules Party Line and Daisy Chain Line CommandsEdit Program Party Line Startup Command ExampleAnatomy of Instruction Execution Command Cycle Examples Interrupt CommandsAdvanced Micro SYSTEMS, INC Serial Interface Advanced Micro SYSTEMS, INC Serial Interface Memory Map Non-Volatile Memory Details Turbo Ram Default Table@ Soft Stop Command Format DescriptionESC Global Abort Port Read/Write ResetInputs OutputsProgramming Example Lower case B Fast and Slow Decay Set Jog SpeedsDivide Speeds Clear and Restore NV MemoryFind Home Normally Open Home SwitchNormally Closed Home Switch Special case Go Initial Velocity Step ResolutionRamp Slope Lower case I Restart Special TripJump to Address a, n+1 times Lower case K Trip Output Value Advanced Micro SYSTEMS, INC SMC-27X2 Software Flags and Numbers Loop on PortLower case L Option Flags Limit Polarity Flag PLC Mode FlagMake Step and Direction Outputs Flag Moving Output FlagGentle Limit Flag Move at a Constant VelocityPort 4 Input Flag Set Origin Program ModeIndex Relative to Origin Trip Point SaveSet Slew Speed Lower case W Pre-energize WaitHold and Run Current ExamineRead Position Read Limits, Hardware Read NV MemoryIndex in Minus Direction + Index in Plus Direction\ Write to NV Memory Read Moving StatusName Axis Selective TerminationAMS SIN-11 Serial Adapter Party Line ModeAdvanced Micro SYSTEMS, INC Addendum Command SummaryCtrl Char Dec Hex Code Ascii Character CodeAbout Step Motor Current Step Motor CharacteristicsDetermining the Current Value Motor ChoiceBasic 8 Wire Motor Amps and Wire Count and PowerWire Motor Decay Control Application Notes V1.10 Double Speed CharacteristicsSerial Adapter Summary