Schneider Electric BM85 Test and Demonstration Source Files, Multitasking in Your Application

Page 71

4.3.3Test and Demonstration Source Files

The following files provide source code examples that you can use in your development. They can also be modified and used as test programs for exercising and testing your BM85.

File Name

Purpose

TEST0.C

Displays a code on the BM85 LED indicators

 

 

TEST1.C

Shows Modbus Plus master and slave operation

 

 

TEST2.C

Demonstrates multitasking using the BM85 indicators

 

 

TEST3.C

Demonstrates floating point emulator

 

 

TEST4.C

Simulates process control with multitasking, C++ conventions

 

 

TEST5.C

Same as TEST4.C, but uses C conventions

 

 

TEST6.C

RS232 port loopback test

 

 

TEST7.C

RS232/RS485 port loopback test, long term

 

 

TEST8.C

Sample large program (240K) for download testing

 

 

Using the Test and Demonstration Source Files

To use any file, first copy it to the filename BM85.C, then modify that file for your BM85 application and compile it. Download the executable BM85.EXE to the BM85 using the BM85LOAD utility. For example, the download can be run within the Borland 3.1 environment using the following sequence:

Key Sequence

Purpose

Alt±space

Transfer menu

 

 

m

BM85 download

 

 

4.3.4Multitasking in Your Application

The BM85 library includes functions that you can use to construct a routine for assigning and controlling multiple tasks or threads within your application. Multitasking is handled on a cooperative basis: an active task routine must make periodic calls to an arbitration routine, allowing that routine to either continue the calling task or handle another pending task.

Your demonstration programs TEST4.C and TEST5.C provide source examples of the use of the library's multitasking functions. TEST4.C is coded in C++. TEST5.C is coded in C for programmers who are more familiar with that language.

890 USE 103 00

Configuring the Programmable Models

61

Image 71
Contents August Page Preface PrefacePage Contents Vi Contents Chapter Configuring the Modbus ModelsDica0+. C+de/ D1.i*g D+3*+adi*g Chapter Configuring the Programmable ModelsAppendix a Compatible Devices and Cables Chapter Installing the BM85Viii Contents Figures Glossary IndexPage Introducing the BM85 Bridge/Multiplexers Chapter Introducing the BM85 Bridge/MultiplexersBM85 on Modbus Plus Bridge/Multiplexers on Modbus PlusModbus Plus Network BM85 Bridge/Multiplexers on Modbus Plus Mounting Methods Overview of BM85 ModelsAvailable Models Configuration Methods Operating PowerProgrammable Port Models BM85 With Typical RS232/485 Devices Downloading the Application Configuring the Programmable ModelsDeveloping the Application Part Number Description Software Development Tool KitContact Telephone Modbus Port Models BM85 With Typical Modbus Devices Bridge/Multiplexer Models for AC/DC Power Specifications AC/DC Power ModelsDevelopment Requirement Supplied by Customer Bridge/Multiplexer Models for DC/DC Power Specifications DC/DC Power ModelsSoftware Development Tool Kit Page Device Addressing and Message Routing Chapter Device Addressing Message RoutingRouting to Programmable Controllers Modbus Plus Message Routing PathsRouting to a Single Slave Device on BM85 Modbus Models Routing to Host Based Network AdaptersRouting to BM85 Bridge/Multiplexers Routing to Serial Ports on BM85 Programmable ModelsModbus Port Models Modbus Address ConversionProgrammable Port Models Silent Master Port Addressing Routing Examples Routing ExamplesFrom Address Routing Method From Routing PathPage Configuring the Modbus Models Chapter Configuring Modbus ModelsModels Covered in This Chapter An Overview of the Configuration ProcessBefore You Start Required Equipment Configuration Checklist Information You Will Need Modbus Port ParametersNetwork Port TypeMaster SlavePort Priority Setting the ParameterSlave Device Address Communication ParametersLink Timeout Timeout Examples How the Parameter Applies to the BM85 Modem BoosterModem Booster Example Table Location Modbus Address Five±Byte Routing Path Modbus Address MapIf a Match is Not Found Configuring the Modbus Models Silent Master Port Considerations Setting the Switches Configuring the Modbus PortsConnecting Power for the Configuration Connecting the Terminal Command Action Range Your Configuration CommandsParameter Port Default ConfigurationHelp Screens V5, V6, V7 Your Configuration ScreensEntering Commands Into Your Screens Saving the Configuration Printing the ConfigurationYour V1 Screen Layout Your V1 ScreenExample Using the V1 ScreenYour V2 or V3 Screen Layout Your V2 and V3 ScreensUsing the V2 or V3 Screen Your V4 Screen Layout Your V4 ScreenEnter Using the V4 ScreenBM85 Modbus Models Modbus Plus Address Switches Setting the Modbus Plus AddressHow to Set the RUN Mode Setting the RUN ModeWhen to Set the RUN Mode Indicators Pattern Hexadecimal Digit Modbus Port Indicator CodesHardware Error Codes 11 .. Hex Modbus Driver Error Codes 24 .. E HexLLC Layer Error Codes 81 ... A3 Hex Modbus Plus Processor Interface Error Codes 34 .. HexPage Configuring the Programmable Models Chapter Configuring Programmable ModelsBefore You Start Equipment For Downloading the Application Program Equipment for Writing the Application ProgramFile Name Purpose Overview of the Development SoftwareDevelopment Software Files README.DOC Information FileKey Sequence Purpose Using the Test and Demonstration Source FilesTest and Demonstration Source Files Multitasking in Your ApplicationInstallation Steps Installing the Development SoftwareDefault Parameters Key Sequence Purpose Alt±C Project close Preparing the BM85 for Downloading BM85 Programmable Models Configuration Switches Setting the Configuration SwitchesBM85 Programmable Models Modbus Plus Address Switches Normal Download Codes Indicator Codes During DownloadingError Codes Error Code Hexadecimal MeaningSetting the RUN Mode Installing the BM85 Installing the BM85Shelf/Panel Mounted Models Installing the BM85 HardwareMounting the BM85 Part Number Mounting Method Rack Mounted ModelsHorizontal Mounting Vertical MountingRear Panel View Front Panel View Connecting DC Power Connecting the Power CablesConnecting AC Power BM85±000 Rear Panel BM85000 Connecting the Network and Serial CablesConnecting Serial Port Cables Connecting a Single Network CableConnecting Dual Network Cables Connecting Dual-Cable Units on Single-Cable NetworksModbus and Serial Port Indicators Reading the IndicatorsPower and Ready Indicators Modbus Plus Port Status Indicators Modbus Plus Port Label Attaching Identification LabelsSerial Port Parameters Label Serial Port Parameters LabelPage Compatible Devices and Cables Appendix a Compatible Devices CablesModicon Devices and Cables Compatible Devices and CablesAbbreviations Making `Quick ConnectionsDevice Cable and Adapter Combination Devices and Cables for Configuring Modbus PortsCables for Modbus Master Devices Cables for Modbus Slave DevicesModbus/RS232 Cable Wiring Diagrams Modbus/RS232 Cable Wiring DiagramsSerial Ports Pinout ± Modbus/RS232 BM85 Direction Purpose Modbus/RS232 Ports PinoutSerial Ports Pinout ± RS485 BM85 Direction Purpose RS485 Ports PinoutBit AcknowledgementAddress Baud rateCarrierband Bridge PlusBroadband BusDrop cable DIO Drop AdapterDistributed I/O DownloadHost computer Frame descriptorGlobal Input Global OutputModbus Plus LayerMedium ModbusOSI Model ModemNetwork Option Module NodeProtocol Peer-to-peer communicationPhysical Layer PortSpecific Input SegmentSerial port Slot timeToken SystemTap TerminatorPage Index IndexIndex