├── .github └── workflows │ └── publish-docs.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── RELEASE.md ├── configure ├── CONFIG ├── CONFIG_SITE ├── Makefile ├── RELEASE ├── RULES ├── RULES.ioc ├── RULES_DIRS └── RULES_TOP ├── docs ├── Makefile ├── requirements.txt └── source │ ├── K1_C20n_In_Word.png │ ├── K1_C20n_Out_Bit.png │ ├── K1_Cn_In_Bit_Array.png │ ├── K1_Cn_In_Word_Array.png │ ├── K1_Xn_Bit.png │ ├── K1_Xn_Bit_Statistics.png │ ├── K1_Yn_In_Word.png │ ├── K1_Yn_Out_Bit_Asyn.png │ ├── K1_Yn_Out_Bit_AsynRegister.png │ ├── K1_Yn_Out_Word.png │ ├── K2_ADCs.png │ ├── Koyo1.png │ ├── Koyo2.png │ ├── Modbus_Application_Protocol_V1_1b.pdf │ ├── Modbus_Messaging_Implementation_Guide_V1_0b.pdf │ ├── Modbus_over_serial_line_V1_02.pdf │ ├── _extra │ └── .keepdir │ ├── _static │ ├── css │ │ └── my_theme.css │ └── theme_overrides.css │ ├── acknowledgments.rst │ ├── conf.py │ ├── creating_driver.rst │ ├── debugging.rst │ ├── device_support.rst │ ├── driver_architecture.rst │ ├── example_applications.rst │ ├── index.rst │ ├── medm_screens.rst │ ├── overview.rst │ ├── testDataTypes.png │ └── testDataTypesSimulator.png ├── iocBoot ├── Makefile └── iocTest │ ├── Koyo1.cmd │ ├── Koyo1.substitutions │ ├── Koyo2.cmd │ ├── Koyo2.substitutions │ ├── Koyo_Sim1.cmd │ ├── Makefile │ ├── ModbusF1_A0_128bits.mbs │ ├── ModbusF3_A100_80words.mbs │ ├── ModbusF3_A200_80words.mbs │ ├── ModbusF3_A300_80words.mbs │ ├── array_test.cmd │ ├── array_test.substitutions │ ├── fc17_modicon.cmd │ ├── fc17_modicon.substitutions │ ├── sim2.cmd │ ├── sim2.substitutions │ ├── sim3.cmd │ ├── sim3.substitutions │ ├── sim4.cmd │ ├── sim4.substitutions │ ├── sim5.cmd │ ├── sim5.substitutions │ ├── sim6.cmd │ ├── sim6.substitutions │ ├── st.cmd │ ├── st.cmd.vxWorks │ ├── testAbsoluteAddress.cmd │ ├── testAbsoluteAddress.substitutions │ ├── testBitArray.pro │ ├── testDataTypes.cmd │ ├── testDataTypes.py │ ├── testDataTypes.substitutions │ └── testWordArray.pro ├── makeModbusPrebuilt └── modbusApp ├── Db ├── Makefile ├── ai.template ├── aiFloat64.template ├── ai_average.template ├── ao.template ├── aoFloat64.template ├── asynRecord.template ├── bi_bit.template ├── bi_word.template ├── bo_bit.template ├── bo_word.template ├── floatarray_in.template ├── floatarray_out.template ├── int64in.template ├── int64out.template ├── intarray_in.template ├── intarray_out.template ├── longin.template ├── longinInt32.template ├── longout.template ├── longoutInt32.template ├── mbbiDirect.template ├── mbboDirect.template ├── poll_delay.template ├── poll_trigger.template ├── statistics.template ├── stringWaveformIn.template ├── stringWaveformOut.template ├── stringin.template └── stringout.template ├── Makefile ├── op ├── Makefile ├── adl │ ├── Koyo1.adl │ ├── Koyo2.adl │ ├── Koyo_4ADC.adl │ ├── Koyo_8inputs.adl │ ├── Koyo_8outputs.adl │ ├── array_test.adl │ ├── modbusArray.adl │ ├── modbusArrayTest.adl │ ├── modbusDataTypes.adl │ ├── modbusDataTypesTest.adl │ ├── modbusStatistics.adl │ ├── modbusStringTest.adl │ ├── modbusStringTestTop.adl │ └── modbusTestSyncIO.adl ├── bob │ └── autoconvert │ │ ├── Koyo1.bob │ │ ├── Koyo2.bob │ │ ├── Koyo_4ADC.bob │ │ ├── Koyo_8inputs.bob │ │ ├── Koyo_8outputs.bob │ │ ├── array_test.bob │ │ ├── modbusArray.bob │ │ ├── modbusArrayTest.bob │ │ ├── modbusDataTypes.bob │ │ ├── modbusDataTypesTest.bob │ │ ├── modbusStatistics.bob │ │ ├── modbusStringTest.bob │ │ ├── modbusStringTestTop.bob │ │ └── modbusTestSyncIO.bob ├── edl │ └── autoconvert │ │ ├── Koyo1.edl │ │ ├── Koyo2.edl │ │ ├── Koyo_4ADC.edl │ │ ├── Koyo_8inputs.edl │ │ ├── Koyo_8outputs.edl │ │ ├── array_test.edl │ │ ├── modbusArray.edl │ │ ├── modbusArrayTest.edl │ │ ├── modbusDataTypes.edl │ │ ├── modbusDataTypesTest.edl │ │ ├── modbusStatistics.edl │ │ ├── modbusStringTest.edl │ │ ├── modbusStringTestTop.edl │ │ └── modbusTestSyncIO.edl ├── opi │ └── autoconvert │ │ ├── Koyo1.opi │ │ ├── Koyo2.opi │ │ ├── Koyo_4ADC.opi │ │ ├── Koyo_8inputs.opi │ │ ├── Koyo_8outputs.opi │ │ ├── array_test.opi │ │ ├── modbusArray.opi │ │ ├── modbusArrayTest.opi │ │ ├── modbusDataTypes.opi │ │ ├── modbusDataTypesTest.opi │ │ ├── modbusStatistics.opi │ │ ├── modbusStringTest.opi │ │ ├── modbusStringTestTop.opi │ │ └── modbusTestSyncIO.opi └── ui │ └── autoconvert │ ├── Koyo1.ui │ ├── Koyo2.ui │ ├── Koyo_4ADC.ui │ ├── Koyo_8inputs.ui │ ├── Koyo_8outputs.ui │ ├── array_test.ui │ ├── modbusArray.ui │ ├── modbusArrayTest.ui │ ├── modbusDataTypes.ui │ ├── modbusDataTypesTest.ui │ ├── modbusStatistics.ui │ ├── modbusStringTest.ui │ ├── modbusStringTestTop.ui │ └── modbusTestSyncIO.ui └── src ├── Makefile ├── drvModbusAsyn.cpp ├── drvModbusAsyn.h ├── modbus.h ├── modbusInterpose.c ├── modbusInterpose.h ├── modbusMain.cpp ├── modbusSupport.dbd ├── testClient.cpp └── testModbusSyncIO.cpp /.github/workflows/publish-docs.yml: -------------------------------------------------------------------------------- 1 | name: Publish Sphinx Docs to GitHub Pages 2 | on: 3 | # Build the docs on pushes to main branch, PRs to main branch, and new tags. 4 | # Publish only on demand. 5 | push: 6 | branches: 7 | - master 8 | tags: 9 | - '*' # all tags 10 | workflow_dispatch: # allow manual triggering 11 | inputs: 12 | deploy: 13 | description: 'Deploy documentation' 14 | type: boolean 15 | required: true 16 | default: false 17 | 18 | 19 | # see: https://sphinx-notes.github.io/pages/ 20 | # see: https://github.com/marketplace/actions/sphinx-to-github-pages 21 | 22 | jobs: 23 | 24 | build-docs: 25 | runs-on: ubuntu-latest 26 | 27 | steps: 28 | - name: Deploy Information 29 | if: ${{ github.event.inputs.deploy }} 30 | run: | 31 | echo "The will be published from this workflow run." 32 | 33 | - name: Checkout 34 | uses: actions/checkout@master 35 | with: 36 | fetch-depth: 0 # otherwise, you will fail to push refs to dest repo 37 | 38 | - name: Install pip 39 | run: | 40 | sudo apt-get -y update 41 | sudo apt-get -y install python3-pip 42 | which pip3 43 | which pip 44 | 45 | - name: Install packages used by Sphinx 46 | run: | 47 | pip install m2r2 "pygments >=2.7.0" "sphinx_rtd_theme >=1.2.0" sphinx-multibuild 48 | pip list 49 | 50 | - name: Build and Commit 51 | uses: sphinx-notes/pages@v2 52 | with: 53 | # path to conf.py directory 54 | documentation_path: docs/source 55 | 56 | - name: Push changes 57 | uses: ad-m/github-push-action@master 58 | with: 59 | github_token: ${{ secrets.GITHUB_TOKEN }} 60 | branch: gh-pages 61 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | O.* 3 | *.swp 4 | *BAK.adl 5 | bin/ 6 | /db/ 7 | dbd/ 8 | html/ 9 | _docs/ 10 | include/ 11 | lib/ 12 | templates/ 13 | __pycache__/ 14 | cdCommands 15 | envPaths 16 | dllPath.bat 17 | auto_settings.sav* 18 | auto_positions.sav* 19 | RELEASE.local 20 | 21 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".ci"] 2 | path = .ci 3 | url = https://github.com/epics-base/ci-scripts 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # .travis.yml for use with EPICS Base ci-scripts 2 | # (see: https://github.com/epics-base/ci-scripts) 3 | 4 | language: cpp 5 | compiler: gcc 6 | dist: xenial 7 | 8 | cache: 9 | directories: 10 | - $HOME/.cache 11 | 12 | env: 13 | global: 14 | - SETUP_PATH=.ci 15 | - MODULES="asyn" 16 | - ASYN=master 17 | 18 | addons: 19 | apt: 20 | packages: 21 | # for all EPICS builds 22 | - libreadline6-dev 23 | - libncurses5-dev 24 | - perl 25 | # for clang compiler 26 | - clang 27 | # for mingw builds (32bit and 64bit) 28 | - g++-mingw-w64-i686 29 | - g++-mingw-w64-x86-64 30 | # for RTEMS cross builds 31 | - qemu-system-x86 32 | homebrew: 33 | packages: 34 | # for all EPICS builds 35 | - bash 36 | # for the sequencer 37 | - re2c 38 | update: true 39 | 40 | install: 41 | - ./.ci/travis/prepare.sh 42 | 43 | script: 44 | - ./.ci/travis/build.sh 45 | 46 | # If you need to do more during install and build, 47 | # add a local directory to your module and do e.g. 48 | # - ./.ci-local/travis/install-extras.sh 49 | 50 | # Define build jobs 51 | 52 | # Well-known variables to use 53 | # SET source setup file 54 | # ADD_MODULES extra modules (for a specific job) 55 | # EXTRA content will be added to make command line 56 | # STATIC set to YES for static build (default: NO) 57 | # TEST set to NO to skip running the tests (default: YES) 58 | # VV set to make build scripts verbose (default: unset) 59 | 60 | # Usually from setup files, but may be specified or overridden 61 | # on a job line 62 | # MODULES list of dependency modules 63 | # BASE branch or release tag name of the EPICS Base to use 64 | # branch or release tag for a specific module 65 | # ... see README for setup file syntax description 66 | 67 | jobs: 68 | include: 69 | 70 | # Different configurations of default gcc and clang 71 | - env: BASE=7.0 72 | 73 | - env: BASE=7.0 74 | compiler: clang 75 | 76 | - env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11" 77 | 78 | - env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11" 79 | compiler: clang 80 | 81 | # Trusty: compiler versions very close to RHEL 7 82 | 83 | - env: BASE=7.0 84 | dist: trusty 85 | 86 | - env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11" 87 | dist: trusty 88 | 89 | # Cross-compilations to Windows using MinGW and WINE 90 | 91 | - env: BASE=7.0 WINE=32 TEST=NO STATIC=YES 92 | compiler: mingw 93 | 94 | - env: BASE=7.0 WINE=64 TEST=NO STATIC=NO 95 | compiler: mingw 96 | 97 | # Cross-compilation to RTEMS 98 | 99 | - env: BASE=7.0 RTEMS=4.10 TEST=NO 100 | 101 | - env: BASE=7.0 RTEMS=4.9 TEST=NO 102 | 103 | # Other gcc versions (added as an extra package) 104 | 105 | - env: BASE=7.0 106 | compiler: gcc-6 107 | addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } } 108 | 109 | - env: BASE=7.0 110 | compiler: gcc-7 111 | addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } } 112 | 113 | # MacOS build 114 | 115 | - env: BASE=7.0 116 | os: osx 117 | compiler: clang 118 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright and License Terms 2 | --------------------------- 3 | 4 | Copyright (c) 2007-2018 Mark L. Rivers 5 | Copyright (c) 2007-2018 The University of Chicago 6 | 7 | Permission is hereby granted, free of charge, to any person 8 | obtaining a copy of this software and associated documentation 9 | files (the "Software"), to deal in the Software without 10 | restriction, including without limitation the rights to use, 11 | copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the 13 | Software is furnished to do so, subject to the following 14 | conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | OTHER DEALINGS IN THE SOFTWARE. 27 | 28 | ________________________________________________________________________ 29 | 30 | Additional Disclaimers 31 | ---------------------- 32 | 33 | This software is copyright in part by these institutions: 34 | 35 | * The University of Chicago 36 | 37 | In no event shall these institutions be liable to any party for direct, 38 | indirect, special, incidental, or consequential damages arising out of 39 | the use of this software, its documentation, or any derivatives thereof, 40 | even if advised of the possibility of such damage. 41 | 42 | These institutions specifically disclaim any warranties, including, but 43 | not limited to, the implied warranties of merchantability, fitness for a 44 | particular purpose, and non-infringement. This software is provided on 45 | an "as is" basis, and these institutions have no obligation to provide 46 | maintenance, support, updates, enhancements, or modifications. 47 | 48 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #Makefile at top of application tree 2 | TOP = . 3 | include $(TOP)/configure/CONFIG 4 | DIRS := $(DIRS) $(filter-out $(DIRS), configure) 5 | DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *App)) 6 | DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *app)) 7 | DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard iocBoot)) 8 | modbusApp_DEPEND_DIRS = configure 9 | iocBoot_DEPEND_DIRS = modbusApp 10 | include $(TOP)/configure/RULES_TOP 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | An [EPICS](http://www.aps.anl.gov/epics/) 2 | module that supports communication with Programmable Logic Controllers (PLCs) and other devices 3 | via the Modbus protocol over TCP, serial RTU, and serial ASCII links. 4 | 5 | The modbus software provides a layer between standard EPICS asyn device support, 6 | and the EPICS asyn TCP/IP or serial port driver. 7 | 8 | Additional information: 9 | 10 | * [Documentation](https://epics-modules.github.io/modbus) 11 | * [Release notes](RELEASE.md) 12 | -------------------------------------------------------------------------------- /configure/CONFIG: -------------------------------------------------------------------------------- 1 | # CONFIG - Load build configuration data 2 | # 3 | # Do not make changes to this file! 4 | 5 | # Allow user to override where the build rules come from 6 | RULES = $(EPICS_BASE) 7 | 8 | # RELEASE files point to other application tops 9 | include $(TOP)/configure/RELEASE 10 | -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common 11 | ifdef T_A 12 | -include $(TOP)/configure/RELEASE.Common.$(T_A) 13 | -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) 14 | endif 15 | 16 | CONFIG = $(RULES)/configure 17 | include $(CONFIG)/CONFIG 18 | 19 | # Override the Base definition: 20 | INSTALL_LOCATION = $(TOP) 21 | 22 | # CONFIG_SITE files contain other build configuration settings 23 | include $(TOP)/configure/CONFIG_SITE 24 | -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common 25 | ifdef T_A 26 | -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) 27 | -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) 28 | endif 29 | 30 | -------------------------------------------------------------------------------- /configure/CONFIG_SITE: -------------------------------------------------------------------------------- 1 | # CONFIG_SITE 2 | 3 | # Make any application-specific changes to the EPICS build 4 | # configuration variables in this file. 5 | # 6 | # Host/target specific settings can be specified in files named 7 | # CONFIG_SITE.$(EPICS_HOST_ARCH).Common 8 | # CONFIG_SITE.Common.$(T_A) 9 | # CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) 10 | 11 | # CHECK_RELEASE controls the consistency checking of the support 12 | # applications pointed to by the RELEASE* files. 13 | # Normally CHECK_RELEASE should be set to YES. 14 | # Set CHECK_RELEASE to NO to disable checking completely. 15 | # Set CHECK_RELEASE to WARN to perform consistency checking but 16 | # continue building even if conflicts are found. 17 | CHECK_RELEASE = YES 18 | 19 | # Set this when you only want to compile this application 20 | # for a subset of the cross-compiled target architectures 21 | # that Base is built for. 22 | #CROSS_COMPILER_TARGET_ARCHS = vxWorks-ppc32 23 | 24 | # To install files into a location other than $(TOP) define 25 | # INSTALL_LOCATION here. 26 | #INSTALL_LOCATION= 27 | 28 | # Set this when the IOC and build host use different paths 29 | # to the install location. This may be needed to boot from 30 | # a Microsoft FTP server say, or on some NFS configurations. 31 | #IOCS_APPL_TOP = 32 | 33 | # For application debugging purposes, override the HOST_OPT and/ 34 | # or CROSS_OPT settings from base/configure/CONFIG_SITE 35 | #HOST_OPT = NO 36 | #CROSS_OPT = NO 37 | 38 | # These allow developers to override the CONFIG_SITE variable 39 | # settings without having to modify the configure/CONFIG_SITE 40 | # file itself. 41 | -include $(TOP)/../CONFIG_SITE.local 42 | -include $(TOP)/configure/CONFIG_SITE.local 43 | -include $(SUPPORT)/configure/CONFIG_SITE 44 | 45 | -------------------------------------------------------------------------------- /configure/Makefile: -------------------------------------------------------------------------------- 1 | TOP=.. 2 | 3 | include $(TOP)/configure/CONFIG 4 | 5 | TARGETS = $(CONFIG_TARGETS) 6 | CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) 7 | 8 | include $(TOP)/configure/RULES 9 | -------------------------------------------------------------------------------- /configure/RELEASE: -------------------------------------------------------------------------------- 1 | #RELEASE Location of external products 2 | # Run "gnumake clean uninstall install" in the application 3 | # top directory each time this file is changed. 4 | # 5 | # NOTE: The build does not check dependancies on files 6 | # external to this application. Thus you should run 7 | # "gnumake clean uninstall install" in the top directory 8 | # each time EPICS_BASE, SNCSEQ, or any other external 9 | # module defined in the RELEASE file is rebuilt. 10 | 11 | TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top 12 | 13 | SUPPORT=/corvette/home/epics/devel 14 | 15 | ASYN=$(SUPPORT)/asyn-4-45 16 | 17 | # If you don't want to install into $(TOP) then 18 | # define INSTALL_LOCATION_APP here 19 | #INSTALL_LOCATION_APP= 20 | 21 | # EPICS_BASE usually appears last so other apps can override stuff: 22 | EPICS_BASE=/corvette/usr/local/epics-devel/base-7.0.8 23 | 24 | #Capfast users may need the following definitions 25 | #CAPFAST_TEMPLATES= 26 | #SCH2EDIF_PATH= 27 | -include $(TOP)/../RELEASE.local 28 | -include $(TOP)/../RELEASE.$(EPICS_HOST_ARCH).local 29 | -include $(TOP)/configure/RELEASE.local 30 | 31 | -------------------------------------------------------------------------------- /configure/RULES: -------------------------------------------------------------------------------- 1 | # RULES 2 | 3 | include $(CONFIG)/RULES 4 | 5 | # Library should be rebuilt because LIBOBJS may have changed. 6 | $(LIBNAME): ../Makefile 7 | -------------------------------------------------------------------------------- /configure/RULES.ioc: -------------------------------------------------------------------------------- 1 | #RULES.ioc 2 | include $(CONFIG)/RULES.ioc 3 | -------------------------------------------------------------------------------- /configure/RULES_DIRS: -------------------------------------------------------------------------------- 1 | #RULES_DIRS 2 | include $(CONFIG)/RULES_DIRS 3 | -------------------------------------------------------------------------------- /configure/RULES_TOP: -------------------------------------------------------------------------------- 1 | #RULES_TOP 2 | include $(CONFIG)/RULES_TOP 3 | 4 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | SPHINX_MULTIBUILD=sphinx-multibuild 2 | 3 | DOCS_PATHS += -i . 4 | 5 | BUILD = _build 6 | SOURCE = source 7 | DOCS = _docs 8 | #OPTS = -v -v -v 9 | OPTS = 10 | 11 | .PHONY: all 12 | all: sphinx 13 | 14 | 15 | .PHONY: all 16 | sphinx: 17 | $(SPHINX_MULTIBUILD) -i $(SOURCE) -s $(DOCS) -o $(BUILD)/html $(OPTS) -b html 18 | 19 | .PHONY: clean 20 | clean: 21 | rm -rf _docs 22 | rm -rf _build 23 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx==1.8.5 2 | sphinx-bootstrap-theme 3 | m2r2 4 | sphinx-multibuild 5 | breathe 6 | -------------------------------------------------------------------------------- /docs/source/K1_C20n_In_Word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_C20n_In_Word.png -------------------------------------------------------------------------------- /docs/source/K1_C20n_Out_Bit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_C20n_Out_Bit.png -------------------------------------------------------------------------------- /docs/source/K1_Cn_In_Bit_Array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_Cn_In_Bit_Array.png -------------------------------------------------------------------------------- /docs/source/K1_Cn_In_Word_Array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_Cn_In_Word_Array.png -------------------------------------------------------------------------------- /docs/source/K1_Xn_Bit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_Xn_Bit.png -------------------------------------------------------------------------------- /docs/source/K1_Xn_Bit_Statistics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_Xn_Bit_Statistics.png -------------------------------------------------------------------------------- /docs/source/K1_Yn_In_Word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_Yn_In_Word.png -------------------------------------------------------------------------------- /docs/source/K1_Yn_Out_Bit_Asyn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_Yn_Out_Bit_Asyn.png -------------------------------------------------------------------------------- /docs/source/K1_Yn_Out_Bit_AsynRegister.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_Yn_Out_Bit_AsynRegister.png -------------------------------------------------------------------------------- /docs/source/K1_Yn_Out_Word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K1_Yn_Out_Word.png -------------------------------------------------------------------------------- /docs/source/K2_ADCs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/K2_ADCs.png -------------------------------------------------------------------------------- /docs/source/Koyo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/Koyo1.png -------------------------------------------------------------------------------- /docs/source/Koyo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/Koyo2.png -------------------------------------------------------------------------------- /docs/source/Modbus_Application_Protocol_V1_1b.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/Modbus_Application_Protocol_V1_1b.pdf -------------------------------------------------------------------------------- /docs/source/Modbus_Messaging_Implementation_Guide_V1_0b.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/Modbus_Messaging_Implementation_Guide_V1_0b.pdf -------------------------------------------------------------------------------- /docs/source/Modbus_over_serial_line_V1_02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/Modbus_over_serial_line_V1_02.pdf -------------------------------------------------------------------------------- /docs/source/_extra/.keepdir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/_extra/.keepdir -------------------------------------------------------------------------------- /docs/source/_static/css/my_theme.css: -------------------------------------------------------------------------------- 1 | @import url("theme.css"); 2 | 3 | .wy-nav-content { 4 | max-width: 90%; 5 | } 6 | 7 | /* override table width restrictions */ 8 | @media screen and (min-width: 767px) { 9 | 10 | .wy-table-responsive table td { 11 | /* !important prevents the common CSS stylesheets from overriding 12 | this as on RTD they are loaded after this stylesheet */ 13 | white-space: normal !important; 14 | } 15 | 16 | .wy-table-responsive { 17 | overflow: visible !important; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/source/_static/theme_overrides.css: -------------------------------------------------------------------------------- 1 | /* override table width restrictions */ 2 | @media screen and (min-width: 767px) { 3 | 4 | .wy-table-responsive table td { 5 | /* !important prevents the common CSS stylesheets from overriding 6 | this as on RTD they are loaded after this stylesheet */ 7 | white-space: normal !important; 8 | } 9 | 10 | .wy-table-responsive { 11 | overflow: visible !important; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/source/acknowledgments.rst: -------------------------------------------------------------------------------- 1 | Acknowledgments 2 | --------------- 3 | 4 | The **modbus** package is based on the `modtcp and plctcp 5 | packages `__ 6 | written by Rolf Keitel from Triumf. The **modtcp** package was 7 | originally converted to Linux by Ivan So from NSLS. **modbus** was 8 | extensively re-written for conversion to EPICS 3.14 and to use the EPICS 9 | asyn module. It now contains little of the original **modtcp** code, but 10 | retains much of the original architecture. 11 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # 2 | # modbys documentation 3 | 4 | import sys, os 5 | 6 | project = 'modbus' 7 | html_title = html_short_title = 'EPICS support for Modbus' 8 | 9 | authors = 'Mark Rivers' 10 | copyright = '2023, Mark Rivers' 11 | 12 | extensions = ['sphinx.ext.autodoc', 13 | 'sphinx.ext.mathjax', 14 | 'sphinx.ext.extlinks', 15 | 'sphinx.ext.napoleon'] 16 | 17 | todo_include_todos = True 18 | 19 | templates_path = ['_templates'] 20 | source_suffix = '.rst' 21 | source_encoding = 'utf-8' 22 | master_doc = 'index' 23 | today_fmt = '%Y-%B-%d' 24 | 25 | exclude_trees = ['_build'] 26 | 27 | add_function_parentheses = True 28 | add_module_names = False 29 | pygments_style = 'sphinx' 30 | 31 | # html themes: 'default', 'sphinxdoc', 'alabaster', 'agogo', 'nature', 'pyramid' 32 | #html_theme = 'pyramid' 33 | html_theme = 'sphinx_rtd_theme' 34 | 35 | html_static_path = ['_static'] 36 | html_style = 'css/my_theme.css' 37 | html_last_updated_fmt = '%Y-%B-%d' 38 | html_show_sourcelink = True 39 | htmlhelp_basename = 'modbus_doc' 40 | -------------------------------------------------------------------------------- /docs/source/debugging.rst: -------------------------------------------------------------------------------- 1 | Debug tracing 2 | ------------- 3 | 4 | One can obtain diagnostic output for a **modbus** port driver using the 5 | "dbior" or "asynPrint" commands at the iocsh or vxWorks shell. 6 | "asynReport" with no arguments will print a brief report for all asyn 7 | drivers, including the drvAsynIPPort or drvAsynSerialPort driver that 8 | **modbus** drivers are connected to, and for all **modbus** port 9 | drivers. For example, a partial output for the Koyo1 application when it 10 | is connected via TCP is: 11 | 12 | :: 13 | 14 | epics> asynReport 15 | Koyo1 multiDevice:No canBlock:Yes autoConnect:No 16 | Port 164.54.160.158:502: Connected 17 | K1_Xn_Bit multiDevice:Yes canBlock:No autoConnect:Yes 18 | addr 0 autoConnect Yes enabled Yes connected Yes exceptionActive No 19 | addr 1 autoConnect Yes enabled Yes connected Yes exceptionActive No 20 | addr 2 autoConnect Yes enabled Yes connected Yes exceptionActive No 21 | addr 3 autoConnect Yes enabled Yes connected Yes exceptionActive No 22 | addr 4 autoConnect Yes enabled Yes connected Yes exceptionActive No 23 | addr 5 autoConnect Yes enabled Yes connected Yes exceptionActive No 24 | addr 6 autoConnect Yes enabled Yes connected Yes exceptionActive No 25 | addr 7 autoConnect Yes enabled Yes connected Yes exceptionActive No 26 | modbus port: K1_Xn_Bit 27 | K1_Xn_Word multiDevice:Yes canBlock:No autoConnect:Yes 28 | addr 0 autoConnect Yes enabled Yes connected Yes exceptionActive No 29 | 30 | To obtain more detailed information, one can request information for a 31 | specific **modbus** port driver, and output level >0 as follows: 32 | 33 | :: 34 | 35 | epics> asynReport 5, "K1_Xn_Word" 36 | K1_Xn_Word multiDevice:Yes canBlock:No autoConnect:Yes 37 | enabled:Yes connected:Yes numberConnects 1 38 | nDevices 1 nQueued 0 blocked:No 39 | asynManagerLock:No synchronousLock:No 40 | exceptionActive:No exceptionUsers 0 exceptionNotifys 0 41 | interfaceList 42 | asynCommon pinterface 0x4001d180 drvPvt 0x8094f78 43 | asynDrvUser pinterface 0x4001d10c drvPvt 0x8094f78 44 | asynUInt32Digital pinterface 0x4001d118 drvPvt 0x8094f78 45 | asynInt32 pinterface 0x4001d134 drvPvt 0x8094f78 46 | asynFloat64 pinterface 0x4001d148 drvPvt 0x8094f78 47 | asynInt32Array pinterface 0x4001d158 drvPvt 0x8094f78 48 | addr 0 autoConnect Yes enabled Yes connected Yes exceptionActive No 49 | exceptionActive No exceptionUsers 1 exceptionNotifys 0 50 | blocked No 51 | modbus port: K1_Xn_Word 52 | asyn TCP server: Koyo1 53 | modbusFunction: 3 54 | modbusStartAddress: 040400 55 | modbusLength: 010 56 | plcType: Koyo 57 | I/O errors: 0 58 | Read OK: 5728 59 | Write OK: 0 60 | pollDelay: 0.100000 61 | Time for last I/O 3 msec 62 | Max. I/O time: 12 msec 63 | 64 | To obtain run-time debugging output for a driver use the 65 | asynSetTraceMask and asynSetTraceIOMask commands. For example the 66 | following commands will show all I/O to and from the PLC from the 67 | underlying drvAsynIPPort driver: 68 | 69 | :: 70 | 71 | epics> asynSetTraceIOMask "Koyo1",0,4 # Enable traceIOHex 72 | epics> asynSetTraceMask "Koyo1",0,9 # Enable traceError and traceIODriver 73 | epics> 74 | 2007/04/12 17:27:45.384 164.54.160.158:502 write 12 75 | 76 | 00 01 00 00 00 07 ff 02 08 00 00 20 77 | 2007/04/12 17:27:45.390 164.54.160.158:502 read 13 78 | 79 | 00 01 00 00 00 07 ff 02 04 00 00 00 00 80 | 2007/04/12 17:27:45.424 164.54.160.158:502 write 12 81 | 82 | 00 01 00 00 00 07 ff 03 41 00 00 08 83 | 2007/04/12 17:27:45.432 164.54.160.158:502 read 25 84 | 85 | 00 01 00 00 00 13 ff 03 10 00 00 00 00 00 00 00 00 00 00 00 86 | 00 00 00 00 00 87 | ... 88 | epics> asynSetTraceMask "Koyo1",0,1 # Turn off traceIODriver 89 | 90 | The following command shows the I/O from a specific **modbus** port 91 | driver: 92 | 93 | :: 94 | 95 | epics> asynSetTraceIOMask "K1_Yn_In_Word",0,4 # Enable traceIOHex 96 | epics> asynSetTraceMask "K1_Yn_In_Word",0,9 # Enable traceError and traceIODriver 97 | epics> 98 | 2007/04/12 17:32:31.548 drvModbusAsyn::doModbusIO port K1_Yn_In_Word READ_REGISTERS 99 | 09 00 00 00 00 00 00 00 100 | 2007/04/12 17:32:31.656 drvModbusAsyn::doModbusIO port K1_Yn_In_Word READ_REGISTERS 101 | 09 00 00 00 00 00 00 00 102 | 2007/04/12 17:32:31.770 drvModbusAsyn::doModbusIO port K1_Yn_In_Word READ_REGISTERS 103 | 09 00 00 00 00 00 00 00 104 | 2007/04/12 17:32:31.878 drvModbusAsyn::doModbusIO port K1_Yn_In_Word READ_REGISTERS 105 | 09 00 00 00 00 00 00 00 106 | 2007/04/12 17:32:31.987 drvModbusAsyn::doModbusIO port K1_Yn_In_Word READ_REGISTERS 107 | 09 00 00 00 00 00 00 00 108 | epics> asynSetTraceMask "K1_Yn_In_Word",0,1 # Disable traceIODriver 109 | 110 | One can also load an EPICS asyn record on a **modbus** port, and then 111 | use EPICS channel access to turn debugging output on and off. The 112 | following medm screen shows how to turn on I/O tracing using this 113 | method. 114 | 115 | asynRecord.adl 116 | ~~~~~~~~~~~~~~ 117 | Using the asynRecord to turn on traceIODriver and traceIOHex for debugging. 118 | 119 | .. figure:: K1_Yn_In_Word.png 120 | :align: center 121 | 122 | The asyn record can also be used to perform actual I/O to the PLC. 123 | For example the following screen shots shows the asyn record being used to control output Y1 on a PLC. 124 | Note that the ADDR field is set to 1 (to select Y1) and the data set to 1 (to turn on the output). 125 | Each time the asyn record is processed the value will be sent to the PLC. 126 | 127 | .. figure:: K1_Yn_Out_Bit_Asyn.png 128 | :align: center 129 | 130 | asynRegister.adl 131 | ~~~~~~~~~~~~~~~~ 132 | Using the asynRecord to perform actual I/O to a PLC. 133 | Note that Interface (IFACE)=asynUInt32Digital, Transfer (TMOD)=Write, and Output (UI32OUT)=1. 134 | This value will be written to the Y1 output when the record is processed. 135 | 136 | .. figure:: K1_Yn_Out_Bit_AsynRegister.png 137 | :align: center -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | modbus 2 | ====== 3 | 4 | :author: Mark Rivers, University of Chicago 5 | 6 | This is an EPICS module for communicating with Modbus devices using asyn device support. 7 | 8 | Table of Contents 9 | ----------------- 10 | 11 | .. toctree:: 12 | :maxdepth: 3 13 | 14 | acknowledgments 15 | overview 16 | driver_architecture 17 | creating_driver 18 | device_support 19 | example_applications 20 | medm_screens 21 | debugging 22 | -------------------------------------------------------------------------------- /docs/source/medm_screens.rst: -------------------------------------------------------------------------------- 1 | medm screens 2 | ------------ 3 | 4 | **modbus** provides example medm .adl files in the modbusApp/op/adl 5 | directory. 6 | 7 | modbusDataTypes.adl 8 | ~~~~~~~~~~~~~~~~~~~ 9 | The following is a screen shot from an IOC running the testDataTypes.cmd 10 | and testDataTypes.substitutions files, communicating with a Modbus Slave Simulator. 11 | These are the ao/ai records using the asynFloat64 interface. 12 | It shows that the output and input (readback) records agree. 13 | 14 | .. figure:: testDataTypes.png 15 | :align: center 16 | 17 | The following is a screen shot from the Modbus Slave Simulator communicating 18 | with the ao/ai records shown above. The values shown in this screen agree 19 | with this in the medm screen, showing that each Modbus data type is being communicated correctly. 20 | 21 | .. figure:: testDataTypesSimulator.png 22 | :align: center 23 | 24 | The following are screen shots of these screens from an IOC 25 | controlling a Koyo DL205 PLC. 26 | 27 | Koyo1.adl 28 | ~~~~~~~~~ 29 | Top level medm screen for the Koyo1 example application. 30 | 31 | .. figure:: Koyo1.png 32 | :align: center 33 | 34 | Koyo_8inputs.adl 35 | ~~~~~~~~~~~~~~~~ 36 | Inputs X0-X7 read as discrete inputs (function code 1). 37 | 38 | .. figure:: K1_Xn_Bit.png 39 | :align: center 40 | 41 | Inputs C200-C207 read as register inputs (function code 6). 42 | 43 | .. figure:: K1_C20n_In_Word.png 44 | :align: center 45 | 46 | Koyo_8outputs.adl 47 | ~~~~~~~~~~~~~~~~~ 48 | Outputs Y0-Y7 written using register access (function code 6). 49 | 50 | .. figure:: K1_Yn_Out_Word.png 51 | :align: center 52 | 53 | Outputs Outputs C200-C207 written using bit access (function code 5). 54 | 55 | .. figure:: K1_C20n_Out_Bit.png 56 | :align: center 57 | 58 | modbusArray.adl 59 | ~~~~~~~~~~~~~~~ 60 | Inputs C0-C377 read using a waveform record and coil access (function code 1). 61 | 62 | .. figure:: K1_Cn_In_Bit_Array.png 63 | :align: center 64 | 65 | Inputs C0-C377 read using a waveform record and register access (function code 3). 66 | 67 | .. figure:: K1_Cn_In_Word_Array.png 68 | :align: center 69 | 70 | modbusStatistics.adl 71 | ~~~~~~~~~~~~~~~~~~~~ 72 | I/O statistics for the Modbus driver that is reading inputs X0-X37 using register access (function code 3). 73 | The histogram is the number of events versus TCP/IP write/read cycle time in msec. 74 | 75 | .. figure:: K1_Xn_Bit_Statistics.png 76 | :align: center 77 | 78 | Koyo2.adl 79 | ~~~~~~~~~ 80 | Top level medm screen for the Koyo2 example application. 81 | 82 | .. figure:: Koyo2.png 83 | :align: center 84 | 85 | Koyo_4ADC.adl 86 | ~~~~~~~~~~~~~ 87 | 4 ADC inputs from a 13-bit bipolar ADC. 88 | 89 | .. figure:: K2_ADCs.png 90 | :align: center 91 | 92 | -------------------------------------------------------------------------------- /docs/source/testDataTypes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/testDataTypes.png -------------------------------------------------------------------------------- /docs/source/testDataTypesSimulator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/docs/source/testDataTypesSimulator.png -------------------------------------------------------------------------------- /iocBoot/Makefile: -------------------------------------------------------------------------------- 1 | TOP = .. 2 | include $(TOP)/configure/CONFIG 3 | DIRS += $(wildcard *ioc*) 4 | DIRS += $(wildcard as*) 5 | include $(EPICS_BASE)/configure/RULES_DIRS 6 | 7 | -------------------------------------------------------------------------------- /iocBoot/iocTest/Koyo1.cmd: -------------------------------------------------------------------------------- 1 | # Koyo1.cmd 2 | 3 | < envPaths 4 | 5 | dbLoadDatabase("../../dbd/modbusApp.dbd") 6 | modbusApp_registerRecordDeviceDriver(pdbbase) 7 | 8 | # Use the following commands for TCP/IP 9 | #drvAsynIPPortConfigure(const char *portName, 10 | # const char *hostInfo, 11 | # unsigned int priority, 12 | # int noAutoConnect, 13 | # int noProcessEos); 14 | drvAsynIPPortConfigure("Koyo1","164.54.160.158:502",0,0,0) 15 | asynSetOption("Koyo1",0, "disconnectOnReadTimeout", "Y") 16 | #modbusInterposeConfig(const char *portName, 17 | # modbusLinkType linkType, 18 | # int timeoutMsec, 19 | # int writeDelayMsec) 20 | modbusInterposeConfig("Koyo1",0,5000,0) 21 | 22 | # Use the following commands for serial RTU or ASCII 23 | #drvAsynSerialPortConfigure(const char *portName, 24 | # const char *ttyName, 25 | # unsigned int priority, 26 | # int noAutoConnect, 27 | # int noProcessEos); 28 | #drvAsynSerialPortConfigure("Koyo1", "/dev/ttyS1", 0, 0, 0) 29 | #asynSetOption("Koyo1",0,"baud","38400") 30 | #asynSetOption("Koyo1",0,"parity","none") 31 | #asynSetOption("Koyo1",0,"bits","8") 32 | #asynSetOption("Koyo1",0,"stop","1") 33 | 34 | # Use the following command for serial RTU 35 | # Note: non-zero write delay (last parameter) may be needed. 36 | #modbusInterposeConfig("Koyo1",1,1000,0) 37 | 38 | # Use the following commands for serial ASCII 39 | #asynOctetSetOutputEos("Koyo1",0,"\r\n") 40 | #asynOctetSetInputEos("Koyo1",0,"\r\n") 41 | # Note: non-zero write delay (last parameter) may be needed. 42 | #modbusInterposeConfig("Koyo1",2,1000,0) 43 | 44 | # NOTE: We use octal numbers for the start address and length (leading zeros) 45 | # to be consistent with the PLC nomenclature. This is optional, decimal 46 | # numbers (no leading zero) or hex numbers can also be used. 47 | # In these examples we are using slave address 0 (number after "Koyo1"). 48 | 49 | # The DL205 has bit access to the Xn inputs at Modbus offset 4000 (octal) 50 | # Read 32 bits (X0-X37). Function code=2. 51 | drvModbusAsynConfigure("K1_Xn_Bit", "Koyo1", 0, 2, 04000, 040, 0, 100, "Koyo") 52 | 53 | # The DL205 has word access to the Xn inputs at Modbus offset 40400 (octal) 54 | # Read 8 words (128 bits). Function code=3. 55 | drvModbusAsynConfigure("K1_Xn_Word", "Koyo1", 0, 3, 040400, 010, 0, 100, "Koyo") 56 | 57 | # The DL205 has bit access to the Yn outputs at Modbus offset 4000 (octal) 58 | # Read 32 bits (Y0-Y37). Function code=1. 59 | drvModbusAsynConfigure("K1_Yn_In_Bit", "Koyo1", 0, 1, 04000, 040, 0, 100, "Koyo") 60 | 61 | # The DL205 has bit access to the Yn outputs at Modbus offset 4000 (octal) 62 | # Write 32 bits (Y0-Y37). Function code=5. 63 | drvModbusAsynConfigure("K1_Yn_Out_Bit", "Koyo1", 0, 5, 04000, 040, 0, 1, "Koyo") 64 | 65 | # The DL205 has word access to the Yn outputs at Modbus offset 40500 (octal) 66 | # Read 8 words (128 bits). Function code=3. 67 | drvModbusAsynConfigure("K1_Yn_In_Word", "Koyo1", 0, 3, 040500, 010, 0, 100, "Koyo") 68 | 69 | # Write 8 words (128 bits). Function code=6. 70 | drvModbusAsynConfigure("K1_Yn_Out_Word", "Koyo1", 0, 6, 040500, 010, 0, 100, "Koyo") 71 | 72 | # The DL205 has bit access to the Cn bits at Modbus offset 6000 (octal) 73 | # Access 256 bits (C0-C377) as inputs. Function code=1. 74 | drvModbusAsynConfigure("K1_Cn_In_Bit", "Koyo1", 0, 1, 06000, 0400, 0, 100, "Koyo") 75 | 76 | # Access the same 256 bits (C0-C377) as outputs. Function code=5. 77 | drvModbusAsynConfigure("K1_Cn_Out_Bit", "Koyo1", 0, 5, 06000, 0400, 0, 1, "Koyo") 78 | 79 | # Access the same 256 bits (C0-C377) as array outputs. Function code=15. 80 | drvModbusAsynConfigure("K1_Cn_Out_Bit_Array", "Koyo1", 0, 15, 06000, 0400, 0, 1, "Koyo") 81 | 82 | # The DL205 has word access to the Cn bits at Modbus offset 40600 (octal) 83 | # We use the first 16 words (C0-C377) as inputs (256 bits). Function code=3. 84 | drvModbusAsynConfigure("K1_Cn_In_Word", "Koyo1", 0, 3, 040600, 020, 0, 100, "Koyo") 85 | 86 | # We access the same 16 words (C0-C377) as outputs (256 bits). Function code=6. 87 | drvModbusAsynConfigure("K1_Cn_Out_Word", "Koyo1", 0, 6, 040600, 020, 0, 1, "Koyo") 88 | 89 | # We access the same 16 words (C0-C377) as array outputs (256 bits). Function code=16. 90 | drvModbusAsynConfigure("K1_Cn_Out_Word_Array", "Koyo1", 0, 16, 040600, 020, 0, 1, "Koyo") 91 | 92 | # Enable ASYN_TRACEIO_HEX on octet server 93 | asynSetTraceIOMask("Koyo1",0,4) 94 | # Enable ASYN_TRACE_ERROR and ASYN_TRACEIO_DRIVER on octet server 95 | #asynSetTraceMask("Koyo1",0,9) 96 | 97 | # Enable ASYN_TRACEIO_HEX on modbus server 98 | asynSetTraceIOMask("K1_Yn_In_Bit",0,4) 99 | # Enable all debugging on modbus server 100 | #asynSetTraceMask("K1_Yn_In_Bit",0,255) 101 | # Dump up to 512 bytes in asynTrace 102 | asynSetTraceIOTruncateSize("K1_Yn_In_Bit",0,512) 103 | 104 | dbLoadTemplate("Koyo1.substitutions") 105 | 106 | iocInit 107 | 108 | -------------------------------------------------------------------------------- /iocBoot/iocTest/Koyo2.cmd: -------------------------------------------------------------------------------- 1 | # Koyo2.cmd 2 | 3 | dbLoadDatabase("../../dbd/modbusApp.dbd") 4 | modbusApp_registerRecordDeviceDriver(pdbbase) 5 | 6 | # Use the following commands for TCP/IP 7 | #drvAsynIPPortConfigure(const char *portName, 8 | # const char *hostInfo, 9 | # unsigned int priority, 10 | # int noAutoConnect, 11 | # int noProcessEos); 12 | drvAsynIPPortConfigure("Koyo2","164.54.160.158:502",0,0,0) 13 | asynSetOption("Koyo2",0, "disconnectOnReadTimeout", "Y") 14 | #modbusInterposeConfig(const char *portName, 15 | # modbusLinkType linkType, 16 | # int timeoutMsec, 17 | # int writeDelayMsec) 18 | modbusInterposeConfig("Koyo2",0,2000,0) 19 | 20 | # Use the following commands for serial RTU or ASCII 21 | #drvAsynSerialPortConfigure(const char *portName, 22 | # const char *ttyName, 23 | # unsigned int priority, 24 | # int noAutoConnect, 25 | # int noProcessEos); 26 | #drvAsynSerialPortConfigure("Koyo2", "/dev/ttyS1", 0, 0, 0) 27 | #asynSetOption("Koyo2",0,"baud","38400") 28 | #asynSetOption("Koyo2",0,"parity","none") 29 | #asynSetOption("Koyo2",0,"bits","8") 30 | #asynSetOption("Koyo2",0,"stop","1") 31 | 32 | # Use the following command for serial RTU. 33 | # Note: non-zero write delay (last parameter) may be needed. 34 | #modbusInterposeConfig("Koyo2",1,2000,0) 35 | 36 | # Use the following commands for serial ASCII 37 | #asynOctetSetOutputEos("Koyo2",0,"\r\n") 38 | #asynOctetSetInputEos("Koyo2",0,"\r\n") 39 | # Note: non-zero write delay (last parameter) may be needed. 40 | #modbusInterposeConfig("Koyo2",2,2000,0) 41 | 42 | # NOTE: We use octal numbers for the start address and length (leading zeros) 43 | # to be consistent with the PLC nomenclature. This is optional, decimal 44 | # numbers (no leading zero) or hex numbers can also be used. 45 | # In these examples we are using slave address 0 (number after "Koyo2"). 46 | 47 | # The DL205 has bit access to the Yn outputs at Modbus offset 4000 (octal) 48 | # Read 32 bits (Y0-Y37). Function code=1. 49 | drvModbusAsynConfigure("K2_Yn_In_Bit", "Koyo2", 0, 1, 04000, 040, 0, 100, "Koyo") 50 | 51 | # The DL205 has bit access to the Yn outputs at Modbus offset 4000 (octal) 52 | # Write 32 bits (Y0-Y37). Function code=5. 53 | drvModbusAsynConfigure("K2_Yn_Out_Bit", "Koyo2", 0, 5, 04000, 040, 0, 1, "Koyo") 54 | 55 | # The DL205 has bit access to the Cn bits at Modbus offset 6000 (octal) 56 | # Access 256 bits (C0-C377) as inputs. Function code=1. 57 | drvModbusAsynConfigure("K2_Cn_In_Bit", "Koyo2", 0, 1, 06000, 0400, 0, 100, "Koyo") 58 | 59 | # Access the same 256 bits (C0-C377) as outputs. Function code=5. 60 | drvModbusAsynConfigure("K2_Cn_Out_Bit", "Koyo2", 0, 5, 06000, 0400, 0, 1, "Koyo") 61 | 62 | # The DL205 has word access to the V3000 memory at Modbus offset 3000 (octal) 63 | # Access 32 words (V3000-V3040) as inputs. Function code=3, data type signed BCD. 64 | drvModbusAsynConfigure("K2_V3000_In_Word", "Koyo2", 0, 3, 03000, 040, 3, 100, "Koyo") 65 | 66 | # Enable ASYN_TRACEIO_HEX on octet server 67 | asynSetTraceIOMask("Koyo2",0,4) 68 | # Enable ASYN_TRACE_ERROR and ASYN_TRACEIO_DRIVER on octet server 69 | #asynSetTraceMask("Koyo2",0,9) 70 | 71 | # Enable ASYN_TRACEIO_HEX on modbus server 72 | asynSetTraceIOMask("K2_V3000_In_Word",0,4) 73 | # Enable ASYN_TRACE_ERROR, ASYN_TRACEIO_DEVICE, and ASYN_TRACEIO_DRIVER on modbus server 74 | #asynSetTraceMask("K2_V3000_In_Word",0,11) 75 | 76 | dbLoadTemplate("Koyo2.substitutions") 77 | 78 | iocInit 79 | 80 | -------------------------------------------------------------------------------- /iocBoot/iocTest/Koyo_Sim1.cmd: -------------------------------------------------------------------------------- 1 | # Koyo_Sim1.cmd 2 | 3 | # This is very similar to Koyo1.cmd. There are 2 differences in the addressing: 4 | # - The Koyo hardware has the X inputs and Y outputs at the same address (04000) 5 | # We use 02000 for X and 04000 for Y to make it clearer in the simulator 6 | # - The Koyo hardware has bit and word access at different addresses for the same bits. 7 | # The Modbus Slave simulator from Witte software cannot do that, so we use the same addresses for bit and word access. 8 | 9 | < envPaths 10 | 11 | dbLoadDatabase("../../dbd/modbusApp.dbd") 12 | modbusApp_registerRecordDeviceDriver(pdbbase) 13 | 14 | # Use the following commands for TCP/IP 15 | #drvAsynIPPortConfigure(const char *portName, 16 | # const char *hostInfo, 17 | # unsigned int priority, 18 | # int noAutoConnect, 19 | # int noProcessEos); 20 | drvAsynIPPortConfigure("Koyo1","camaro:502",0,0,0) 21 | asynSetOption("Koyo1",0, "disconnectOnReadTimeout", "Y") 22 | m#modbusInterposeConfig(const char *portName, 23 | # modbusLinkType linkType, 24 | # int timeoutMsec, 25 | # int writeDelayMsec) 26 | modbusInterposeConfig("Koyo1",0,5000,0) 27 | 28 | # Use the following commands for serial RTU or ASCII 29 | #drvAsynSerialPortConfigure(const char *portName, 30 | # const char *ttyName, 31 | # unsigned int priority, 32 | # int noAutoConnect, 33 | # int noProcessEos); 34 | #drvAsynSerialPortConfigure("Koyo1", "/dev/ttyS1", 0, 0, 0) 35 | #asynSetOption("Koyo1",0,"baud","38400") 36 | #asynSetOption("Koyo1",0,"parity","none") 37 | #asynSetOption("Koyo1",0,"bits","8") 38 | #asynSetOption("Koyo1",0,"stop","1") 39 | 40 | # Use the following command for serial RTU 41 | # Note: non-zero write del1ay (last parameter) may be needed. 42 | #modbusInterposeConfig("Koyo1",1,1000,0) 43 | 44 | # Use the following commands for serial ASCII 45 | #asynOctetSetOutputEos("Koyo1",0,"\r\n") 46 | #asynOctetSetInputEos("Koyo1",0,"\r\n") 47 | # Note: non-zero write delay (last parameter) may be needed. 48 | #modbusInterposeConfig("Koyo1",2,1000,0) 49 | 50 | # NOTE: We use octal numbers for the start address and length (leading zeros) 51 | # to be consistent with the PLC nomenclature. This is optional, decimal 52 | # numbers (no leading zero) or hex numbers can also be used. 53 | # In these examples we are using slave address 0 (number after "Koyo1"). 54 | 55 | # Bit access to the Xn inputs at Modbus offset 4000 (octal) 56 | # Read 32 bits (X0-X37). Function code=2. 57 | drvModbusAsynConfigure("K1_Xn_Bit", "Koyo1", 0, 2, 02000, 040, 0, 100, "Koyo") 58 | 59 | # Word access to the Xn inputs at Modbus offset 2000 (octal) 60 | # Read 8 words (128 bits). Function code=3. 61 | drvModbusAsynConfigure("K1_Xn_Word", "Koyo1", 0, 3, 02000, 010, 0, 100, "Koyo") 62 | 63 | # Bit access to the Yn outputs at Modbus offset 4000 (octal) 64 | # Read 32 bits (Y0-Y37). Function code=1. 65 | drvModbusAsynConfigure("K1_Yn_In_Bit", "Koyo1", 0, 1, 04000, 040, 0, 100, "Koyo") 66 | 67 | # Bit access to the Yn outputs at Modbus offset 4000 (octal) 68 | # Write 32 bits (Y0-Y37). Function code=5. 69 | drvModbusAsynConfigure("K1_Yn_Out_Bit", "Koyo1", 0, 5, 04000, 040, 0, 1, "Koyo") 70 | 71 | # Word access to the Yn outputs at Modbus offset 4000 (octal) 72 | # Read 8 words (128 bits). Function code=3. 73 | drvModbusAsynConfigure("K1_Yn_In_Word", "Koyo1", 0, 3, 04000, 010, 0, 100, "Koyo") 74 | 75 | # Write 8 words (128 bits). Function code=6. 76 | drvModbusAsynConfigure("K1_Yn_Out_Word", "Koyo1", 0, 6, 04000, 010, 0, 100, "Koyo") 77 | 78 | # Bit access to the Cn bits at Modbus offset 6000 (octal) 79 | # Access 256 bits (C0-C377) as inputs. Function code=1. 80 | drvModbusAsynConfigure("K1_Cn_In_Bit", "Koyo1", 0, 1, 06000, 0400, 0, 100, "Koyo") 81 | 82 | # Access the same 256 bits (C0-C377) as outputs. Function code=5. 83 | drvModbusAsynConfigure("K1_Cn_Out_Bit", "Koyo1", 0, 5, 06000, 0400, 0, 1, "Koyo") 84 | 85 | # Access the same 256 bits (C0-C377) as array outputs. Function code=15. 86 | drvModbusAsynConfigure("K1_Cn_Out_Bit_Array", "Koyo1", 0, 15, 06000, 0400, 0, 1, "Koyo") 87 | 88 | # Word access to the Cn bits at Modbus offset 6000 (octal) 89 | # We use the first 16 words (C0-C377) as inputs (256 bits). Function code=3. 90 | drvModbusAsynConfigure("K1_Cn_In_Word", "Koyo1", 0, 3, 06000, 020, 0, 100, "Koyo") 91 | 92 | # We access the same 16 words (C0-C377) as outputs (256 bits). Function code=6. 93 | drvModbusAsynConfigure("K1_Cn_Out_Word", "Koyo1", 0, 6, 06000, 020, 0, 1, "Koyo") 94 | 95 | # We access the same 16 words (C0-C377) as array outputs (256 bits). Function code=16. 96 | drvModbusAsynConfigure("K1_Cn_Out_Word_Array", "Koyo1", 0, 16, 06000, 020, 0, 1, "Koyo") 97 | 98 | # Enable ASYN_TRACEIO_HEX on octet server 99 | asynSetTraceIOMask("Koyo1",0,4) 100 | # Enable ASYN_TRACE_ERROR and ASYN_TRACEIO_DRIVER on octet server 101 | #asynSetTraceMask("Koyo1",0,9) 102 | 103 | # Enable ASYN_TRACEIO_HEX on modbus server 104 | asynSetTraceIOMask("K1_Yn_In_Bit",0,4) 105 | # Enable all debugging on modbus server 106 | #asynSetTraceMask("K1_Yn_In_Bit",0,255) 107 | # Dump up to 512 bytes in asynTrace 108 | asynSetTraceIOTruncateSize("K1_Yn_In_Bit",0,512) 109 | 110 | dbLoadTemplate("Koyo1.substitutions") 111 | 112 | iocInit 113 | 114 | -------------------------------------------------------------------------------- /iocBoot/iocTest/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/configure/CONFIG 3 | ARCH = linux-x86_64 4 | #ARCH=win32-x86 5 | TARGETS = envPaths cdCommands 6 | include $(TOP)/configure/RULES.ioc 7 | -------------------------------------------------------------------------------- /iocBoot/iocTest/ModbusF1_A0_128bits.mbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/iocBoot/iocTest/ModbusF1_A0_128bits.mbs -------------------------------------------------------------------------------- /iocBoot/iocTest/ModbusF3_A100_80words.mbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/iocBoot/iocTest/ModbusF3_A100_80words.mbs -------------------------------------------------------------------------------- /iocBoot/iocTest/ModbusF3_A200_80words.mbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/iocBoot/iocTest/ModbusF3_A200_80words.mbs -------------------------------------------------------------------------------- /iocBoot/iocTest/ModbusF3_A300_80words.mbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epics-modules/modbus/a59270f32d2846fe1a2844c60c796b3dbd3e3254/iocBoot/iocTest/ModbusF3_A300_80words.mbs -------------------------------------------------------------------------------- /iocBoot/iocTest/array_test.cmd: -------------------------------------------------------------------------------- 1 | < envPaths 2 | 3 | dbLoadDatabase("../../dbd/modbusApp.dbd") 4 | modbusApp_registerRecordDeviceDriver(pdbbase) 5 | 6 | # Use the following commands for TCP/IP 7 | #drvAsynIPPortConfigure(const char *portName, 8 | # const char *hostInfo, 9 | # unsigned int priority, 10 | # int noAutoConnect, 11 | # int noProcessEos); 12 | drvAsynIPPortConfigure("sim1","164.54.160.31:502",0,0,0) 13 | asynSetOption("sim1",0, "disconnectOnReadTimeout", "Y") 14 | #modbusInterposeConfig(const char *portName, 15 | # modbusLinkType linkType, 16 | # int timeoutMsec, 17 | # int writeDelayMsec) 18 | modbusInterposeConfig("sim1",0,2000,0) 19 | 20 | # Word access at Modbus address 0 21 | # Access 20 words as UINT16 data type. 22 | # drvModbusAsynConfigure("portName", "tcpPortName", slaveAddress, modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec, "plcType") 23 | drvModbusAsynConfigure("UINT16_F3", "sim1", 0, 3, 0, 20, 0, 100, "Simulator") 24 | drvModbusAsynConfigure("UINT16_F16", "sim1", 0,16, 0, 20, 0, 100, "Simulator") 25 | 26 | # Word access at Modbus address 20 27 | # Access 20 words as INT16 data type. 28 | # drvModbusAsynConfigure("portName", "tcpPortName", slaveAddress, modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec, "plcType") 29 | drvModbusAsynConfigure("INT16_F3", "sim1", 0, 3, 20, 20, 4, 100, "Simulator") 30 | drvModbusAsynConfigure("INT16_F16", "sim1", 0,16, 20, 20, 4, 100, "Simulator") 31 | 32 | # Word access at Modbus address 40 33 | # Access 20 words as INT32_LE data type. 34 | # drvModbusAsynConfigure("portName", "tcpPortName", slaveAddress, modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec, "plcType") 35 | drvModbusAsynConfigure("INT32_LE_F3", "sim1", 0, 3, 40, 20, 5, 100, "Simulator") 36 | drvModbusAsynConfigure("INT32_LE_F16","sim1", 0,16, 40, 20, 5, 100, "Simulator") 37 | 38 | # Word access at Modbus address 60 39 | # Access 20 words as INT32_BE data type. 40 | # drvModbusAsynConfigure("portName", "tcpPortName", slaveAddress, modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec, "plcType") 41 | drvModbusAsynConfigure("INT32_BE_F3", "sim1", 0, 3, 60, 20, 6, 100, "Simulator") 42 | drvModbusAsynConfigure("INT32_BE_F16","sim1", 0,16, 60, 20, 6, 100, "Simulator") 43 | 44 | 45 | # Enable ASYN_TRACEIO_HEX on octet server 46 | asynSetTraceIOMask("sim1",0,4) 47 | # Enable ASYN_TRACE_ERROR and ASYN_TRACEIO_DRIVER on octet server 48 | #asynSetTraceMask("sim1",0,9) 49 | 50 | dbLoadTemplate("array_test.substitutions") 51 | 52 | iocInit 53 | 54 | -------------------------------------------------------------------------------- /iocBoot/iocTest/array_test.substitutions: -------------------------------------------------------------------------------- 1 | # asyn record for the underlying asyn octet port 2 | file "$(ASYN)/db/asynRecord.db" { pattern 3 | {P, R, PORT, ADDR, IMAX, OMAX} 4 | {SIM1: OctetAsyn, sim1, 0, 80, 80} 5 | } 6 | 7 | ################################# 8 | # Address 0, UINT16 data type input waveform 9 | ################################# 10 | file "../../db/intarray_in.template" { pattern 11 | {P, R, PORT, OFFSET, NELM, SCAN} 12 | {SIM1:, UINT16:ArrayIn, UINT16_F3, 0, 20, "I/O Intr"} 13 | } 14 | 15 | file "../../db/intarray_out.template" { pattern 16 | {P, R, PORT, OFFSET, NELM} 17 | {SIM1:, UINT16:ArrayOut, UINT16_F16, 0, 20} 18 | } 19 | 20 | file "../../db/poll_delay.template" { pattern 21 | {P, R, PORT} 22 | {SIM1:, UINT16:PollDelay, UINT16_F3} 23 | } 24 | 25 | file "../../db/poll_trigger.template" { pattern 26 | {P, R, PORT} 27 | {SIM1:, UINT16:PollTrigger, UINT16_F3} 28 | } 29 | 30 | ################################# 31 | # Address 20, INT16 data type 32 | ################################# 33 | file "../../db/intarray_in.template" { pattern 34 | {P, R, PORT, OFFSET, NELM, SCAN} 35 | {SIM1:, INT16:ArrayIn, INT16_F3, 0, 20, "I/O Intr"} 36 | } 37 | 38 | file "../../db/intarray_out.template" { pattern 39 | {P, R, PORT, OFFSET, NELM} 40 | {SIM1:, INT16:ArrayOut, INT16_F16, 0, 20} 41 | } 42 | 43 | file "../../db/poll_delay.template" { pattern 44 | {P, R, PORT} 45 | {SIM1:, INT16:PollDelay, INT16_F3} 46 | } 47 | 48 | file "../../db/poll_trigger.template" { pattern 49 | {P, R, PORT} 50 | {SIM1:, INT16:PollTrigger, INT16_F3} 51 | } 52 | 53 | ################################# 54 | # Address 40, INT32_LE data type 55 | ################################# 56 | file "../../db/intarray_in.template" { pattern 57 | {P, R, PORT, OFFSET, NELM, SCAN} 58 | {SIM1:, INT32_LE:ArrayIn, INT32_LE_F3, 0, 20, "I/O Intr"} 59 | } 60 | 61 | file "../../db/intarray_out.template" { pattern 62 | {P, R, PORT, OFFSET, NELM} 63 | {SIM1:, INT32_LE:ArrayOut, INT32_LE_F16, 0, 20} 64 | } 65 | 66 | file "../../db/poll_delay.template" { pattern 67 | {P, R, PORT} 68 | {SIM1:, INT32_LE:PollDelay, INT32_LE_F3} 69 | } 70 | 71 | file "../../db/poll_trigger.template" { pattern 72 | {P, R, PORT} 73 | {SIM1:, INT32_LE:PollTrigger, INT32_LE_F3} 74 | } 75 | 76 | ################################# 77 | # Address 60, INT32_BE data type 78 | ################################# 79 | file "../../db/intarray_in.template" { pattern 80 | {P, R, PORT, OFFSET, NELM, SCAN} 81 | {SIM1:, INT32_BE:ArrayIn, INT32_BE_F3, 0, 20, "I/O Intr"} 82 | } 83 | 84 | file "../../db/intarray_out.template" { pattern 85 | {P, R, PORT, OFFSET, NELM} 86 | {SIM1:, INT32_BE:ArrayOut, INT32_BE_F16, 0, 20} 87 | } 88 | 89 | file "../../db/poll_delay.template" { pattern 90 | {P, R, PORT} 91 | {SIM1:, INT32_BE:PollDelay, INT32_BE_F3} 92 | } 93 | 94 | file "../../db/poll_trigger.template" { pattern 95 | {P, R, PORT} 96 | {SIM1:, INT32_BE:PollTrigger, INT32_BE_F3} 97 | } 98 | -------------------------------------------------------------------------------- /iocBoot/iocTest/fc17_modicon.cmd: -------------------------------------------------------------------------------- 1 | #!../../bin/linux-x86_64/modbusApp 2 | 3 | # fc17_modicon.cmd 4 | 5 | 6 | < envPaths 7 | 8 | dbLoadDatabase("../../dbd/modbusApp.dbd") 9 | modbusApp_registerRecordDeviceDriver(pdbbase) 10 | 11 | # Use the following commands for TCP/IP 12 | #drvAsynIPPortConfigure(const char *portName, 13 | # const char *hostInfo, 14 | # unsigned int priority, 15 | # int noAutoConnect, 16 | # int noProcessEos); 17 | drvAsynIPPortConfigure("Modicon984","192.168.1.52:4001",0,0,0) 18 | #modbusInterposeConfig(const char *portName, 19 | # modbusLinkType linkType, 20 | # int timeoutMsec, 21 | # int writeDelayMsec) 22 | modbusInterposeConfig("Modicon984",1,500,0) 23 | 24 | #drvModbusAsynConfigure(portName, 25 | # tcpPortName, 26 | # slaveAddress, 27 | # modbusFunction, 28 | # modbusStartAddress, 29 | # modbusLength, 30 | # dataType, 31 | # pollMsec, 32 | # plcType); 33 | # modbusStartAddress=0 as it doesn't matter in function 17 34 | # modbusLength is device-specific and equal to number of bytes in response of function 17 35 | # Modicon-984 provides 9 bytes in response 36 | drvModbusAsynConfigure("Mod984_slaveID","Modicon984",32,17,0,9,0,1000,"Modicon") 37 | 38 | # Enable ASYN_TRACEIO_HEX on octet server 39 | asynSetTraceIOMask("Modicon984",0,4) 40 | # Enable ASYN_TRACE_ERROR and ASYN_TRACEIO_DRIVER on octet server 41 | #asynSetTraceMask("Modicon984",0,9) 42 | 43 | # Enable ASYN_TRACEIO_HEX on modbus server 44 | asynSetTraceIOMask("Mod984_slaveID",0,4) 45 | # Enable ASYN_TRACE_ERROR, ASYN_TRACEIO_DEVICE, and ASYN_TRACEIO_DRIVER on modbus server 46 | #asynSetTraceMask("Mod984_slaveID",0,11) 47 | 48 | dbLoadTemplate("fc17_modicon.substitutions") 49 | 50 | iocInit 51 | 52 | -------------------------------------------------------------------------------- /iocBoot/iocTest/fc17_modicon.substitutions: -------------------------------------------------------------------------------- 1 | # asyn record for the underlying asyn octet port 2 | file "$(ASYN)/db/asynRecord.db" { pattern 3 | {P, R, PORT, ADDR, IMAX, OMAX} 4 | {Modicon984: OctetAsyn, Modicon984, 0, 80, 80} 5 | } 6 | 7 | # read byte#1 out of 9 bytes from Modicon-984 response 8 | file "../../db/longin.template" { pattern 9 | {P, R, PORT, OFFSET, SCAN} 10 | {Modicon984:, SlaveID_Byte1, Mod984_slaveID, 0, "I/O Intr"} 11 | } 12 | 13 | # read byte#7 out of 9 bytes from Modicon-984 response 14 | file "../../db/mbbiDirect.template" { pattern 15 | {P, R, PORT, OFFSET, MASK, SCAN} 16 | {Modicon984:, SlaveID_Byte7, Mod984_slaveID, 6, 0xFF, "I/O Intr"} 17 | } 18 | -------------------------------------------------------------------------------- /iocBoot/iocTest/sim2.cmd: -------------------------------------------------------------------------------- 1 | # simulator.cmd 2 | 3 | dbLoadDatabase("../../dbd/modbusApp.dbd") 4 | modbusApp_registerRecordDeviceDriver(pdbbase) 5 | 6 | # Use the following commands for TCP/IP 7 | #drvAsynIPPortConfigure(const char *portName, 8 | # const char *hostInfo, 9 | # unsigned int priority, 10 | # int noAutoConnect, 11 | # int noProcessEos); 12 | drvAsynIPPortConfigure("sim1","164.54.160.31:502",0,0,0) 13 | asynSetOption("sim1",0, "disconnectOnReadTimeout", "Y") 14 | #modbusInterposeConfig(const char *portName, 15 | # modbusLinkType linkType, 16 | # int timeoutMsec, 17 | # int writeDelayMsec) 18 | modbusInterposeConfig("sim1",0,2000,0) 19 | 20 | # Use the following commands for serial RTU or ASCII 21 | #drvAsynSerialPortConfigure(const char *portName, 22 | # const char *ttyName, 23 | # unsigned int priority, 24 | # int noAutoConnect, 25 | # int noProcessEos); 26 | #drvAsynSerialPortConfigure("sim1", "/dev/ttyS1", 0, 0, 0) 27 | #asynSetOption("sim1",0,"baud","38400") 28 | #asynSetOption("sim1",0,"parity","none") 29 | #asynSetOption("sim1",0,"bits","8") 30 | #asynSetOption("sim1",0,"stop","1") 31 | 32 | # Use the following command for serial RTU. 33 | # Note: non-zero write delay (last parameter) may be needed. 34 | #modbusInterposeConfig("sim1",1,2000,0) 35 | 36 | # Use the following commands for serial ASCII 37 | #asynOctetSetOutputEos("sim1",0,"\r\n") 38 | #asynOctetSetInputEos("sim1",0,"\r\n") 39 | # Note: non-zero write delay (last parameter) may be needed. 40 | #modbusInterposeConfig("sim1",2,2000,0) 41 | 42 | # Word access at Modbus address 0 43 | # Access 60 words as inputs. 44 | # Function code=3 45 | # default data type unsigned integer. 46 | # drvModbusAsynConfigure("portName", "tcpPortName", slaveAddress, modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec, "plcType") 47 | drvModbusAsynConfigure("A0_In_Word", "sim1", 0, 4, 0, 60, 0, 2000, "Simulator") 48 | 49 | # Access 60 words as outputs. 50 | # Either function code=6 (single register) or 16 (multiple registers) can be used, but 16 51 | # is better because it is "atomic" when writing values longer than 16-bits. 52 | # Default data type unsigned integer. 53 | # drvModbusAsynConfigure("portName", "tcpPortName", slaveAddress, modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec, "plcType") 54 | drvModbusAsynConfigure("A0_Out_Word", "sim1", 0, 16, 100, 10, 7, 1, "Simulator") 55 | 56 | # Enable ASYN_TRACEIO_HEX on octet server 57 | asynSetTraceIOMask("sim1",0,4) 58 | # Enable ASYN_TRACE_ERROR and ASYN_TRACEIO_DRIVER on octet server 59 | #asynSetTraceMask("sim1",0,9) 60 | 61 | dbLoadTemplate("sim2.substitutions") 62 | 63 | iocInit 64 | 65 | -------------------------------------------------------------------------------- /iocBoot/iocTest/sim2.substitutions: -------------------------------------------------------------------------------- 1 | # asyn record for the underlying asyn octet port 2 | file "$(ASYN)/db/asynRecord.db" { pattern 3 | {P, R, PORT, ADDR, IMAX, OMAX} 4 | {SIM1: OctetAsyn, sim1, 0, 80, 80} 5 | } 6 | 7 | # These are the A0 inputs done with word access 8 | file "../../db/intarray_in.template" { pattern 9 | {P, R, PORT, OFFSET, DATA_TYPE, NELM, SCAN} 10 | {SIM1:, LI:UINT16, A0_In_Word, 0, UINT16, 46, "I/O Intr"} 11 | } 12 | 13 | file "../../db/aoFloat64.template" { pattern 14 | {P, R, PORT, OFFSET, DATA_TYPE, LOPR, HOPR, PREC} 15 | {SIM1:, AO:FLOAT32_LE, A0_Out_Word, 6, FLOAT32_LE, -1e6, 1e6, 3} 16 | } 17 | -------------------------------------------------------------------------------- /iocBoot/iocTest/sim3.cmd: -------------------------------------------------------------------------------- 1 | # sim3.cmd 2 | 3 | /db 12 | # databases, templates, substitutions like this 13 | DB += $(patsubst ../%, %, $(wildcard ../*.template)) 14 | REQ += $(patsubst ../%, %, $(wildcard ../*.req)) 15 | 16 | #---------------------------------------------------- 17 | # If .db template is not named *.template add 18 | # _template = 19 | 20 | include $(TOP)/configure/RULES 21 | #---------------------------------------- 22 | # ADD RULES AFTER THIS LINE 23 | 24 | -------------------------------------------------------------------------------- /modbusApp/Db/ai.template: -------------------------------------------------------------------------------- 1 | # ai record template for register inputs 2 | record(ai, "$(P)$(R)") { 3 | field(DTYP,"asynInt32") 4 | field(INP,"@asynMask($(PORT) $(OFFSET) $(BITS))MODBUS_DATA") 5 | field(LINR,"LINEAR") 6 | field(EGUL,"$(EGUL)") 7 | field(EGUF,"$(EGUF)") 8 | field(HOPR,"$(EGUF)") 9 | field(LOPR,"$(EGUL)") 10 | field(PREC,"$(PREC)") 11 | field(SCAN,"$(SCAN)") 12 | } 13 | 14 | -------------------------------------------------------------------------------- /modbusApp/Db/aiFloat64.template: -------------------------------------------------------------------------------- 1 | # ai record template for register inputs 2 | record(ai, "$(P)$(R)") { 3 | field(DTYP,"asynFloat64") 4 | field(INP,"@asyn($(PORT) $(OFFSET))$(DATA_TYPE)") 5 | field(HOPR,"$(HOPR=0)") 6 | field(LOPR,"$(LOPR=0)") 7 | field(PREC,"$(PREC=0)") 8 | field(SCAN,"$(SCAN=I/O Intr)") 9 | } 10 | 11 | -------------------------------------------------------------------------------- /modbusApp/Db/ai_average.template: -------------------------------------------------------------------------------- 1 | # ai record template for register inputs 2 | record(ai, "$(P)$(R)") { 3 | field(DTYP,"asynInt32Average") 4 | field(INP,"@asynMask($(PORT) $(OFFSET) $(BITS))MODBUS_DATA") 5 | field(LINR,"LINEAR") 6 | field(EGUL,"$(EGUL=0)") 7 | field(EGUF,"$(EGUF=0)") 8 | field(HOPR,"$(EGUF=0)") 9 | field(LOPR,"$(EGUL=0)") 10 | field(PREC,"$(PREC=0)") 11 | field(SCAN,"$(SCAN)") 12 | } 13 | 14 | -------------------------------------------------------------------------------- /modbusApp/Db/ao.template: -------------------------------------------------------------------------------- 1 | # ao record template for register outputs 2 | record(ao, "$(P)$(R)") { 3 | field(DTYP,"asynInt32") 4 | field(OUT,"@asynMask($(PORT) $(OFFSET) $(BITS))MODBUS_DATA") 5 | field(LINR,"LINEAR") 6 | field(EGUL,"$(EGUL)") 7 | field(EGUF,"$(EGUF)") 8 | field(HOPR,"$(EGUF)") 9 | field(LOPR,"$(EGUL)") 10 | field(PREC,"$(PREC)") 11 | } 12 | 13 | -------------------------------------------------------------------------------- /modbusApp/Db/aoFloat64.template: -------------------------------------------------------------------------------- 1 | # ao record template for register outputs 2 | record(ao, "$(P)$(R)") { 3 | field(DTYP,"asynFloat64") 4 | field(OUT,"@asyn($(PORT) $(OFFSET))$(DATA_TYPE)") 5 | field(HOPR,"$(HOPR=0)") 6 | field(LOPR,"$(LOPR=0)") 7 | field(PREC,"$(PREC=0)") 8 | } 9 | 10 | -------------------------------------------------------------------------------- /modbusApp/Db/asynRecord.template: -------------------------------------------------------------------------------- 1 | record(asyn,"$(P)$(R)") 2 | { 3 | field(DTYP,"asynRecordDevice") 4 | field(PORT,"$(PORT)") 5 | field(ADDR,"$(ADDR)") 6 | field(TMOD,"$(TMOD)") 7 | field(IFACE,"$(IFACE)") 8 | } 9 | 10 | -------------------------------------------------------------------------------- /modbusApp/Db/bi_bit.template: -------------------------------------------------------------------------------- 1 | # bi record template for register inputs 2 | record(bi,"$(P)$(R)") { 3 | field(DTYP,"asynUInt32Digital") 4 | field(INP,"@asynMask($(PORT) $(OFFSET) 0x1)") 5 | field(SCAN,"$(SCAN)") 6 | field(ZNAM,"$(ZNAM)") 7 | field(ONAM,"$(ONAM)") 8 | field(ZSV,"$(ZSV)") 9 | field(OSV,"$(OSV)") 10 | } 11 | -------------------------------------------------------------------------------- /modbusApp/Db/bi_word.template: -------------------------------------------------------------------------------- 1 | # bi record template for register inputs 2 | record(bi,"$(P)$(R)") { 3 | field(DTYP,"asynUInt32Digital") 4 | field(INP,"@asynMask($(PORT) $(OFFSET) $(MASK))") 5 | field(SCAN,"$(SCAN)") 6 | field(ZNAM,"$(ZNAM)") 7 | field(ONAM,"$(ONAM)") 8 | field(ZSV,"$(ZSV)") 9 | field(OSV,"$(OSV)") 10 | } 11 | -------------------------------------------------------------------------------- /modbusApp/Db/bo_bit.template: -------------------------------------------------------------------------------- 1 | # bo record template for register outputs 2 | record(bo,"$(P)$(R)") { 3 | field(DTYP,"asynUInt32Digital") 4 | field(OUT,"@asynMask($(PORT) $(OFFSET) 0x1)") 5 | field(ZNAM,"$(ZNAM)") 6 | field(ONAM,"$(ONAM)") 7 | } 8 | -------------------------------------------------------------------------------- /modbusApp/Db/bo_word.template: -------------------------------------------------------------------------------- 1 | # bo record template for register outputs 2 | record(bo,"$(P)$(R)") { 3 | field(DTYP,"asynUInt32Digital") 4 | field(OUT,"@asynMask($(PORT) $(OFFSET) $(MASK))") 5 | field(ZNAM,"$(ZNAM)") 6 | field(ONAM,"$(ONAM)") 7 | } 8 | -------------------------------------------------------------------------------- /modbusApp/Db/floatarray_in.template: -------------------------------------------------------------------------------- 1 | record(waveform,"$(P)$(R)") { 2 | field(DTYP,"asynFloat64ArrayIn") 3 | field(INP,"@asyn($(PORT) $(OFFSET=0))MODBUS_DATA") 4 | field(SCAN,"$(SCAN)") 5 | field(FTVL,"DOUBLE") 6 | field(NELM,"$(NELM)") 7 | } 8 | -------------------------------------------------------------------------------- /modbusApp/Db/floatarray_out.template: -------------------------------------------------------------------------------- 1 | record(waveform,"$(P)$(R)") { 2 | field(DTYP,"asynFloat64ArrayOut") 3 | field(INP,"@asyn($(PORT) $(OFFSET=0))MODBUS_DATA") 4 | field(FTVL,"DOUBLE") 5 | field(NELM,"$(NELM)") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Db/int64in.template: -------------------------------------------------------------------------------- 1 | # int64in record template for register inputs 2 | record(int64in,"$(P)$(R)") { 3 | field(DTYP,"asynInt64") 4 | field(INP,"@asyn($(PORT) $(OFFSET))$(DATA_TYPE)") 5 | field(SCAN, "$(SCAN)") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Db/int64out.template: -------------------------------------------------------------------------------- 1 | # int64out record template for register inputs 2 | record(int64out,"$(P)$(R)") { 3 | field(DTYP,"asynInt64") 4 | field(OUT,"@asyn($(PORT) $(OFFSET))$(DATA_TYPE)") 5 | } 6 | -------------------------------------------------------------------------------- /modbusApp/Db/intarray_in.template: -------------------------------------------------------------------------------- 1 | record(waveform,"$(P)$(R)") { 2 | field(DTYP,"asynInt32ArrayIn") 3 | field(INP,"@asyn($(PORT) $(OFFSET=0))MODBUS_DATA") 4 | field(SCAN,"$(SCAN)") 5 | field(FTVL,"LONG") 6 | field(NELM,"$(NELM)") 7 | } 8 | -------------------------------------------------------------------------------- /modbusApp/Db/intarray_out.template: -------------------------------------------------------------------------------- 1 | record(waveform,"$(P)$(R)") { 2 | field(DTYP,"asynInt32ArrayOut") 3 | field(INP,"@asyn($(PORT) $(OFFSET=0))MODBUS_DATA") 4 | field(FTVL,"LONG") 5 | field(NELM,"$(NELM)") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Db/longin.template: -------------------------------------------------------------------------------- 1 | # longin record template for register inputs 2 | record(longin,"$(P)$(R)") { 3 | field(DTYP,"asynUInt32Digital") 4 | field(INP,"@asynMask($(PORT) $(OFFSET) 0xFFFF)") 5 | field(SCAN,"$(SCAN)") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Db/longinInt32.template: -------------------------------------------------------------------------------- 1 | # longin record template for register inputs 2 | record(longin,"$(P)$(R)") { 3 | field(DTYP,"asynInt32") 4 | field(INP,"@asyn($(PORT) $(OFFSET))$(DATA_TYPE)") 5 | field(SCAN, "$(SCAN)") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Db/longout.template: -------------------------------------------------------------------------------- 1 | # longout record template for register inputs 2 | record(longout,"$(P)$(R)") { 3 | field(DTYP,"asynUInt32Digital") 4 | field(OUT,"@asynMask($(PORT) $(OFFSET) 0xFFFF)") 5 | } 6 | -------------------------------------------------------------------------------- /modbusApp/Db/longoutInt32.template: -------------------------------------------------------------------------------- 1 | # longout record template for register inputs 2 | record(longout,"$(P)$(R)") { 3 | field(DTYP,"asynInt32") 4 | field(OUT,"@asyn($(PORT) $(OFFSET))$(DATA_TYPE)") 5 | field(PINI,"$(PINI=NO)") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Db/mbbiDirect.template: -------------------------------------------------------------------------------- 1 | # mbbiDirect record template for register inputs 2 | record(mbbiDirect,"$(P)$(R)") { 3 | field(DTYP,"asynUInt32Digital") 4 | field(INP,"@asynMask($(PORT) $(OFFSET) $(MASK))") 5 | field(SCAN,"$(SCAN)") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Db/mbboDirect.template: -------------------------------------------------------------------------------- 1 | # mbboDirect record template for register outputs 2 | record(mbboDirect,"$(P)$(R)") { 3 | field(DTYP,"asynUInt32Digital") 4 | field(OUT,"@asynMask($(PORT) $(OFFSET) $(MASK))") 5 | } 6 | -------------------------------------------------------------------------------- /modbusApp/Db/poll_delay.template: -------------------------------------------------------------------------------- 1 | # ao record template for poll delay 2 | record(ao,"$(P)$(R)") { 3 | field(DTYP,"asynFloat64") 4 | field(PREC,"3") 5 | field(OUT,"@asyn($(PORT))POLL_DELAY") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Db/poll_trigger.template: -------------------------------------------------------------------------------- 1 | # ao record template for poll delay 2 | record(bo,"$(P)$(R)") { 3 | field(DTYP,"asynInt32") 4 | field(OUT,"@asyn($(PORT))MODBUS_READ") 5 | } 6 | -------------------------------------------------------------------------------- /modbusApp/Db/statistics.template: -------------------------------------------------------------------------------- 1 | # Template for I/O statistics 2 | 3 | record(bo,"$(P)$(R)HistEnable") { 4 | field(DTYP,"asynUInt32Digital") 5 | field(OUT,"@asynMask($(PORT) 0 0xFFFF)ENABLE_HISTOGRAM") 6 | field(ZNAM,"Disable") 7 | field(ONAM,"Enable") 8 | } 9 | 10 | record(bo, "$(P)$(R)Statistics") { 11 | field(SCAN, "$(SCAN)") 12 | field(FLNK, "$(P)$(R)Hist.PROC") 13 | } 14 | 15 | record(waveform,"$(P)$(R)Hist") { 16 | field(DTYP,"asynInt32ArrayIn") 17 | field(INP,"@asyn($(PORT) 0)READ_HISTOGRAM") 18 | field(FTVL,"LONG") 19 | field(NELM,"200") # This number should match driver 20 | field(FLNK,"$(P)$(R)HistTimeAxis.PROC") 21 | } 22 | 23 | record(waveform,"$(P)$(R)HistTimeAxis") { 24 | field(DTYP,"asynInt32ArrayIn") 25 | field(INP,"@asyn($(PORT) 0)HISTOGRAM_TIME_AXIS") 26 | field(FTVL,"LONG") 27 | field(NELM,"200") # This number should match driver 28 | field(FLNK,"$(P)$(R)ReadOK.PROC") 29 | } 30 | 31 | record(longout,"$(P)$(R)MsPerBin") { 32 | field(DTYP,"asynInt32") 33 | field(OUT,"@asyn($(PORT) 0)HISTOGRAM_BIN_TIME") 34 | field(DRVL,"0") 35 | field(VAL,"1") 36 | field(PINI,"1") 37 | } 38 | 39 | record(longin,"$(P)$(R)ReadOK") { 40 | field(DTYP,"asynInt32") 41 | field(INP,"@asyn($(PORT) 0)READ_OK") 42 | field(FLNK,"$(P)$(R)WriteOK.PROC") 43 | } 44 | 45 | record(longin,"$(P)$(R)WriteOK") { 46 | field(DTYP,"asynInt32") 47 | field(INP,"@asyn($(PORT) 0)WRITE_OK") 48 | field(FLNK,"$(P)$(R)IOErrors.PROC") 49 | } 50 | 51 | record(longin,"$(P)$(R)IOErrors") { 52 | field(DTYP,"asynInt32") 53 | field(INP,"@asyn($(PORT) 0)IO_ERRORS") 54 | field(FLNK,"$(P)$(R)LastIOTime.PROC") 55 | } 56 | 57 | record(longin,"$(P)$(R)LastIOTime") { 58 | field(DTYP,"asynInt32") 59 | field(INP,"@asyn($(PORT) 0)LAST_IO_TIME") 60 | field(FLNK,"$(P)$(R)MaxIOTime.PROC") 61 | } 62 | 63 | record(longin,"$(P)$(R)MaxIOTime") { 64 | field(DTYP,"asynInt32") 65 | field(INP,"@asyn($(PORT) 0)MAX_IO_TIME") 66 | } 67 | -------------------------------------------------------------------------------- /modbusApp/Db/stringWaveformIn.template: -------------------------------------------------------------------------------- 1 | record(waveform,"$(P)$(R)") { 2 | field(DTYP,"asynOctetRead") 3 | field(INP,"@asyn($(PORT) $(OFFSET=0))$(DATA_TYPE)") 4 | field(SCAN,"$(SCAN)") 5 | field(FTVL,"CHAR") 6 | field(NELM,"$(NELM)") 7 | } 8 | -------------------------------------------------------------------------------- /modbusApp/Db/stringWaveformOut.template: -------------------------------------------------------------------------------- 1 | record(waveform,"$(P)$(R)") { 2 | field(DTYP,"asynOctetWrite") 3 | field(INP,"@asyn($(PORT) $(OFFSET=0))$(DATA_TYPE)") 4 | field(FTVL,"CHAR") 5 | field(NELM,"$(NELM)") 6 | info(asyn:INITIAL_READBACK, "$(INITIAL_READBACK=0)") 7 | } 8 | -------------------------------------------------------------------------------- /modbusApp/Db/stringin.template: -------------------------------------------------------------------------------- 1 | # longin record template for register inputs 2 | record(stringin,"$(P)$(R)") { 3 | field(DTYP,"asynOctetRead") 4 | field(INP,"@asyn($(PORT) $(OFFSET))$(DATA_TYPE)") 5 | field(SCAN,"$(SCAN)") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Db/stringout.template: -------------------------------------------------------------------------------- 1 | # stringout record template 2 | record(stringout,"$(P)$(R)") { 3 | field(DTYP,"asynOctetWrite") 4 | field(OUT,"@asyn($(PORT) $(OFFSET))$(DATA_TYPE)") 5 | info(asyn:INITIAL_READBACK, "$(INITIAL_READBACK=0)") 6 | } 7 | -------------------------------------------------------------------------------- /modbusApp/Makefile: -------------------------------------------------------------------------------- 1 | TOP = .. 2 | include $(TOP)/configure/CONFIG 3 | DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *src*)) 4 | DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Src*)) 5 | DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *db*)) 6 | DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Db*)) 7 | DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *op*)) 8 | include $(TOP)/configure/RULES_DIRS 9 | 10 | -------------------------------------------------------------------------------- /modbusApp/op/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/configure/CONFIG 3 | 4 | ADL_DIR = adl 5 | UI_DIR = ui/autoconvert 6 | EDL_DIR = edl/autoconvert 7 | OPI_DIR = opi/autoconvert 8 | BOB_DIR = bob/autoconvert 9 | 10 | include $(CONFIG)/RULES_DIRS 11 | 12 | -include $(SUPPORT)/configure/RULES_OPI 13 | -------------------------------------------------------------------------------- /modbusApp/op/adl/Koyo1.adl: -------------------------------------------------------------------------------- 1 | 2 | file { 3 | name="/home/epics/devel/modbus/beta4/modbusApp/op/adl/Koyo1.adl" 4 | version=030000 5 | } 6 | display { 7 | object { 8 | x=100 9 | y=100 10 | width=170 11 | height=145 12 | } 13 | clr=14 14 | bclr=4 15 | cmap="" 16 | gridSpacing=5 17 | gridOn=0 18 | snapToGrid=0 19 | } 20 | "color map" { 21 | ncolors=65 22 | colors { 23 | ffffff, 24 | ececec, 25 | dadada, 26 | c8c8c8, 27 | bbbbbb, 28 | aeaeae, 29 | 9e9e9e, 30 | 919191, 31 | 858585, 32 | 787878, 33 | 696969, 34 | 5a5a5a, 35 | 464646, 36 | 2d2d2d, 37 | 000000, 38 | 00d800, 39 | 1ebb00, 40 | 339900, 41 | 2d7f00, 42 | 216c00, 43 | fd0000, 44 | de1309, 45 | be190b, 46 | a01207, 47 | 820400, 48 | 5893ff, 49 | 597ee1, 50 | 4b6ec7, 51 | 3a5eab, 52 | 27548d, 53 | fbf34a, 54 | f9da3c, 55 | eeb62b, 56 | e19015, 57 | cd6100, 58 | ffb0ff, 59 | d67fe2, 60 | ae4ebc, 61 | 8b1a96, 62 | 610a75, 63 | a4aaff, 64 | 8793e2, 65 | 6a73c1, 66 | 4d52a4, 67 | 343386, 68 | c7bb6d, 69 | b79d5c, 70 | a47e3c, 71 | 7d5627, 72 | 58340f, 73 | 99ffff, 74 | 73dfff, 75 | 4ea5f9, 76 | 2a63e4, 77 | 0a00b8, 78 | ebf1b5, 79 | d4db9d, 80 | bbc187, 81 | a6a462, 82 | 8b8239, 83 | 73ff6b, 84 | 52da3b, 85 | 3cb420, 86 | 289315, 87 | 1a7309, 88 | } 89 | } 90 | text { 91 | object { 92 | x=12 93 | y=12 94 | width=146 95 | height=30 96 | } 97 | "basic attribute" { 98 | clr=14 99 | } 100 | textix="Koyo 1" 101 | align="horiz. centered" 102 | } 103 | composite { 104 | object { 105 | x=5 106 | y=51 107 | width=160 108 | height=85 109 | } 110 | "composite name"="" 111 | children { 112 | "related display" { 113 | object { 114 | x=5 115 | y=51 116 | width=158 117 | height=25 118 | } 119 | display[0] { 120 | label="X0-X7 inputs (bit access)" 121 | name="Koyo_8inputs.adl" 122 | args="P=KOYO1:,R=X,A=B,L=X0L,PORT=XnB,AC=Bit" 123 | } 124 | display[1] { 125 | label="X0-X7 inputs (word access)" 126 | name="Koyo_8inputs.adl" 127 | args="P=KOYO1:,R=X,A=W,L=XnL,PORT=XnW,AC=Word" 128 | } 129 | display[2] { 130 | label="Y0-Y7 inputs (bit access)" 131 | name="Koyo_8inputs.adl" 132 | args="P=KOYO1:,R=Y,A=InB,L=Y0InBL,PORT=YnInB,AC=Bit" 133 | } 134 | display[3] { 135 | label="Y0-Y7 inputs (word access)" 136 | name="Koyo_8inputs.adl" 137 | args="P=KOYO1:,R=Y,A=InW,L=YnInWL,PORT=YnInW,AC=Word" 138 | } 139 | display[4] { 140 | label="C0-C7 inputs (bit access)" 141 | name="Koyo_8inputs.adl" 142 | args="P=KOYO1:,R=C,A=InB,L=C0InBL,PORT=CnInB,AC=Bit" 143 | } 144 | display[5] { 145 | label="C0-C7 inputs (word access)" 146 | name="Koyo_8inputs.adl" 147 | args="P=KOYO1:,R=C,A=InW,L=CnInWL,PORT=CnInW,AC=Word" 148 | } 149 | display[6] { 150 | label="C200-C207 inputs (bit access)" 151 | name="Koyo_8inputs.adl" 152 | args="P=KOYO1:,R=C20,A=InB,L=C200InBL,PORT=CnInB,AC=Bit" 153 | } 154 | display[7] { 155 | label="C200-C207 inputs (word access)" 156 | name="Koyo_8inputs.adl" 157 | args="P=KOYO1:,R=C20,A=InW,L=C20nInWL,PORT=CnInW,AC=Word" 158 | } 159 | clr=14 160 | bclr=4 161 | label="Inputs" 162 | } 163 | "related display" { 164 | object { 165 | x=5 166 | y=81 167 | width=158 168 | height=25 169 | } 170 | display[0] { 171 | label="Y0-Y7 outputs (bit access)" 172 | name="Koyo_8outputs.adl" 173 | args="P=KOYO1:,R=Y,A=OutB,L=Y0OutBL,PORT=YnOutB,AC=Bit" 174 | } 175 | display[1] { 176 | label="Y0-Y7 outputs (word access)" 177 | name="Koyo_8outputs.adl" 178 | args="P=KOYO1:,R=Y,A=OutW,L=YnOutWL,PORT=YnOutW,AC=Word" 179 | } 180 | display[2] { 181 | label="C200-C207 outputs (bit access)" 182 | name="Koyo_8outputs.adl" 183 | args="P=KOYO1:,R=C20,A=OutB,L=C200OutBL,PORT=C20nOutB,AC=Bit" 184 | } 185 | display[3] { 186 | label="C200-C207 outputs (word access)" 187 | name="Koyo_8outputs.adl" 188 | args="P=KOYO1:,R=C20,A=OutW,L=C20nOutWL,PORT=CnOutW,AC=Word" 189 | } 190 | clr=14 191 | bclr=4 192 | label="Outputs" 193 | } 194 | "related display" { 195 | object { 196 | x=7 197 | y=111 198 | width=158 199 | height=25 200 | } 201 | display[0] { 202 | label="Octet asyn record" 203 | name="asynRecord.adl" 204 | args="P=KOYO1:,R=OctetAsyn" 205 | } 206 | display[2] { 207 | name="l" 208 | } 209 | clr=14 210 | bclr=4 211 | label="Octet asyn record" 212 | } 213 | } 214 | } 215 | -------------------------------------------------------------------------------- /modbusApp/op/adl/Koyo2.adl: -------------------------------------------------------------------------------- 1 | 2 | file { 3 | name="/home/epics/devel/modbus/beta4/modbusApp/op/adl/Koyo2.adl" 4 | version=030000 5 | } 6 | display { 7 | object { 8 | x=100 9 | y=100 10 | width=170 11 | height=145 12 | } 13 | clr=14 14 | bclr=4 15 | cmap="" 16 | gridSpacing=5 17 | gridOn=0 18 | snapToGrid=0 19 | } 20 | "color map" { 21 | ncolors=65 22 | colors { 23 | ffffff, 24 | ececec, 25 | dadada, 26 | c8c8c8, 27 | bbbbbb, 28 | aeaeae, 29 | 9e9e9e, 30 | 919191, 31 | 858585, 32 | 787878, 33 | 696969, 34 | 5a5a5a, 35 | 464646, 36 | 2d2d2d, 37 | 000000, 38 | 00d800, 39 | 1ebb00, 40 | 339900, 41 | 2d7f00, 42 | 216c00, 43 | fd0000, 44 | de1309, 45 | be190b, 46 | a01207, 47 | 820400, 48 | 5893ff, 49 | 597ee1, 50 | 4b6ec7, 51 | 3a5eab, 52 | 27548d, 53 | fbf34a, 54 | f9da3c, 55 | eeb62b, 56 | e19015, 57 | cd6100, 58 | ffb0ff, 59 | d67fe2, 60 | ae4ebc, 61 | 8b1a96, 62 | 610a75, 63 | a4aaff, 64 | 8793e2, 65 | 6a73c1, 66 | 4d52a4, 67 | 343386, 68 | c7bb6d, 69 | b79d5c, 70 | a47e3c, 71 | 7d5627, 72 | 58340f, 73 | 99ffff, 74 | 73dfff, 75 | 4ea5f9, 76 | 2a63e4, 77 | 0a00b8, 78 | ebf1b5, 79 | d4db9d, 80 | bbc187, 81 | a6a462, 82 | 8b8239, 83 | 73ff6b, 84 | 52da3b, 85 | 3cb420, 86 | 289315, 87 | 1a7309, 88 | } 89 | } 90 | text { 91 | object { 92 | x=12 93 | y=12 94 | width=146 95 | height=30 96 | } 97 | "basic attribute" { 98 | clr=14 99 | } 100 | textix="Koyo 2" 101 | align="horiz. centered" 102 | } 103 | composite { 104 | object { 105 | x=5 106 | y=51 107 | width=160 108 | height=85 109 | } 110 | "composite name"="" 111 | children { 112 | "related display" { 113 | object { 114 | x=5 115 | y=51 116 | width=160 117 | height=25 118 | } 119 | display[0] { 120 | label="Y0-Y7 inputs (bit access)" 121 | name="Koyo_8inputs.adl" 122 | args="P=KOYO2:,R=Y,A=InB,L=Y0InBL,PORT=YnInB,AC=Bit" 123 | } 124 | display[1] { 125 | label="C0-C7 inputs (bit access)" 126 | name="Koyo_8inputs.adl" 127 | args="P=KOYO2:,R=C,A=InB,L=C0InBL,PORT=CnInB,AC=Bit" 128 | } 129 | display[2] { 130 | label="C200-C207 inputs (bit access)" 131 | name="Koyo_8inputs.adl" 132 | args="P=KOYO2:,R=C20,A=InB,L=C200InBL,PORT=CnInB,AC=Bit" 133 | } 134 | display[3] { 135 | label="ADCs" 136 | name="Koyo_4ADC.adl" 137 | args="P=KOYO2:,R1=ADC1,R2=ADC2,R3=ADC3,R4=ADC4,PORT=V3000InW" 138 | } 139 | clr=14 140 | bclr=4 141 | label="Inputs" 142 | } 143 | "related display" { 144 | object { 145 | x=5 146 | y=81 147 | width=160 148 | height=25 149 | } 150 | display[0] { 151 | label="Y0-Y7 outputs (bit access)" 152 | name="Koyo_8outputs.adl" 153 | args="P=KOYO2:,R=Y,A=OutB,L=Y0OutBL,PORT=YnOutB,AC=Bit" 154 | } 155 | display[1] { 156 | label="C200-C207 outputs (bit access)" 157 | name="Koyo_8outputs.adl" 158 | args="P=KOYO2:,R=C20,A=OutB,L=C200OutBL,PORT=C20nOutB,AC=Bit" 159 | } 160 | clr=14 161 | bclr=4 162 | label="Outputs" 163 | } 164 | "related display" { 165 | object { 166 | x=5 167 | y=111 168 | width=160 169 | height=25 170 | } 171 | display[0] { 172 | label="Octet asyn record" 173 | name="asynRecord.adl" 174 | args="P=KOYO2:,R=OctetAsyn" 175 | } 176 | display[2] { 177 | name="l" 178 | } 179 | clr=14 180 | bclr=4 181 | label="Octet asyn record" 182 | } 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /modbusApp/op/adl/array_test.adl: -------------------------------------------------------------------------------- 1 | 2 | file { 3 | name="/home/epics/devel/modbus-2-7/modbusApp/op/adl/array_test.adl" 4 | version=030107 5 | } 6 | display { 7 | object { 8 | x=446 9 | y=76 10 | width=250 11 | height=100 12 | } 13 | clr=14 14 | bclr=4 15 | cmap="" 16 | gridSpacing=5 17 | gridOn=0 18 | snapToGrid=0 19 | } 20 | "color map" { 21 | ncolors=65 22 | colors { 23 | ffffff, 24 | ececec, 25 | dadada, 26 | c8c8c8, 27 | bbbbbb, 28 | aeaeae, 29 | 9e9e9e, 30 | 919191, 31 | 858585, 32 | 787878, 33 | 696969, 34 | 5a5a5a, 35 | 464646, 36 | 2d2d2d, 37 | 000000, 38 | 00d800, 39 | 1ebb00, 40 | 339900, 41 | 2d7f00, 42 | 216c00, 43 | fd0000, 44 | de1309, 45 | be190b, 46 | a01207, 47 | 820400, 48 | 5893ff, 49 | 597ee1, 50 | 4b6ec7, 51 | 3a5eab, 52 | 27548d, 53 | fbf34a, 54 | f9da3c, 55 | eeb62b, 56 | e19015, 57 | cd6100, 58 | ffb0ff, 59 | d67fe2, 60 | ae4ebc, 61 | 8b1a96, 62 | 610a75, 63 | a4aaff, 64 | 8793e2, 65 | 6a73c1, 66 | 4d52a4, 67 | 343386, 68 | c7bb6d, 69 | b79d5c, 70 | a47e3c, 71 | 7d5627, 72 | 58340f, 73 | 99ffff, 74 | 73dfff, 75 | 4ea5f9, 76 | 2a63e4, 77 | 0a00b8, 78 | ebf1b5, 79 | d4db9d, 80 | bbc187, 81 | a6a462, 82 | 8b8239, 83 | 73ff6b, 84 | 52da3b, 85 | 3cb420, 86 | 289315, 87 | 1a7309, 88 | } 89 | } 90 | text { 91 | object { 92 | x=65 93 | y=7 94 | width=120 95 | height=25 96 | } 97 | "basic attribute" { 98 | clr=14 99 | } 100 | textix="Array Test" 101 | align="horiz. centered" 102 | } 103 | "related display" { 104 | object { 105 | x=98 106 | y=58 107 | width=120 108 | height=20 109 | } 110 | display[0] { 111 | label="UINT16" 112 | name="modbusArrayTest.adl" 113 | args="P=SIM1:,R=UINT16:" 114 | } 115 | display[1] { 116 | label="INT16" 117 | name="modbusArrayTest.adl" 118 | args="P=SIM1:,R=INT16:" 119 | } 120 | display[2] { 121 | label="INT32_LE" 122 | name="modbusArrayTest.adl" 123 | args="P=SIM1:,R=INT32_LE:" 124 | } 125 | display[3] { 126 | label="INT32_BE" 127 | name="modbusArrayTest.adl" 128 | args="P=SIM1:,R=INT32_BE:" 129 | } 130 | clr=14 131 | bclr=51 132 | label="Arrays" 133 | } 134 | text { 135 | object { 136 | x=33 137 | y=58 138 | width=60 139 | height=20 140 | } 141 | "basic attribute" { 142 | clr=14 143 | } 144 | textix="Arrays" 145 | align="horiz. centered" 146 | } 147 | -------------------------------------------------------------------------------- /modbusApp/op/adl/modbusArray.adl: -------------------------------------------------------------------------------- 1 | 2 | file { 3 | name="/home/epics/devel/modbus/modbusApp/op/adl/modbusArray.adl" 4 | version=030105 5 | } 6 | display { 7 | object { 8 | x=730 9 | y=175 10 | width=560 11 | height=315 12 | } 13 | clr=14 14 | bclr=4 15 | cmap="" 16 | gridSpacing=5 17 | gridOn=0 18 | snapToGrid=0 19 | } 20 | "color map" { 21 | ncolors=65 22 | colors { 23 | ffffff, 24 | ececec, 25 | dadada, 26 | c8c8c8, 27 | bbbbbb, 28 | aeaeae, 29 | 9e9e9e, 30 | 919191, 31 | 858585, 32 | 787878, 33 | 696969, 34 | 5a5a5a, 35 | 464646, 36 | 2d2d2d, 37 | 000000, 38 | 00d800, 39 | 1ebb00, 40 | 339900, 41 | 2d7f00, 42 | 216c00, 43 | fd0000, 44 | de1309, 45 | be190b, 46 | a01207, 47 | 820400, 48 | 5893ff, 49 | 597ee1, 50 | 4b6ec7, 51 | 3a5eab, 52 | 27548d, 53 | fbf34a, 54 | f9da3c, 55 | eeb62b, 56 | e19015, 57 | cd6100, 58 | ffb0ff, 59 | d67fe2, 60 | ae4ebc, 61 | 8b1a96, 62 | 610a75, 63 | a4aaff, 64 | 8793e2, 65 | 6a73c1, 66 | 4d52a4, 67 | 343386, 68 | c7bb6d, 69 | b79d5c, 70 | a47e3c, 71 | 7d5627, 72 | 58340f, 73 | 99ffff, 74 | 73dfff, 75 | 4ea5f9, 76 | 2a63e4, 77 | 0a00b8, 78 | ebf1b5, 79 | d4db9d, 80 | bbc187, 81 | a6a462, 82 | 8b8239, 83 | 73ff6b, 84 | 52da3b, 85 | 3cb420, 86 | 289315, 87 | 1a7309, 88 | } 89 | } 90 | "cartesian plot" { 91 | object { 92 | x=5 93 | y=5 94 | width=550 95 | height=275 96 | } 97 | plotcom { 98 | title="Array data for $(P)$(R)" 99 | xlabel="Array index" 100 | ylabel="Value" 101 | clr=14 102 | bclr=5 103 | } 104 | style="fill-under" 105 | trace[0] { 106 | ydata="$(P)$(R)" 107 | data_clr=54 108 | } 109 | } 110 | text { 111 | object { 112 | x=375 113 | y=287 114 | width=80 115 | height=20 116 | } 117 | "basic attribute" { 118 | clr=14 119 | } 120 | textix="Severity" 121 | align="horiz. centered" 122 | } 123 | "text update" { 124 | object { 125 | x=460 126 | y=290 127 | width=75 128 | height=15 129 | } 130 | monitor { 131 | chan="$(P)$(R).SEVR" 132 | clr=53 133 | bclr=2 134 | } 135 | clrmod="alarm" 136 | align="horiz. right" 137 | limits { 138 | } 139 | } 140 | text { 141 | object { 142 | x=214 143 | y=287 144 | width=60 145 | height=20 146 | } 147 | "basic attribute" { 148 | clr=14 149 | } 150 | textix="Status" 151 | align="horiz. centered" 152 | } 153 | "text update" { 154 | object { 155 | x=279 156 | y=290 157 | width=75 158 | height=15 159 | } 160 | monitor { 161 | chan="$(P)$(R).STAT" 162 | clr=53 163 | bclr=2 164 | } 165 | clrmod="alarm" 166 | align="horiz. right" 167 | limits { 168 | } 169 | } 170 | composite { 171 | object { 172 | x=20 173 | y=287 174 | width=167 175 | height=20 176 | } 177 | "composite name"="" 178 | children { 179 | menu { 180 | object { 181 | x=87 182 | y=287 183 | width=100 184 | height=20 185 | } 186 | control { 187 | chan="$(P)$(R).SCAN" 188 | clr=14 189 | bclr=4 190 | } 191 | } 192 | text { 193 | object { 194 | x=20 195 | y=290 196 | width=63 197 | height=15 198 | } 199 | "basic attribute" { 200 | clr=14 201 | } 202 | textix="Update:" 203 | } 204 | } 205 | } 206 | -------------------------------------------------------------------------------- /modbusApp/op/adl/modbusArrayTest.adl: -------------------------------------------------------------------------------- 1 | 2 | file { 3 | name="/home/epics/devel/modbus/modbusApp/op/adl/modbusArrayTest.adl" 4 | version=030107 5 | } 6 | display { 7 | object { 8 | x=499 9 | y=277 10 | width=560 11 | height=350 12 | } 13 | clr=14 14 | bclr=4 15 | cmap="" 16 | gridSpacing=5 17 | gridOn=0 18 | snapToGrid=0 19 | } 20 | "color map" { 21 | ncolors=65 22 | colors { 23 | ffffff, 24 | ececec, 25 | dadada, 26 | c8c8c8, 27 | bbbbbb, 28 | aeaeae, 29 | 9e9e9e, 30 | 919191, 31 | 858585, 32 | 787878, 33 | 696969, 34 | 5a5a5a, 35 | 464646, 36 | 2d2d2d, 37 | 000000, 38 | 00d800, 39 | 1ebb00, 40 | 339900, 41 | 2d7f00, 42 | 216c00, 43 | fd0000, 44 | de1309, 45 | be190b, 46 | a01207, 47 | 820400, 48 | 5893ff, 49 | 597ee1, 50 | 4b6ec7, 51 | 3a5eab, 52 | 27548d, 53 | fbf34a, 54 | f9da3c, 55 | eeb62b, 56 | e19015, 57 | cd6100, 58 | ffb0ff, 59 | d67fe2, 60 | ae4ebc, 61 | 8b1a96, 62 | 610a75, 63 | a4aaff, 64 | 8793e2, 65 | 6a73c1, 66 | 4d52a4, 67 | 343386, 68 | c7bb6d, 69 | b79d5c, 70 | a47e3c, 71 | 7d5627, 72 | 58340f, 73 | 99ffff, 74 | 73dfff, 75 | 4ea5f9, 76 | 2a63e4, 77 | 0a00b8, 78 | ebf1b5, 79 | d4db9d, 80 | bbc187, 81 | a6a462, 82 | 8b8239, 83 | 73ff6b, 84 | 52da3b, 85 | 3cb420, 86 | 289315, 87 | 1a7309, 88 | } 89 | } 90 | "cartesian plot" { 91 | object { 92 | x=5 93 | y=5 94 | width=550 95 | height=275 96 | } 97 | plotcom { 98 | title="Array data for $(P)$(R)" 99 | xlabel="Array index" 100 | ylabel="Value" 101 | clr=14 102 | bclr=5 103 | } 104 | style="fill-under" 105 | trace[0] { 106 | ydata="$(P)$(R)ArrayIn" 107 | data_clr=54 108 | yaxis=0 109 | } 110 | } 111 | text { 112 | object { 113 | x=375 114 | y=288 115 | width=80 116 | height=20 117 | } 118 | "basic attribute" { 119 | clr=14 120 | } 121 | textix="Severity" 122 | align="horiz. centered" 123 | } 124 | "text update" { 125 | object { 126 | x=460 127 | y=291 128 | width=75 129 | height=15 130 | } 131 | monitor { 132 | chan="$(P)$(R)ArrayIn.SEVR" 133 | clr=53 134 | bclr=2 135 | } 136 | clrmod="alarm" 137 | align="horiz. right" 138 | limits { 139 | } 140 | } 141 | text { 142 | object { 143 | x=214 144 | y=288 145 | width=60 146 | height=20 147 | } 148 | "basic attribute" { 149 | clr=14 150 | } 151 | textix="Status" 152 | align="horiz. centered" 153 | } 154 | "text update" { 155 | object { 156 | x=279 157 | y=291 158 | width=75 159 | height=15 160 | } 161 | monitor { 162 | chan="$(P)$(R)ArrayIn.STAT" 163 | clr=53 164 | bclr=2 165 | } 166 | clrmod="alarm" 167 | align="horiz. right" 168 | limits { 169 | } 170 | } 171 | menu { 172 | object { 173 | x=87 174 | y=288 175 | width=100 176 | height=20 177 | } 178 | control { 179 | chan="$(P)$(R)ArrayIn.SCAN" 180 | clr=14 181 | bclr=4 182 | } 183 | } 184 | text { 185 | object { 186 | x=20 187 | y=288 188 | width=60 189 | height=20 190 | } 191 | "basic attribute" { 192 | clr=14 193 | } 194 | textix="Update" 195 | } 196 | "text entry" { 197 | object { 198 | x=117 199 | y=319 200 | width=50 201 | height=20 202 | } 203 | control { 204 | chan="$(P)$(R)PollDelay" 205 | clr=14 206 | bclr=51 207 | } 208 | limits { 209 | } 210 | } 211 | text { 212 | object { 213 | x=12 214 | y=319 215 | width=100 216 | height=20 217 | } 218 | "basic attribute" { 219 | clr=14 220 | } 221 | textix="Poll delay" 222 | align="horiz. centered" 223 | } 224 | "related display" { 225 | object { 226 | x=396 227 | y=319 228 | width=53 229 | height=20 230 | } 231 | display[0] { 232 | label="asynRecord Out" 233 | name="asynRecord.adl" 234 | args="P=$(P), R=A0:AsynOut" 235 | } 236 | display[1] { 237 | label="asynRecord In" 238 | name="asynRecord.adl" 239 | args="P=$(P), R=A0:AsynIn" 240 | } 241 | display[2] { 242 | label="I/O Statistics" 243 | name="modbusStatistics.adl" 244 | args="P=$(P), R=A0:" 245 | } 246 | clr=14 247 | bclr=51 248 | label="More" 249 | } 250 | text { 251 | object { 252 | x=194 253 | y=319 254 | width=120 255 | height=20 256 | } 257 | "basic attribute" { 258 | clr=14 259 | } 260 | textix="Poll trigger" 261 | align="horiz. centered" 262 | } 263 | "message button" { 264 | object { 265 | x=319 266 | y=319 267 | width=57 268 | height=20 269 | } 270 | control { 271 | chan="$(P)$(R)PollTrigger" 272 | clr=14 273 | bclr=51 274 | } 275 | label="Trigger" 276 | press_msg="1" 277 | } 278 | -------------------------------------------------------------------------------- /modbusApp/op/adl/modbusDataTypesTest.adl: -------------------------------------------------------------------------------- 1 | 2 | file { 3 | name="/home/epics/devel/modbus/modbusApp/op/adl/modbusDataTypesTest.adl" 4 | version=030109 5 | } 6 | display { 7 | object { 8 | x=100 9 | y=100 10 | width=170 11 | height=120 12 | } 13 | clr=14 14 | bclr=4 15 | cmap="" 16 | gridSpacing=5 17 | gridOn=0 18 | snapToGrid=0 19 | } 20 | "color map" { 21 | ncolors=65 22 | colors { 23 | ffffff, 24 | ececec, 25 | dadada, 26 | c8c8c8, 27 | bbbbbb, 28 | aeaeae, 29 | 9e9e9e, 30 | 919191, 31 | 858585, 32 | 787878, 33 | 696969, 34 | 5a5a5a, 35 | 464646, 36 | 2d2d2d, 37 | 000000, 38 | 00d800, 39 | 1ebb00, 40 | 339900, 41 | 2d7f00, 42 | 216c00, 43 | fd0000, 44 | de1309, 45 | be190b, 46 | a01207, 47 | 820400, 48 | 5893ff, 49 | 597ee1, 50 | 4b6ec7, 51 | 3a5eab, 52 | 27548d, 53 | fbf34a, 54 | f9da3c, 55 | eeb62b, 56 | e19015, 57 | cd6100, 58 | ffb0ff, 59 | d67fe2, 60 | ae4ebc, 61 | 8b1a96, 62 | 610a75, 63 | a4aaff, 64 | 8793e2, 65 | 6a73c1, 66 | 4d52a4, 67 | 343386, 68 | c7bb6d, 69 | b79d5c, 70 | a47e3c, 71 | 7d5627, 72 | 58340f, 73 | 99ffff, 74 | 73dfff, 75 | 4ea5f9, 76 | 2a63e4, 77 | 0a00b8, 78 | ebf1b5, 79 | d4db9d, 80 | bbc187, 81 | a6a462, 82 | 8b8239, 83 | 73ff6b, 84 | 52da3b, 85 | 3cb420, 86 | 289315, 87 | 1a7309, 88 | } 89 | } 90 | text { 91 | object { 92 | x=12 93 | y=12 94 | width=146 95 | height=25 96 | } 97 | "basic attribute" { 98 | clr=14 99 | } 100 | textix="Sim1 Test" 101 | align="horiz. centered" 102 | } 103 | "related display" { 104 | object { 105 | x=5 106 | y=51 107 | width=158 108 | height=25 109 | } 110 | display[0] { 111 | label="longout/longin" 112 | name="modbusDataTypes.adl" 113 | args="P=SIM1:,OUT=LO:,IN=LI:,OREC=longout,IREC=longin" 114 | } 115 | display[1] { 116 | label="int64out/int64in" 117 | name="modbusDataTypes.adl" 118 | args="P=SIM1:,OUT=I64O:,IN=I64I:,OREC=int64out,IREC=int64in" 119 | } 120 | display[2] { 121 | label="ao/ai" 122 | name="modbusDataTypes.adl" 123 | args="P=SIM1:,OUT=AO:,IN=AI:,OREC=ao,IREC=ai" 124 | } 125 | display[3] { 126 | label="Binary inputs" 127 | name="Koyo_8inputs.adl" 128 | args="P=SIM1:,R=BI,A=B,L=MBBID0,PORT=BI,AC=Bit" 129 | } 130 | display[4] { 131 | label="Binary outputs" 132 | name="Koyo_8outputs.adl" 133 | args="P=SIM1:,R=BO,A=B,L=MBBOD0,PORT=BO,AC=Bit" 134 | } 135 | clr=14 136 | bclr=51 137 | label="Inputs & outputs" 138 | } 139 | "related display" { 140 | object { 141 | x=7 142 | y=81 143 | width=158 144 | height=25 145 | } 146 | display[0] { 147 | label="Octet asyn record" 148 | name="asynRecord.adl" 149 | args="P=SIM1:,R=OctetAsyn" 150 | } 151 | display[2] { 152 | name="l" 153 | } 154 | clr=14 155 | bclr=51 156 | label="Octet asyn record" 157 | } 158 | -------------------------------------------------------------------------------- /modbusApp/op/adl/modbusStatistics.adl: -------------------------------------------------------------------------------- 1 | 2 | file { 3 | name="/home/epics/devel/modbus/modbusApp/op/adl/modbusStatistics.adl" 4 | version=030107 5 | } 6 | display { 7 | object { 8 | x=730 9 | y=50 10 | width=560 11 | height=375 12 | } 13 | clr=14 14 | bclr=4 15 | cmap="" 16 | gridSpacing=5 17 | gridOn=0 18 | snapToGrid=0 19 | } 20 | "color map" { 21 | ncolors=65 22 | colors { 23 | ffffff, 24 | ececec, 25 | dadada, 26 | c8c8c8, 27 | bbbbbb, 28 | aeaeae, 29 | 9e9e9e, 30 | 919191, 31 | 858585, 32 | 787878, 33 | 696969, 34 | 5a5a5a, 35 | 464646, 36 | 2d2d2d, 37 | 000000, 38 | 00d800, 39 | 1ebb00, 40 | 339900, 41 | 2d7f00, 42 | 216c00, 43 | fd0000, 44 | de1309, 45 | be190b, 46 | a01207, 47 | 820400, 48 | 5893ff, 49 | 597ee1, 50 | 4b6ec7, 51 | 3a5eab, 52 | 27548d, 53 | fbf34a, 54 | f9da3c, 55 | eeb62b, 56 | e19015, 57 | cd6100, 58 | ffb0ff, 59 | d67fe2, 60 | ae4ebc, 61 | 8b1a96, 62 | 610a75, 63 | a4aaff, 64 | 8793e2, 65 | 6a73c1, 66 | 4d52a4, 67 | 343386, 68 | c7bb6d, 69 | b79d5c, 70 | a47e3c, 71 | 7d5627, 72 | 58340f, 73 | 99ffff, 74 | 73dfff, 75 | 4ea5f9, 76 | 2a63e4, 77 | 0a00b8, 78 | ebf1b5, 79 | d4db9d, 80 | bbc187, 81 | a6a462, 82 | 8b8239, 83 | 73ff6b, 84 | 52da3b, 85 | 3cb420, 86 | 289315, 87 | 1a7309, 88 | } 89 | } 90 | "cartesian plot" { 91 | object { 92 | x=5 93 | y=5 94 | width=550 95 | height=275 96 | } 97 | plotcom { 98 | title="Histogram of cycle times $(P)$(R)" 99 | xlabel="Write/read cycle time (msec)" 100 | ylabel="Number of events" 101 | clr=14 102 | bclr=5 103 | } 104 | style="fill-under" 105 | trace[0] { 106 | xdata="$(P)$(R)HistTimeAxis" 107 | ydata="$(P)$(R)Hist" 108 | data_clr=54 109 | yaxis=0 110 | } 111 | } 112 | "choice button" { 113 | object { 114 | x=202 115 | y=286 116 | width=150 117 | height=20 118 | } 119 | control { 120 | chan="$(P)$(R)HistEnable" 121 | clr=14 122 | bclr=52 123 | } 124 | stacking="column" 125 | } 126 | text { 127 | object { 128 | x=10 129 | y=289 130 | width=189 131 | height=15 132 | } 133 | "basic attribute" { 134 | clr=14 135 | } 136 | textix="Enable histogramming:" 137 | } 138 | menu { 139 | object { 140 | x=437 141 | y=286 142 | width=100 143 | height=20 144 | } 145 | control { 146 | chan="$(P)$(R)Statistics.SCAN" 147 | clr=14 148 | bclr=4 149 | } 150 | } 151 | text { 152 | object { 153 | x=370 154 | y=289 155 | width=63 156 | height=15 157 | } 158 | "basic attribute" { 159 | clr=14 160 | } 161 | textix="Update:" 162 | } 163 | text { 164 | object { 165 | x=11 166 | y=309 167 | width=72 168 | height=15 169 | } 170 | "basic attribute" { 171 | clr=14 172 | } 173 | textix="msec per bin" 174 | } 175 | composite { 176 | object { 177 | x=10 178 | y=329 179 | width=542 180 | height=36 181 | } 182 | "composite name"="" 183 | children { 184 | composite { 185 | object { 186 | x=10 187 | y=329 188 | width=145 189 | height=15 190 | } 191 | "composite name"="" 192 | children { 193 | "text update" { 194 | object { 195 | x=85 196 | y=329 197 | width=70 198 | height=15 199 | } 200 | monitor { 201 | chan="$(P)$(R)ReadOK" 202 | clr=53 203 | bclr=2 204 | } 205 | limits { 206 | } 207 | } 208 | text { 209 | object { 210 | x=10 211 | y=329 212 | width=72 213 | height=15 214 | } 215 | "basic attribute" { 216 | clr=14 217 | } 218 | textix="Read OK:" 219 | } 220 | } 221 | } 222 | "text update" { 223 | object { 224 | x=251 225 | y=329 226 | width=70 227 | height=15 228 | } 229 | monitor { 230 | chan="$(P)$(R)WriteOK" 231 | clr=53 232 | bclr=2 233 | } 234 | limits { 235 | } 236 | } 237 | text { 238 | object { 239 | x=165 240 | y=329 241 | width=81 242 | height=15 243 | } 244 | "basic attribute" { 245 | clr=14 246 | } 247 | textix="Write OK:" 248 | } 249 | "text update" { 250 | object { 251 | x=445 252 | y=329 253 | width=70 254 | height=15 255 | } 256 | monitor { 257 | chan="$(P)$(R)IOErrors" 258 | clr=53 259 | bclr=2 260 | } 261 | limits { 262 | } 263 | } 264 | text { 265 | object { 266 | x=342 267 | y=329 268 | width=99 269 | height=15 270 | } 271 | "basic attribute" { 272 | clr=14 273 | } 274 | textix="I/O Errors:" 275 | } 276 | composite { 277 | object { 278 | x=10 279 | y=350 280 | width=265 281 | height=15 282 | } 283 | "composite name"="" 284 | children { 285 | text { 286 | object { 287 | x=10 288 | y=350 289 | width=189 290 | height=15 291 | } 292 | "basic attribute" { 293 | clr=14 294 | } 295 | textix="Last I/O Time (msec):" 296 | } 297 | "text update" { 298 | object { 299 | x=205 300 | y=350 301 | width=70 302 | height=15 303 | } 304 | monitor { 305 | chan="$(P)$(R)LastIOTime" 306 | clr=53 307 | bclr=2 308 | } 309 | limits { 310 | } 311 | } 312 | } 313 | } 314 | text { 315 | object { 316 | x=287 317 | y=350 318 | width=189 319 | height=15 320 | } 321 | "basic attribute" { 322 | clr=14 323 | } 324 | textix="Max. I/O Time (msec):" 325 | } 326 | "text update" { 327 | object { 328 | x=482 329 | y=350 330 | width=70 331 | height=15 332 | } 333 | monitor { 334 | chan="$(P)$(R)MaxIOTime" 335 | clr=53 336 | bclr=2 337 | } 338 | limits { 339 | } 340 | } 341 | } 342 | } 343 | "text entry" { 344 | object { 345 | x=129 346 | y=309 347 | width=78 348 | height=15 349 | } 350 | control { 351 | chan="$(P)$(R)MsPerBin" 352 | clr=14 353 | bclr=51 354 | } 355 | limits { 356 | } 357 | } 358 | -------------------------------------------------------------------------------- /modbusApp/op/adl/modbusStringTestTop.adl: -------------------------------------------------------------------------------- 1 | 2 | file { 3 | name="/home/epics/devel/modbus-2-8/modbusApp/op/adl/modbusStringTestTop.adl" 4 | version=030107 5 | } 6 | display { 7 | object { 8 | x=147 9 | y=151 10 | width=280 11 | height=100 12 | } 13 | clr=14 14 | bclr=4 15 | cmap="" 16 | gridSpacing=5 17 | gridOn=0 18 | snapToGrid=0 19 | } 20 | "color map" { 21 | ncolors=65 22 | colors { 23 | ffffff, 24 | ececec, 25 | dadada, 26 | c8c8c8, 27 | bbbbbb, 28 | aeaeae, 29 | 9e9e9e, 30 | 919191, 31 | 858585, 32 | 787878, 33 | 696969, 34 | 5a5a5a, 35 | 464646, 36 | 2d2d2d, 37 | 000000, 38 | 00d800, 39 | 1ebb00, 40 | 339900, 41 | 2d7f00, 42 | 216c00, 43 | fd0000, 44 | de1309, 45 | be190b, 46 | a01207, 47 | 820400, 48 | 5893ff, 49 | 597ee1, 50 | 4b6ec7, 51 | 3a5eab, 52 | 27548d, 53 | fbf34a, 54 | f9da3c, 55 | eeb62b, 56 | e19015, 57 | cd6100, 58 | ffb0ff, 59 | d67fe2, 60 | ae4ebc, 61 | 8b1a96, 62 | 610a75, 63 | a4aaff, 64 | 8793e2, 65 | 6a73c1, 66 | 4d52a4, 67 | 343386, 68 | c7bb6d, 69 | b79d5c, 70 | a47e3c, 71 | 7d5627, 72 | 58340f, 73 | 99ffff, 74 | 73dfff, 75 | 4ea5f9, 76 | 2a63e4, 77 | 0a00b8, 78 | ebf1b5, 79 | d4db9d, 80 | bbc187, 81 | a6a462, 82 | 8b8239, 83 | 73ff6b, 84 | 52da3b, 85 | 3cb420, 86 | 289315, 87 | 1a7309, 88 | } 89 | } 90 | "related display" { 91 | object { 92 | x=61 93 | y=46 94 | width=158 95 | height=25 96 | } 97 | display[0] { 98 | label="Modbus String Test" 99 | name="modbusStringTest.adl" 100 | args="P=SIM1:,SO=SO,SI=SI,WFOUT=WFOut,WFIN=WFIn" 101 | } 102 | clr=14 103 | bclr=4 104 | label="StringTest" 105 | } 106 | text { 107 | object { 108 | x=8 109 | y=10 110 | width=264 111 | height=25 112 | } 113 | "basic attribute" { 114 | clr=14 115 | } 116 | textix="Modbus String Test Top" 117 | align="horiz. centered" 118 | } 119 | -------------------------------------------------------------------------------- /modbusApp/op/adl/modbusTestSyncIO.adl: -------------------------------------------------------------------------------- 1 | 2 | file { 3 | name="/home/epics/devel/modbus/modbusApp/op/adl/modbusTestSyncIO.adl" 4 | version=030105 5 | } 6 | display { 7 | object { 8 | x=644 9 | y=65 10 | width=350 11 | height=205 12 | } 13 | clr=14 14 | bclr=4 15 | cmap="" 16 | gridSpacing=5 17 | gridOn=0 18 | snapToGrid=0 19 | } 20 | "color map" { 21 | ncolors=65 22 | colors { 23 | ffffff, 24 | ececec, 25 | dadada, 26 | c8c8c8, 27 | bbbbbb, 28 | aeaeae, 29 | 9e9e9e, 30 | 919191, 31 | 858585, 32 | 787878, 33 | 696969, 34 | 5a5a5a, 35 | 464646, 36 | 2d2d2d, 37 | 000000, 38 | 00d800, 39 | 1ebb00, 40 | 339900, 41 | 2d7f00, 42 | 216c00, 43 | fd0000, 44 | de1309, 45 | be190b, 46 | a01207, 47 | 820400, 48 | 5893ff, 49 | 597ee1, 50 | 4b6ec7, 51 | 3a5eab, 52 | 27548d, 53 | fbf34a, 54 | f9da3c, 55 | eeb62b, 56 | e19015, 57 | cd6100, 58 | ffb0ff, 59 | d67fe2, 60 | ae4ebc, 61 | 8b1a96, 62 | 610a75, 63 | a4aaff, 64 | 8793e2, 65 | 6a73c1, 66 | 4d52a4, 67 | 343386, 68 | c7bb6d, 69 | b79d5c, 70 | a47e3c, 71 | 7d5627, 72 | 58340f, 73 | 99ffff, 74 | 73dfff, 75 | 4ea5f9, 76 | 2a63e4, 77 | 0a00b8, 78 | ebf1b5, 79 | d4db9d, 80 | bbc187, 81 | a6a462, 82 | 8b8239, 83 | 73ff6b, 84 | 52da3b, 85 | 3cb420, 86 | 289315, 87 | 1a7309, 88 | } 89 | } 90 | text { 91 | object { 92 | x=102 93 | y=7 94 | width=146 95 | height=25 96 | } 97 | "basic attribute" { 98 | clr=14 99 | } 100 | textix="SyncIO Test" 101 | align="horiz. centered" 102 | } 103 | "related display" { 104 | object { 105 | x=115 106 | y=175 107 | width=120 108 | height=20 109 | } 110 | display[0] { 111 | label="Octet driver" 112 | name="asynRecord.adl" 113 | args="P=SIM1:,R=OctetAsyn" 114 | } 115 | display[1] { 116 | label="Modbus input driver" 117 | name="asynRecord.adl" 118 | args="P=SIM1:,R=InputAsyn" 119 | } 120 | display[2] { 121 | label="Modbus output driver" 122 | name="asynRecord.adl" 123 | args="P=SIM1:,R=OutputAsyn" 124 | } 125 | display[3] { 126 | label="SyncIO driver" 127 | name="asynRecord.adl" 128 | args="P=SIM1:,R=SyncIOAsyn" 129 | } 130 | clr=14 131 | bclr=51 132 | label="asyn records" 133 | } 134 | text { 135 | object { 136 | x=18 137 | y=40 138 | width=120 139 | height=20 140 | } 141 | "basic attribute" { 142 | clr=14 143 | } 144 | textix="Modbus input" 145 | align="horiz. centered" 146 | } 147 | text { 148 | object { 149 | x=8 150 | y=65 151 | width=130 152 | height=20 153 | } 154 | "basic attribute" { 155 | clr=14 156 | } 157 | textix="Modbus output" 158 | align="horiz. centered" 159 | } 160 | text { 161 | object { 162 | x=18 163 | y=90 164 | width=120 165 | height=20 166 | } 167 | "basic attribute" { 168 | clr=14 169 | } 170 | textix="SyncIO input" 171 | align="horiz. centered" 172 | } 173 | text { 174 | object { 175 | x=8 176 | y=115 177 | width=130 178 | height=20 179 | } 180 | "basic attribute" { 181 | clr=14 182 | } 183 | textix="SyncIO output" 184 | align="horiz. centered" 185 | } 186 | "text update" { 187 | object { 188 | x=148 189 | y=40 190 | width=80 191 | height=20 192 | } 193 | monitor { 194 | chan="SIM1:LI:UINT16" 195 | clr=54 196 | bclr=4 197 | } 198 | align="horiz. centered" 199 | limits { 200 | } 201 | } 202 | "text update" { 203 | object { 204 | x=148 205 | y=90 206 | width=80 207 | height=20 208 | } 209 | monitor { 210 | chan="SIM1:SYNC_IN:INT32" 211 | clr=54 212 | bclr=4 213 | } 214 | align="horiz. centered" 215 | limits { 216 | } 217 | } 218 | "text entry" { 219 | object { 220 | x=148 221 | y=65 222 | width=80 223 | height=20 224 | } 225 | control { 226 | chan="SIM1:LO:UINT16" 227 | clr=14 228 | bclr=51 229 | } 230 | limits { 231 | } 232 | } 233 | "text entry" { 234 | object { 235 | x=148 236 | y=115 237 | width=80 238 | height=20 239 | } 240 | control { 241 | chan="SIM1:SYNC_OUT:INT32" 242 | clr=14 243 | bclr=51 244 | } 245 | limits { 246 | } 247 | } 248 | menu { 249 | object { 250 | x=244 251 | y=90 252 | width=95 253 | height=20 254 | } 255 | control { 256 | chan="SIM1:SYNC_IN:INT32.SCAN" 257 | clr=14 258 | bclr=4 259 | } 260 | } 261 | "text entry" { 262 | object { 263 | x=148 264 | y=140 265 | width=80 266 | height=20 267 | } 268 | control { 269 | chan="SIM1:LOCK_OUT:INT32" 270 | clr=14 271 | bclr=51 272 | } 273 | limits { 274 | } 275 | } 276 | text { 277 | object { 278 | x=8 279 | y=140 280 | width=130 281 | height=20 282 | } 283 | "basic attribute" { 284 | clr=14 285 | } 286 | textix="LockIO output" 287 | align="horiz. centered" 288 | } 289 | -------------------------------------------------------------------------------- /modbusApp/op/bob/autoconvert/Koyo2.bob: -------------------------------------------------------------------------------- 1 | 2 | 3 | Koyo2 4 | 100 5 | 100 6 | 170 7 | 145 8 | 9 | 10 | 11 | 12 | false 13 | 5 14 | 15 | text #6 16 | Koyo 2 17 | 12 18 | 12 19 | 146 20 | 30 21 | 22 | 23 | 24 | 25 | 1 26 | 27 | 28 | composite #9 29 | 5 30 | 51 31 | 160 32 | 85 33 | 34 | true 35 | 36 | related display #12 37 | 38 | 39 | Koyo_8inputs.opi 40 | 41 | InB 42 | Bit 43 | Y0InBL 44 |

KOYO2:

45 | YnInB 46 | Y 47 |
48 | tab 49 | Y0-Y7 inputs (bit access) 50 |
51 | 52 | Koyo_8inputs.opi 53 | 54 | InB 55 | Bit 56 | C0InBL 57 |

KOYO2:

58 | CnInB 59 | C 60 |
61 | tab 62 | C0-C7 inputs (bit access) 63 |
64 | 65 | Koyo_8inputs.opi 66 | 67 | InB 68 | Bit 69 | C200InBL 70 |

KOYO2:

71 | CnInB 72 | C20 73 |
74 | tab 75 | C200-C207 inputs (bit access) 76 |
77 | 78 | Koyo_4ADC.opi 79 | 80 |

KOYO2:

81 | V3000InW 82 | ADC1 83 | ADC2 84 | ADC3 85 | ADC4 86 |
87 | tab 88 | ADCs 89 |
90 |
91 | Inputs 92 | 160 93 | 25 94 | 95 | 96 | 97 | 98 |
99 | 100 | related display #18 101 | 102 | 103 | Koyo_8outputs.opi 104 | 105 | OutB 106 | Bit 107 | Y0OutBL 108 |

KOYO2:

109 | YnOutB 110 | Y 111 |
112 | tab 113 | Y0-Y7 outputs (bit access) 114 |
115 | 116 | Koyo_8outputs.opi 117 | 118 | OutB 119 | Bit 120 | C200OutBL 121 |

KOYO2:

122 | C20nOutB 123 | C20 124 |
125 | tab 126 | C200-C207 outputs (bit access) 127 |
128 |
129 | Outputs 130 | 30 131 | 160 132 | 25 133 | 134 | 135 | 136 | 137 |
138 | 139 | related display #22 140 | 141 | 142 | asynRecord.opi 143 | 144 |

KOYO2:

145 | OctetAsyn 146 |
147 | tab 148 | Octet asyn record 149 |
150 | 151 | l 152 | tab 153 | 154 |
155 | Octet asyn record 156 | 60 157 | 160 158 | 25 159 | 160 | 161 | 162 | 163 |
164 |
165 |
166 | -------------------------------------------------------------------------------- /modbusApp/op/bob/autoconvert/array_test.bob: -------------------------------------------------------------------------------- 1 | 2 | 3 | array_test 4 | 446 5 | 76 6 | 250 7 | 100 8 | 9 | 10 | 11 | 12 | false 13 | 5 14 | 15 | text #6 16 | Array Test 17 | 65 18 | 7 19 | 120 20 | 25 21 | 22 | 23 | 24 | 25 | 1 26 | 27 | 28 | related display #9 29 | 30 | 31 | modbusArrayTest.opi 32 | 33 |

SIM1:

34 | UINT16: 35 |
36 | tab 37 | UINT16 38 |
39 | 40 | modbusArrayTest.opi 41 | 42 |

SIM1:

43 | INT16: 44 |
45 | tab 46 | INT16 47 |
48 | 49 | modbusArrayTest.opi 50 | 51 |

SIM1:

52 | INT32_LE: 53 |
54 | tab 55 | INT32_LE 56 |
57 | 58 | modbusArrayTest.opi 59 | 60 |

SIM1:

61 | INT32_BE: 62 |
63 | tab 64 | INT32_BE 65 |
66 |
67 | Arrays 68 | 98 69 | 58 70 | 120 71 | 20 72 | 73 | 74 | 75 | 76 |
77 | 78 | text #15 79 | Arrays 80 | 33 81 | 58 82 | 60 83 | 84 | 85 | 86 | 87 | 1 88 | 89 |
90 | -------------------------------------------------------------------------------- /modbusApp/op/bob/autoconvert/modbusArray.bob: -------------------------------------------------------------------------------- 1 | 2 | 3 | modbusArray 4 | 730 5 | 175 6 | 560 7 | 315 8 | 9 | 10 | 11 | 12 | false 13 | 5 14 | 15 | cartesian plot #6 16 | 5 17 | 5 18 | 550 19 | 275 20 | Array data for $(P)$(R) 21 | 22 | Array index 23 | true 24 | false 25 | 0.0 26 | 100.0 27 | false 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | true 37 | 38 | 39 | 40 | Value 41 | true 42 | false 43 | 0.0 44 | 100.0 45 | false 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | true 55 | 56 | 57 | 58 | 59 | $(traces[0].y_pv) 60 | 61 | $(P)$(R) 62 | 63 | 0 64 | 1 65 | 66 | 67 | 68 | 69 | 1 70 | 0 71 | 0 72 | 10 73 | true 74 | 75 | 76 | 77 | 78 | text #10 79 | Severity 80 | 375 81 | 287 82 | 80 83 | 84 | 85 | 86 | 87 | 1 88 | 89 | 90 | text update #13 91 | $(P)$(R).SEVR 92 | 460 93 | 290 94 | 75 95 | 15 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 1 109 | false 110 | 2 111 | 112 | 113 | text #17 114 | Status 115 | 214 116 | 287 117 | 60 118 | 119 | 120 | 121 | 122 | 1 123 | 124 | 125 | text update #20 126 | $(P)$(R).STAT 127 | 279 128 | 290 129 | 75 130 | 15 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 1 144 | false 145 | 2 146 | 147 | 148 | composite #24 149 | 20 150 | 287 151 | 167 152 | 20 153 | 154 | true 155 | 156 | menu #27 157 | $(P)$(R).SCAN 158 | 67 159 | 20 160 | 161 | 162 | 163 | 164 | false 165 | 166 | 167 | text #30 168 | Update: 169 | 3 170 | 63 171 | 15 172 | 173 | 174 | 175 | 176 | true 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /modbusApp/op/bob/autoconvert/modbusDataTypesTest.bob: -------------------------------------------------------------------------------- 1 | 2 | 3 | modbusDataTypesTest 4 | 100 5 | 100 6 | 170 7 | 120 8 | 9 | 10 | 11 | 12 | false 13 | 5 14 | 15 | text #6 16 | Sim1 Test 17 | 12 18 | 12 19 | 146 20 | 25 21 | 22 | 23 | 24 | 25 | 1 26 | 27 | 28 | related display #9 29 | 30 | 31 | modbusDataTypes.opi 32 | 33 | LI: 34 | longin 35 | longout 36 | LO: 37 |

SIM1:

38 |
39 | tab 40 | longout/longin 41 |
42 | 43 | modbusDataTypes.opi 44 | 45 | I64I: 46 | int64in 47 | int64out 48 | I64O: 49 |

SIM1:

50 |
51 | tab 52 | int64out/int64in 53 |
54 | 55 | modbusDataTypes.opi 56 | 57 | AI: 58 | ai 59 | ao 60 | AO: 61 |

SIM1:

62 |
63 | tab 64 | ao/ai 65 |
66 | 67 | Koyo_8inputs.opi 68 | 69 | B 70 | Bit 71 | MBBID0 72 |

SIM1:

73 | BI 74 | BI 75 |
76 | tab 77 | Binary inputs 78 |
79 | 80 | Koyo_8outputs.opi 81 | 82 | B 83 | Bit 84 | MBBOD0 85 |

SIM1:

86 | BO 87 | BO 88 |
89 | tab 90 | Binary outputs 91 |
92 |
93 | Inputs & outputs 94 | 5 95 | 51 96 | 158 97 | 25 98 | 99 | 100 | 101 | 102 |
103 | 104 | related display #16 105 | 106 | 107 | asynRecord.opi 108 | 109 |

SIM1:

110 | OctetAsyn 111 |
112 | tab 113 | Octet asyn record 114 |
115 | 116 | l 117 | tab 118 | 119 |
120 | Octet asyn record 121 | 7 122 | 81 123 | 158 124 | 25 125 | 126 | 127 | 128 | 129 |
130 |
131 | -------------------------------------------------------------------------------- /modbusApp/op/bob/autoconvert/modbusStringTestTop.bob: -------------------------------------------------------------------------------- 1 | 2 | 3 | modbusStringTestTop 4 | 147 5 | 151 6 | 280 7 | 100 8 | 9 | 10 | 11 | 12 | false 13 | 5 14 | 15 | related display #6 16 | 17 | 18 | modbusStringTest.opi 19 | 20 |

SIM1:

21 | SI 22 | SO 23 | WFIn 24 | WFOut 25 |
26 | tab 27 | Modbus String Test 28 |
29 |
30 | StringTest 31 | 61 32 | 46 33 | 158 34 | 25 35 | 36 | 37 | 38 | 39 |
40 | 41 | text #9 42 | Modbus String Test Top 43 | 8 44 | 10 45 | 264 46 | 25 47 | 48 | 49 | 50 | 51 | 1 52 | 53 |
54 | -------------------------------------------------------------------------------- /modbusApp/op/edl/autoconvert/Koyo1.edl: -------------------------------------------------------------------------------- 1 | 4 0 1 2 | beginScreenProperties 3 | major 4 4 | minor 0 5 | release 1 6 | x 100 7 | y 100 8 | w 170 9 | h 145 10 | font "helvetica-medium-r-18.0" 11 | ctlFont "helvetica-bold-r-10.0" 12 | btnFont "helvetica-medium-r-18.0" 13 | fgColor rgb 0 0 0 14 | bgColor rgb 47872 47872 47872 15 | textColor rgb 0 0 0 16 | ctlFgColor1 rgb 64256 62208 18944 17 | ctlFgColor2 rgb 60928 46592 11008 18 | ctlBgColor1 rgb 52480 24832 0 19 | ctlBgColor2 rgb 65280 45056 65280 20 | topShadowColor rgb 44544 19968 48128 21 | botShadowColor rgb 13312 13056 34304 22 | showGrid 23 | snapToGrid 24 | gridSize 4 25 | endScreenProperties 26 | 27 | # (Static Text) 28 | object activeXTextClass 29 | beginObjectProperties 30 | major 4 31 | minor 1 32 | release 1 33 | x 12 34 | y 12 35 | w 146 36 | h 30 37 | font "utopia-medium-r-24.0" 38 | fontAlign "center" 39 | fgColor rgb 0 0 0 40 | bgColor index 3 41 | useDisplayBg 42 | value { 43 | "Koyo 1" 44 | } 45 | endObjectProperties 46 | 47 | # (Group) 48 | object activeGroupClass 49 | beginObjectProperties 50 | major 4 51 | minor 0 52 | release 0 53 | x 5 54 | y 51 55 | w 160 56 | h 85 57 | 58 | beginGroup 59 | 60 | endGroup 61 | 62 | endObjectProperties 63 | 64 | # (Group) 65 | object activeGroupClass 66 | beginObjectProperties 67 | major 4 68 | minor 0 69 | release 0 70 | x 5 71 | y 51 72 | w 160 73 | h 85 74 | 75 | beginGroup 76 | 77 | # (Related Display) 78 | object relatedDisplayClass 79 | beginObjectProperties 80 | major 4 81 | minor 0 82 | release 0 83 | x 5 84 | y 51 85 | w 158 86 | h 25 87 | fgColor rgb 0 0 0 88 | bgColor rgb 47872 47872 47872 89 | topShadowColor rgb 55808 55808 55808 90 | botShadowColor rgb 17920 17920 17920 91 | font "helvetica-medium-r-14.0" 92 | icon 93 | buttonLabel "Inputs" 94 | numPvs 16 95 | numDsps 8 96 | displayFileName { 97 | 0 Koyo_8inputs.edl 98 | 1 Koyo_8inputs.edl 99 | 2 Koyo_8inputs.edl 100 | 3 Koyo_8inputs.edl 101 | 4 Koyo_8inputs.edl 102 | 5 Koyo_8inputs.edl 103 | 6 Koyo_8inputs.edl 104 | 7 Koyo_8inputs.edl 105 | } 106 | menuLabel { 107 | 0 X0-X7 inputs (bit access) 108 | 1 X0-X7 inputs (word access) 109 | 2 Y0-Y7 inputs (bit access) 110 | 3 Y0-Y7 inputs (word access) 111 | 4 C0-C7 inputs (bit access) 112 | 5 C0-C7 inputs (word access) 113 | 6 C200-C207 inputs (bit access) 114 | 7 C200-C207 inputs (word access) 115 | } 116 | symbols { 117 | 0 "P=KOYO1:,R=X,A=B,L=X0L,PORT=XnB,AC=Bit" 118 | 1 "P=KOYO1:,R=X,A=W,L=XnL,PORT=XnW,AC=Word" 119 | 2 "P=KOYO1:,R=Y,A=InB,L=Y0InBL,PORT=YnInB,AC=Bit" 120 | 3 "P=KOYO1:,R=Y,A=InW,L=YnInWL,PORT=YnInW,AC=Word" 121 | 4 "P=KOYO1:,R=C,A=InB,L=C0InBL,PORT=CnInB,AC=Bit" 122 | 5 "P=KOYO1:,R=C,A=InW,L=CnInWL,PORT=CnInW,AC=Word" 123 | 6 "P=KOYO1:,R=C20,A=InB,L=C200InBL,PORT=CnInB,AC=Bit" 124 | 7 "P=KOYO1:,R=C20,A=InW,L=C20nInWL,PORT=CnInW,AC=Word" 125 | } 126 | replaceSymbols { 127 | 0 1 128 | 1 1 129 | 2 1 130 | 3 1 131 | 4 1 132 | 5 1 133 | 6 1 134 | 7 1 135 | } 136 | endObjectProperties 137 | 138 | # (Related Display) 139 | object relatedDisplayClass 140 | beginObjectProperties 141 | major 4 142 | minor 0 143 | release 0 144 | x 5 145 | y 81 146 | w 158 147 | h 25 148 | fgColor rgb 0 0 0 149 | bgColor rgb 47872 47872 47872 150 | topShadowColor rgb 55808 55808 55808 151 | botShadowColor rgb 17920 17920 17920 152 | font "helvetica-medium-r-14.0" 153 | icon 154 | buttonLabel "Outputs" 155 | numPvs 8 156 | numDsps 4 157 | displayFileName { 158 | 0 Koyo_8outputs.edl 159 | 1 Koyo_8outputs.edl 160 | 2 Koyo_8outputs.edl 161 | 3 Koyo_8outputs.edl 162 | } 163 | menuLabel { 164 | 0 Y0-Y7 outputs (bit access) 165 | 1 Y0-Y7 outputs (word access) 166 | 2 C200-C207 outputs (bit access) 167 | 3 C200-C207 outputs (word access) 168 | } 169 | symbols { 170 | 0 "P=KOYO1:,R=Y,A=OutB,L=Y0OutBL,PORT=YnOutB,AC=Bit" 171 | 1 "P=KOYO1:,R=Y,A=OutW,L=YnOutWL,PORT=YnOutW,AC=Word" 172 | 2 "P=KOYO1:,R=C20,A=OutB,L=C200OutBL,PORT=C20nOutB,AC=Bit" 173 | 3 "P=KOYO1:,R=C20,A=OutW,L=C20nOutWL,PORT=CnOutW,AC=Word" 174 | } 175 | replaceSymbols { 176 | 0 1 177 | 1 1 178 | 2 1 179 | 3 1 180 | } 181 | endObjectProperties 182 | 183 | # (Related Display) 184 | object relatedDisplayClass 185 | beginObjectProperties 186 | major 4 187 | minor 0 188 | release 0 189 | x 7 190 | y 111 191 | w 158 192 | h 25 193 | fgColor rgb 0 0 0 194 | bgColor rgb 47872 47872 47872 195 | topShadowColor rgb 55808 55808 55808 196 | botShadowColor rgb 17920 17920 17920 197 | font "helvetica-medium-r-14.0" 198 | icon 199 | buttonLabel "Octet asyn record" 200 | numPvs 4 201 | numDsps 2 202 | displayFileName { 203 | 0 asynRecord.edl 204 | 1 l 205 | } 206 | menuLabel { 207 | 0 Octet asyn record 208 | 1 209 | } 210 | symbols { 211 | 0 "P=KOYO1:,R=OctetAsyn" 212 | 1 213 | } 214 | replaceSymbols { 215 | 0 1 216 | 1 1 217 | } 218 | endObjectProperties 219 | 220 | endGroup 221 | 222 | endObjectProperties 223 | 224 | 225 | -------------------------------------------------------------------------------- /modbusApp/op/edl/autoconvert/Koyo2.edl: -------------------------------------------------------------------------------- 1 | 4 0 1 2 | beginScreenProperties 3 | major 4 4 | minor 0 5 | release 1 6 | x 100 7 | y 100 8 | w 170 9 | h 145 10 | font "helvetica-medium-r-18.0" 11 | ctlFont "helvetica-bold-r-10.0" 12 | btnFont "helvetica-medium-r-18.0" 13 | fgColor rgb 0 0 0 14 | bgColor rgb 47872 47872 47872 15 | textColor rgb 0 0 0 16 | ctlFgColor1 rgb 64256 62208 18944 17 | ctlFgColor2 rgb 60928 46592 11008 18 | ctlBgColor1 rgb 52480 24832 0 19 | ctlBgColor2 rgb 65280 45056 65280 20 | topShadowColor rgb 44544 19968 48128 21 | botShadowColor rgb 13312 13056 34304 22 | showGrid 23 | snapToGrid 24 | gridSize 4 25 | endScreenProperties 26 | 27 | # (Static Text) 28 | object activeXTextClass 29 | beginObjectProperties 30 | major 4 31 | minor 1 32 | release 1 33 | x 12 34 | y 12 35 | w 146 36 | h 30 37 | font "utopia-medium-r-24.0" 38 | fontAlign "center" 39 | fgColor rgb 0 0 0 40 | bgColor index 3 41 | useDisplayBg 42 | value { 43 | "Koyo 2" 44 | } 45 | endObjectProperties 46 | 47 | # (Group) 48 | object activeGroupClass 49 | beginObjectProperties 50 | major 4 51 | minor 0 52 | release 0 53 | x 5 54 | y 51 55 | w 160 56 | h 85 57 | 58 | beginGroup 59 | 60 | endGroup 61 | 62 | endObjectProperties 63 | 64 | # (Group) 65 | object activeGroupClass 66 | beginObjectProperties 67 | major 4 68 | minor 0 69 | release 0 70 | x 5 71 | y 51 72 | w 160 73 | h 85 74 | 75 | beginGroup 76 | 77 | # (Related Display) 78 | object relatedDisplayClass 79 | beginObjectProperties 80 | major 4 81 | minor 0 82 | release 0 83 | x 5 84 | y 51 85 | w 160 86 | h 25 87 | fgColor rgb 0 0 0 88 | bgColor rgb 47872 47872 47872 89 | topShadowColor rgb 55808 55808 55808 90 | botShadowColor rgb 17920 17920 17920 91 | font "helvetica-medium-r-14.0" 92 | icon 93 | buttonLabel "Inputs" 94 | numPvs 8 95 | numDsps 4 96 | displayFileName { 97 | 0 Koyo_8inputs.edl 98 | 1 Koyo_8inputs.edl 99 | 2 Koyo_8inputs.edl 100 | 3 Koyo_4ADC.edl 101 | } 102 | menuLabel { 103 | 0 Y0-Y7 inputs (bit access) 104 | 1 C0-C7 inputs (bit access) 105 | 2 C200-C207 inputs (bit access) 106 | 3 ADCs 107 | } 108 | symbols { 109 | 0 "P=KOYO2:,R=Y,A=InB,L=Y0InBL,PORT=YnInB,AC=Bit" 110 | 1 "P=KOYO2:,R=C,A=InB,L=C0InBL,PORT=CnInB,AC=Bit" 111 | 2 "P=KOYO2:,R=C20,A=InB,L=C200InBL,PORT=CnInB,AC=Bit" 112 | 3 "P=KOYO2:,R1=ADC1,R2=ADC2,R3=ADC3,R4=ADC4,PORT=V3000InW" 113 | } 114 | replaceSymbols { 115 | 0 1 116 | 1 1 117 | 2 1 118 | 3 1 119 | } 120 | endObjectProperties 121 | 122 | # (Related Display) 123 | object relatedDisplayClass 124 | beginObjectProperties 125 | major 4 126 | minor 0 127 | release 0 128 | x 5 129 | y 81 130 | w 160 131 | h 25 132 | fgColor rgb 0 0 0 133 | bgColor rgb 47872 47872 47872 134 | topShadowColor rgb 55808 55808 55808 135 | botShadowColor rgb 17920 17920 17920 136 | font "helvetica-medium-r-14.0" 137 | icon 138 | buttonLabel "Outputs" 139 | numPvs 4 140 | numDsps 2 141 | displayFileName { 142 | 0 Koyo_8outputs.edl 143 | 1 Koyo_8outputs.edl 144 | } 145 | menuLabel { 146 | 0 Y0-Y7 outputs (bit access) 147 | 1 C200-C207 outputs (bit access) 148 | } 149 | symbols { 150 | 0 "P=KOYO2:,R=Y,A=OutB,L=Y0OutBL,PORT=YnOutB,AC=Bit" 151 | 1 "P=KOYO2:,R=C20,A=OutB,L=C200OutBL,PORT=C20nOutB,AC=Bit" 152 | } 153 | replaceSymbols { 154 | 0 1 155 | 1 1 156 | } 157 | endObjectProperties 158 | 159 | # (Related Display) 160 | object relatedDisplayClass 161 | beginObjectProperties 162 | major 4 163 | minor 0 164 | release 0 165 | x 5 166 | y 111 167 | w 160 168 | h 25 169 | fgColor rgb 0 0 0 170 | bgColor rgb 47872 47872 47872 171 | topShadowColor rgb 55808 55808 55808 172 | botShadowColor rgb 17920 17920 17920 173 | font "helvetica-medium-r-14.0" 174 | icon 175 | buttonLabel "Octet asyn record" 176 | numPvs 4 177 | numDsps 2 178 | displayFileName { 179 | 0 asynRecord.edl 180 | 1 l 181 | } 182 | menuLabel { 183 | 0 Octet asyn record 184 | 1 185 | } 186 | symbols { 187 | 0 "P=KOYO2:,R=OctetAsyn" 188 | 1 189 | } 190 | replaceSymbols { 191 | 0 1 192 | 1 1 193 | } 194 | endObjectProperties 195 | 196 | endGroup 197 | 198 | endObjectProperties 199 | 200 | 201 | -------------------------------------------------------------------------------- /modbusApp/op/edl/autoconvert/array_test.edl: -------------------------------------------------------------------------------- 1 | 4 0 1 2 | beginScreenProperties 3 | major 4 4 | minor 0 5 | release 1 6 | x 446 7 | y 76 8 | w 250 9 | h 100 10 | font "helvetica-medium-r-18.0" 11 | ctlFont "helvetica-bold-r-10.0" 12 | btnFont "helvetica-medium-r-18.0" 13 | fgColor rgb 0 0 0 14 | bgColor rgb 47872 47872 47872 15 | textColor rgb 0 0 0 16 | ctlFgColor1 rgb 64256 62208 18944 17 | ctlFgColor2 rgb 60928 46592 11008 18 | ctlBgColor1 rgb 52480 24832 0 19 | ctlBgColor2 rgb 65280 45056 65280 20 | topShadowColor rgb 44544 19968 48128 21 | botShadowColor rgb 13312 13056 34304 22 | showGrid 23 | snapToGrid 24 | gridSize 4 25 | endScreenProperties 26 | 27 | # (Static Text) 28 | object activeXTextClass 29 | beginObjectProperties 30 | major 4 31 | minor 1 32 | release 1 33 | x 65 34 | y 7 35 | w 120 36 | h 25 37 | font "helvetica-medium-r-18.0" 38 | fontAlign "center" 39 | fgColor rgb 0 0 0 40 | bgColor index 3 41 | useDisplayBg 42 | value { 43 | "Array Test" 44 | } 45 | endObjectProperties 46 | 47 | # (Static Text) 48 | object activeXTextClass 49 | beginObjectProperties 50 | major 4 51 | minor 1 52 | release 1 53 | x 33 54 | y 58 55 | w 60 56 | h 20 57 | font "helvetica-medium-r-14.0" 58 | fontAlign "center" 59 | fgColor rgb 0 0 0 60 | bgColor index 3 61 | useDisplayBg 62 | value { 63 | "Arrays" 64 | } 65 | endObjectProperties 66 | 67 | # (Related Display) 68 | object relatedDisplayClass 69 | beginObjectProperties 70 | major 4 71 | minor 0 72 | release 0 73 | x 98 74 | y 58 75 | w 120 76 | h 20 77 | fgColor rgb 0 0 0 78 | bgColor rgb 29440 57088 65280 79 | topShadowColor rgb 55808 55808 55808 80 | botShadowColor rgb 17920 17920 17920 81 | font "helvetica-medium-r-12.0" 82 | icon 83 | buttonLabel "Arrays" 84 | numPvs 8 85 | numDsps 4 86 | displayFileName { 87 | 0 modbusArrayTest.edl 88 | 1 modbusArrayTest.edl 89 | 2 modbusArrayTest.edl 90 | 3 modbusArrayTest.edl 91 | } 92 | menuLabel { 93 | 0 UINT16 94 | 1 INT16 95 | 2 INT32_LE 96 | 3 INT32_BE 97 | } 98 | symbols { 99 | 0 "P=SIM1:,R=UINT16:" 100 | 1 "P=SIM1:,R=INT16:" 101 | 2 "P=SIM1:,R=INT32_LE:" 102 | 3 "P=SIM1:,R=INT32_BE:" 103 | } 104 | replaceSymbols { 105 | 0 1 106 | 1 1 107 | 2 1 108 | 3 1 109 | } 110 | endObjectProperties 111 | 112 | -------------------------------------------------------------------------------- /modbusApp/op/edl/autoconvert/modbusArray.edl: -------------------------------------------------------------------------------- 1 | 4 0 1 2 | beginScreenProperties 3 | major 4 4 | minor 0 5 | release 1 6 | x 730 7 | y 175 8 | w 560 9 | h 315 10 | font "helvetica-medium-r-18.0" 11 | ctlFont "helvetica-bold-r-10.0" 12 | btnFont "helvetica-medium-r-18.0" 13 | fgColor rgb 0 0 0 14 | bgColor rgb 47872 47872 47872 15 | textColor rgb 0 0 0 16 | ctlFgColor1 rgb 64256 62208 18944 17 | ctlFgColor2 rgb 60928 46592 11008 18 | ctlBgColor1 rgb 52480 24832 0 19 | ctlBgColor2 rgb 65280 45056 65280 20 | topShadowColor rgb 44544 19968 48128 21 | botShadowColor rgb 13312 13056 34304 22 | showGrid 23 | snapToGrid 24 | gridSize 4 25 | endScreenProperties 26 | 27 | # (X-Y Graph) 28 | object xyGraphClass 29 | beginObjectProperties 30 | major 4 31 | minor 0 32 | release 0 33 | x 5 34 | y 5 35 | w 550 36 | h 275 37 | # Appearance 38 | border 39 | graphTitle "Array data for $(P)$(R)" 40 | xLabel "Array index" 41 | yLabel "Value" 42 | fgColor rgb 0 0 0 43 | bgColor rgb 44544 44544 44544 44 | gridColor rgb 0 0 0 45 | font "helvetica-medium-r-10.0" 46 | # Operating Modes 47 | plotMode "plotLastNPts" 48 | nPts 1 49 | # X axis properties 50 | showXAxis 51 | xAxisSrc "AutoScale" 52 | xMin -9 53 | xMax 9 54 | xLablePrecision 1 55 | # Y axis properties 56 | showYAxis 57 | yAxisSrc "AutoScale" 58 | yMin -9 59 | yMax 9 60 | # Trace Properties 61 | numTraces 1 62 | yPv { 63 | 0 "$(P)$(R)" 64 | } 65 | plotStyle { 66 | 0 "point" 67 | } 68 | plotUpdateMode { 69 | 0 "x" 70 | } 71 | plotSymbolType { 72 | 0 "circle" 73 | } 74 | plotColor { 75 | 0 rgb 2560 0 47104 76 | } 77 | endObjectProperties 78 | 79 | # (Static Text) 80 | object activeXTextClass 81 | beginObjectProperties 82 | major 4 83 | minor 1 84 | release 1 85 | x 375 86 | y 287 87 | w 80 88 | h 20 89 | font "helvetica-medium-r-14.0" 90 | fontAlign "center" 91 | fgColor rgb 0 0 0 92 | bgColor index 3 93 | useDisplayBg 94 | value { 95 | "Severity" 96 | } 97 | endObjectProperties 98 | 99 | # (Text Monitor) 100 | object activeXTextDspClass:noedit 101 | beginObjectProperties 102 | major 4 103 | minor 7 104 | release 0 105 | x 460 106 | y 290 107 | w 75 108 | h 15 109 | controlPv "$(P)$(R).SEVR" 110 | format "decimal" 111 | font "helvetica-medium-r-12.0" 112 | fontAlign "right" 113 | fgColor rgb 0 65535 0 114 | fgAlarm 115 | bgColor rgb 55808 55808 55808 116 | limitsFromDb 117 | nullColor rgb 60928 46592 11008 118 | smartRefresh 119 | fastUpdate 120 | newPos 121 | objType "controls" 122 | endObjectProperties 123 | 124 | # (Static Text) 125 | object activeXTextClass 126 | beginObjectProperties 127 | major 4 128 | minor 1 129 | release 1 130 | x 214 131 | y 287 132 | w 60 133 | h 20 134 | font "helvetica-medium-r-14.0" 135 | fontAlign "center" 136 | fgColor rgb 0 0 0 137 | bgColor index 3 138 | useDisplayBg 139 | value { 140 | "Status" 141 | } 142 | endObjectProperties 143 | 144 | # (Text Monitor) 145 | object activeXTextDspClass:noedit 146 | beginObjectProperties 147 | major 4 148 | minor 7 149 | release 0 150 | x 279 151 | y 290 152 | w 75 153 | h 15 154 | controlPv "$(P)$(R).STAT" 155 | format "decimal" 156 | font "helvetica-medium-r-12.0" 157 | fontAlign "right" 158 | fgColor rgb 0 65535 0 159 | fgAlarm 160 | bgColor rgb 55808 55808 55808 161 | limitsFromDb 162 | nullColor rgb 60928 46592 11008 163 | smartRefresh 164 | fastUpdate 165 | newPos 166 | objType "controls" 167 | endObjectProperties 168 | 169 | # (Group) 170 | object activeGroupClass 171 | beginObjectProperties 172 | major 4 173 | minor 0 174 | release 0 175 | x 20 176 | y 287 177 | w 167 178 | h 20 179 | 180 | beginGroup 181 | 182 | # (Static Text) 183 | object activeXTextClass 184 | beginObjectProperties 185 | major 4 186 | minor 1 187 | release 1 188 | x 20 189 | y 290 190 | w 63 191 | h 15 192 | font "helvetica-medium-r-12.0" 193 | fgColor rgb 0 0 0 194 | bgColor index 3 195 | useDisplayBg 196 | value { 197 | "Update:" 198 | } 199 | endObjectProperties 200 | 201 | endGroup 202 | 203 | endObjectProperties 204 | 205 | # (Group) 206 | object activeGroupClass 207 | beginObjectProperties 208 | major 4 209 | minor 0 210 | release 0 211 | x 20 212 | y 287 213 | w 167 214 | h 20 215 | 216 | beginGroup 217 | 218 | # (Menu Button) 219 | object activeMenuButtonClass 220 | beginObjectProperties 221 | major 4 222 | minor 0 223 | release 0 224 | x 87 225 | y 287 226 | w 100 227 | h 20 228 | fgColor rgb 0 0 0 229 | bgColor rgb 47872 47872 47872 230 | inconsistentColor rgb 17920 17920 17920 231 | topShadowColor rgb 55808 55808 55808 232 | botShadowColor rgb 17920 17920 17920 233 | controlPv "$(P)$(R).SCAN" 234 | indicatorPv "$(P)$(R).SCAN" 235 | font "helvetica-medium-r-12.0" 236 | endObjectProperties 237 | 238 | endGroup 239 | 240 | endObjectProperties 241 | 242 | 243 | -------------------------------------------------------------------------------- /modbusApp/op/edl/autoconvert/modbusArrayTest.edl: -------------------------------------------------------------------------------- 1 | 4 0 1 2 | beginScreenProperties 3 | major 4 4 | minor 0 5 | release 1 6 | x 499 7 | y 277 8 | w 560 9 | h 350 10 | font "helvetica-medium-r-18.0" 11 | ctlFont "helvetica-bold-r-10.0" 12 | btnFont "helvetica-medium-r-18.0" 13 | fgColor rgb 0 0 0 14 | bgColor rgb 47872 47872 47872 15 | textColor rgb 0 0 0 16 | ctlFgColor1 rgb 64256 62208 18944 17 | ctlFgColor2 rgb 60928 46592 11008 18 | ctlBgColor1 rgb 52480 24832 0 19 | ctlBgColor2 rgb 65280 45056 65280 20 | topShadowColor rgb 44544 19968 48128 21 | botShadowColor rgb 13312 13056 34304 22 | showGrid 23 | snapToGrid 24 | gridSize 4 25 | endScreenProperties 26 | 27 | # (X-Y Graph) 28 | object xyGraphClass 29 | beginObjectProperties 30 | major 4 31 | minor 0 32 | release 0 33 | x 5 34 | y 5 35 | w 550 36 | h 275 37 | # Appearance 38 | border 39 | graphTitle "Array data for $(P)$(R)" 40 | xLabel "Array index" 41 | yLabel "Value" 42 | fgColor rgb 0 0 0 43 | bgColor rgb 44544 44544 44544 44 | gridColor rgb 0 0 0 45 | font "helvetica-medium-r-10.0" 46 | # Operating Modes 47 | plotMode "plotLastNPts" 48 | nPts 1 49 | # X axis properties 50 | showXAxis 51 | xAxisSrc "AutoScale" 52 | xMin -9 53 | xMax 9 54 | xLablePrecision 1 55 | # Y axis properties 56 | showYAxis 57 | yAxisSrc "AutoScale" 58 | yMin -9 59 | yMax 9 60 | # Trace Properties 61 | numTraces 1 62 | yPv { 63 | 0 "$(P)$(R)ArrayIn" 64 | } 65 | plotStyle { 66 | 0 "point" 67 | } 68 | plotUpdateMode { 69 | 0 "x" 70 | } 71 | plotSymbolType { 72 | 0 "circle" 73 | } 74 | plotColor { 75 | 0 rgb 2560 0 47104 76 | } 77 | endObjectProperties 78 | 79 | # (Static Text) 80 | object activeXTextClass 81 | beginObjectProperties 82 | major 4 83 | minor 1 84 | release 1 85 | x 375 86 | y 288 87 | w 80 88 | h 20 89 | font "helvetica-medium-r-14.0" 90 | fontAlign "center" 91 | fgColor rgb 0 0 0 92 | bgColor index 3 93 | useDisplayBg 94 | value { 95 | "Severity" 96 | } 97 | endObjectProperties 98 | 99 | # (Text Monitor) 100 | object activeXTextDspClass:noedit 101 | beginObjectProperties 102 | major 4 103 | minor 7 104 | release 0 105 | x 460 106 | y 291 107 | w 75 108 | h 15 109 | controlPv "$(P)$(R)ArrayIn.SEVR" 110 | format "decimal" 111 | font "helvetica-medium-r-12.0" 112 | fontAlign "right" 113 | fgColor rgb 0 65535 0 114 | fgAlarm 115 | bgColor rgb 55808 55808 55808 116 | limitsFromDb 117 | nullColor rgb 60928 46592 11008 118 | smartRefresh 119 | fastUpdate 120 | newPos 121 | objType "controls" 122 | endObjectProperties 123 | 124 | # (Static Text) 125 | object activeXTextClass 126 | beginObjectProperties 127 | major 4 128 | minor 1 129 | release 1 130 | x 214 131 | y 288 132 | w 60 133 | h 20 134 | font "helvetica-medium-r-14.0" 135 | fontAlign "center" 136 | fgColor rgb 0 0 0 137 | bgColor index 3 138 | useDisplayBg 139 | value { 140 | "Status" 141 | } 142 | endObjectProperties 143 | 144 | # (Text Monitor) 145 | object activeXTextDspClass:noedit 146 | beginObjectProperties 147 | major 4 148 | minor 7 149 | release 0 150 | x 279 151 | y 291 152 | w 75 153 | h 15 154 | controlPv "$(P)$(R)ArrayIn.STAT" 155 | format "decimal" 156 | font "helvetica-medium-r-12.0" 157 | fontAlign "right" 158 | fgColor rgb 0 65535 0 159 | fgAlarm 160 | bgColor rgb 55808 55808 55808 161 | limitsFromDb 162 | nullColor rgb 60928 46592 11008 163 | smartRefresh 164 | fastUpdate 165 | newPos 166 | objType "controls" 167 | endObjectProperties 168 | 169 | # (Static Text) 170 | object activeXTextClass 171 | beginObjectProperties 172 | major 4 173 | minor 1 174 | release 1 175 | x 20 176 | y 288 177 | w 60 178 | h 20 179 | font "helvetica-medium-r-14.0" 180 | fgColor rgb 0 0 0 181 | bgColor index 3 182 | useDisplayBg 183 | value { 184 | "Update" 185 | } 186 | endObjectProperties 187 | 188 | # (Text Control) 189 | object activeXTextDspClass 190 | beginObjectProperties 191 | major 4 192 | minor 7 193 | release 0 194 | x 117 195 | y 319 196 | w 50 197 | h 20 198 | controlPv "$(P)$(R)PollDelay" 199 | format "decimal" 200 | font "helvetica-medium-r-12.0" 201 | fontAlign "left" 202 | fgColor rgb 0 0 0 203 | bgColor rgb 29440 57088 65280 204 | editable 205 | motifWidget 206 | limitsFromDb 207 | nullColor rgb 60928 46592 11008 208 | smartRefresh 209 | fastUpdate 210 | newPos 211 | objType "controls" 212 | endObjectProperties 213 | 214 | # (Static Text) 215 | object activeXTextClass 216 | beginObjectProperties 217 | major 4 218 | minor 1 219 | release 1 220 | x 12 221 | y 319 222 | w 100 223 | h 20 224 | font "helvetica-medium-r-14.0" 225 | fontAlign "center" 226 | fgColor rgb 0 0 0 227 | bgColor index 3 228 | useDisplayBg 229 | value { 230 | "Poll delay" 231 | } 232 | endObjectProperties 233 | 234 | # (Static Text) 235 | object activeXTextClass 236 | beginObjectProperties 237 | major 4 238 | minor 1 239 | release 1 240 | x 194 241 | y 319 242 | w 120 243 | h 20 244 | font "helvetica-medium-r-14.0" 245 | fontAlign "center" 246 | fgColor rgb 0 0 0 247 | bgColor index 3 248 | useDisplayBg 249 | value { 250 | "Poll trigger" 251 | } 252 | endObjectProperties 253 | 254 | # (Menu Button) 255 | object activeMenuButtonClass 256 | beginObjectProperties 257 | major 4 258 | minor 0 259 | release 0 260 | x 87 261 | y 288 262 | w 100 263 | h 20 264 | fgColor rgb 0 0 0 265 | bgColor rgb 47872 47872 47872 266 | inconsistentColor rgb 17920 17920 17920 267 | topShadowColor rgb 55808 55808 55808 268 | botShadowColor rgb 17920 17920 17920 269 | controlPv "$(P)$(R)ArrayIn.SCAN" 270 | indicatorPv "$(P)$(R)ArrayIn.SCAN" 271 | font "helvetica-medium-r-12.0" 272 | endObjectProperties 273 | 274 | # (Related Display) 275 | object relatedDisplayClass 276 | beginObjectProperties 277 | major 4 278 | minor 0 279 | release 0 280 | x 396 281 | y 319 282 | w 53 283 | h 20 284 | fgColor rgb 0 0 0 285 | bgColor rgb 29440 57088 65280 286 | topShadowColor rgb 55808 55808 55808 287 | botShadowColor rgb 17920 17920 17920 288 | font "helvetica-medium-r-12.0" 289 | icon 290 | buttonLabel "More" 291 | numPvs 6 292 | numDsps 3 293 | displayFileName { 294 | 0 asynRecord.edl 295 | 1 asynRecord.edl 296 | 2 modbusStatistics.edl 297 | } 298 | menuLabel { 299 | 0 asynRecord Out 300 | 1 asynRecord In 301 | 2 I/O Statistics 302 | } 303 | symbols { 304 | 0 "P=$(P),R=A0:AsynOut" 305 | 1 "P=$(P),R=A0:AsynIn" 306 | 2 "P=$(P),R=A0:" 307 | } 308 | replaceSymbols { 309 | 0 1 310 | 1 1 311 | 2 1 312 | } 313 | endObjectProperties 314 | 315 | # (Message Button) 316 | object activeMessageButtonClass 317 | beginObjectProperties 318 | major 4 319 | minor 0 320 | release 0 321 | x 319 322 | y 319 323 | w 57 324 | h 20 325 | fgColor rgb 0 0 0 326 | onColor rgb 29440 57088 65280 327 | offColor rgb 29440 57088 65280 328 | topShadowColor rgb 65280 65280 65280 329 | botShadowColor rgb 0 0 0 330 | controlPv "$(P)$(R)PollTrigger" 331 | pressValue "1" 332 | releaseValue 333 | onLabel "Trigger" 334 | offLabel "Trigger" 335 | 3d 336 | useEnumNumeric 337 | font "helvetica-medium-r-12.0" 338 | endObjectProperties 339 | 340 | -------------------------------------------------------------------------------- /modbusApp/op/edl/autoconvert/modbusDataTypesTest.edl: -------------------------------------------------------------------------------- 1 | 4 0 1 2 | beginScreenProperties 3 | major 4 4 | minor 0 5 | release 1 6 | x 100 7 | y 100 8 | w 170 9 | h 120 10 | font "helvetica-medium-r-18.0" 11 | ctlFont "helvetica-bold-r-10.0" 12 | btnFont "helvetica-medium-r-18.0" 13 | fgColor rgb 0 0 0 14 | bgColor rgb 47872 47872 47872 15 | textColor rgb 0 0 0 16 | ctlFgColor1 rgb 64256 62208 18944 17 | ctlFgColor2 rgb 60928 46592 11008 18 | ctlBgColor1 rgb 52480 24832 0 19 | ctlBgColor2 rgb 65280 45056 65280 20 | topShadowColor rgb 44544 19968 48128 21 | botShadowColor rgb 13312 13056 34304 22 | showGrid 23 | snapToGrid 24 | gridSize 4 25 | endScreenProperties 26 | 27 | # (Static Text) 28 | object activeXTextClass 29 | beginObjectProperties 30 | major 4 31 | minor 1 32 | release 1 33 | x 12 34 | y 12 35 | w 146 36 | h 25 37 | font "helvetica-medium-r-18.0" 38 | fontAlign "center" 39 | fgColor rgb 0 0 0 40 | bgColor index 3 41 | useDisplayBg 42 | value { 43 | "Sim1 Test" 44 | } 45 | endObjectProperties 46 | 47 | # (Related Display) 48 | object relatedDisplayClass 49 | beginObjectProperties 50 | major 4 51 | minor 0 52 | release 0 53 | x 5 54 | y 51 55 | w 158 56 | h 25 57 | fgColor rgb 0 0 0 58 | bgColor rgb 29440 57088 65280 59 | topShadowColor rgb 55808 55808 55808 60 | botShadowColor rgb 17920 17920 17920 61 | font "helvetica-medium-r-14.0" 62 | icon 63 | buttonLabel "Inputs & outputs" 64 | numPvs 10 65 | numDsps 5 66 | displayFileName { 67 | 0 "modbusDataTypes.edl" 68 | 1 "modbusDataTypes.edl" 69 | 2 "modbusDataTypes.edl" 70 | 3 "Koyo_8inputs.edl" 71 | 4 "Koyo_8outputs.edl" 72 | } 73 | menuLabel { 74 | 0 "longout/longin" 75 | 1 "int64out/int64in" 76 | 2 "ao/ai" 77 | 3 "Binary inputs" 78 | 4 "Binary outputs" 79 | } 80 | symbols { 81 | 0 "P=SIM1:,OUT=LO:,IN=LI:,OREC=longout,IREC=longin" 82 | 1 "P=SIM1:,OUT=I64O:,IN=I64I:,OREC=int64out,IREC=int64in" 83 | 2 "P=SIM1:,OUT=AO:,IN=AI:,OREC=ao,IREC=ai" 84 | 3 "P=SIM1:,R=BI,A=B,L=MBBID0,PORT=BI,AC=Bit" 85 | 4 "P=SIM1:,R=BO,A=B,L=MBBOD0,PORT=BO,AC=Bit" 86 | } 87 | replaceSymbols { 88 | 0 1 89 | 1 1 90 | 2 1 91 | 3 1 92 | 4 1 93 | } 94 | endObjectProperties 95 | 96 | # (Related Display) 97 | object relatedDisplayClass 98 | beginObjectProperties 99 | major 4 100 | minor 0 101 | release 0 102 | x 7 103 | y 81 104 | w 158 105 | h 25 106 | fgColor rgb 0 0 0 107 | bgColor rgb 29440 57088 65280 108 | topShadowColor rgb 55808 55808 55808 109 | botShadowColor rgb 17920 17920 17920 110 | font "helvetica-medium-r-14.0" 111 | icon 112 | buttonLabel "Octet asyn record" 113 | numPvs 4 114 | numDsps 2 115 | displayFileName { 116 | 0 "asynRecord.edl" 117 | 1 "l" 118 | } 119 | menuLabel { 120 | 0 "Octet asyn record" 121 | 1 "" 122 | } 123 | symbols { 124 | 0 "P=SIM1:,R=OctetAsyn" 125 | 1 126 | } 127 | replaceSymbols { 128 | 0 1 129 | 1 1 130 | } 131 | endObjectProperties 132 | 133 | -------------------------------------------------------------------------------- /modbusApp/op/edl/autoconvert/modbusStringTestTop.edl: -------------------------------------------------------------------------------- 1 | 4 0 1 2 | beginScreenProperties 3 | major 4 4 | minor 0 5 | release 1 6 | x 147 7 | y 151 8 | w 280 9 | h 100 10 | font "helvetica-medium-r-18.0" 11 | ctlFont "helvetica-bold-r-10.0" 12 | btnFont "helvetica-medium-r-18.0" 13 | fgColor rgb 0 0 0 14 | bgColor rgb 47872 47872 47872 15 | textColor rgb 0 0 0 16 | ctlFgColor1 rgb 64256 62208 18944 17 | ctlFgColor2 rgb 60928 46592 11008 18 | ctlBgColor1 rgb 52480 24832 0 19 | ctlBgColor2 rgb 65280 45056 65280 20 | topShadowColor rgb 44544 19968 48128 21 | botShadowColor rgb 13312 13056 34304 22 | showGrid 23 | snapToGrid 24 | gridSize 4 25 | endScreenProperties 26 | 27 | # (Static Text) 28 | object activeXTextClass 29 | beginObjectProperties 30 | major 4 31 | minor 1 32 | release 1 33 | x 8 34 | y 10 35 | w 264 36 | h 25 37 | font "helvetica-medium-r-18.0" 38 | fontAlign "center" 39 | fgColor rgb 0 0 0 40 | bgColor index 3 41 | useDisplayBg 42 | value { 43 | "Modbus String Test Top" 44 | } 45 | endObjectProperties 46 | 47 | # (Related Display) 48 | object relatedDisplayClass 49 | beginObjectProperties 50 | major 4 51 | minor 0 52 | release 0 53 | x 61 54 | y 46 55 | w 158 56 | h 25 57 | fgColor rgb 0 0 0 58 | bgColor rgb 47872 47872 47872 59 | topShadowColor rgb 55808 55808 55808 60 | botShadowColor rgb 17920 17920 17920 61 | font "helvetica-medium-r-14.0" 62 | icon 63 | buttonLabel "StringTest" 64 | numPvs 2 65 | numDsps 1 66 | displayFileName { 67 | 0 modbusStringTest.edl 68 | } 69 | menuLabel { 70 | 0 Modbus String Test 71 | } 72 | symbols { 73 | 0 "P=SIM1:,SO=SO,SI=SI,WFOUT=WFOut,WFIN=WFIn" 74 | } 75 | replaceSymbols { 76 | 0 1 77 | } 78 | endObjectProperties 79 | 80 | -------------------------------------------------------------------------------- /modbusApp/op/edl/autoconvert/modbusTestSyncIO.edl: -------------------------------------------------------------------------------- 1 | 4 0 1 2 | beginScreenProperties 3 | major 4 4 | minor 0 5 | release 1 6 | x 644 7 | y 65 8 | w 350 9 | h 205 10 | font "helvetica-medium-r-18.0" 11 | ctlFont "helvetica-bold-r-10.0" 12 | btnFont "helvetica-medium-r-18.0" 13 | fgColor rgb 0 0 0 14 | bgColor rgb 47872 47872 47872 15 | textColor rgb 0 0 0 16 | ctlFgColor1 rgb 64256 62208 18944 17 | ctlFgColor2 rgb 60928 46592 11008 18 | ctlBgColor1 rgb 52480 24832 0 19 | ctlBgColor2 rgb 65280 45056 65280 20 | topShadowColor rgb 44544 19968 48128 21 | botShadowColor rgb 13312 13056 34304 22 | showGrid 23 | snapToGrid 24 | gridSize 4 25 | endScreenProperties 26 | 27 | # (Static Text) 28 | object activeXTextClass 29 | beginObjectProperties 30 | major 4 31 | minor 1 32 | release 1 33 | x 102 34 | y 7 35 | w 146 36 | h 25 37 | font "helvetica-medium-r-18.0" 38 | fontAlign "center" 39 | fgColor rgb 0 0 0 40 | bgColor index 3 41 | useDisplayBg 42 | value { 43 | "SyncIO Test" 44 | } 45 | endObjectProperties 46 | 47 | # (Static Text) 48 | object activeXTextClass 49 | beginObjectProperties 50 | major 4 51 | minor 1 52 | release 1 53 | x 18 54 | y 40 55 | w 120 56 | h 20 57 | font "helvetica-medium-r-14.0" 58 | fontAlign "center" 59 | fgColor rgb 0 0 0 60 | bgColor index 3 61 | useDisplayBg 62 | value { 63 | "Modbus input" 64 | } 65 | endObjectProperties 66 | 67 | # (Static Text) 68 | object activeXTextClass 69 | beginObjectProperties 70 | major 4 71 | minor 1 72 | release 1 73 | x 8 74 | y 65 75 | w 130 76 | h 20 77 | font "helvetica-medium-r-14.0" 78 | fontAlign "center" 79 | fgColor rgb 0 0 0 80 | bgColor index 3 81 | useDisplayBg 82 | value { 83 | "Modbus output" 84 | } 85 | endObjectProperties 86 | 87 | # (Static Text) 88 | object activeXTextClass 89 | beginObjectProperties 90 | major 4 91 | minor 1 92 | release 1 93 | x 18 94 | y 90 95 | w 120 96 | h 20 97 | font "helvetica-medium-r-14.0" 98 | fontAlign "center" 99 | fgColor rgb 0 0 0 100 | bgColor index 3 101 | useDisplayBg 102 | value { 103 | "SyncIO input" 104 | } 105 | endObjectProperties 106 | 107 | # (Static Text) 108 | object activeXTextClass 109 | beginObjectProperties 110 | major 4 111 | minor 1 112 | release 1 113 | x 8 114 | y 115 115 | w 130 116 | h 20 117 | font "helvetica-medium-r-14.0" 118 | fontAlign "center" 119 | fgColor rgb 0 0 0 120 | bgColor index 3 121 | useDisplayBg 122 | value { 123 | "SyncIO output" 124 | } 125 | endObjectProperties 126 | 127 | # (Text Monitor) 128 | object activeXTextDspClass:noedit 129 | beginObjectProperties 130 | major 4 131 | minor 7 132 | release 0 133 | x 148 134 | y 40 135 | w 80 136 | h 20 137 | controlPv "SIM1:LI:UINT16" 138 | format "decimal" 139 | font "helvetica-medium-r-14.0" 140 | fontAlign "center" 141 | fgColor rgb 2560 0 47104 142 | bgColor rgb 47872 47872 47872 143 | limitsFromDb 144 | nullColor rgb 60928 46592 11008 145 | smartRefresh 146 | fastUpdate 147 | newPos 148 | objType "controls" 149 | endObjectProperties 150 | 151 | # (Text Monitor) 152 | object activeXTextDspClass:noedit 153 | beginObjectProperties 154 | major 4 155 | minor 7 156 | release 0 157 | x 148 158 | y 90 159 | w 80 160 | h 20 161 | controlPv "SIM1:SYNC_IN:INT32" 162 | format "decimal" 163 | font "helvetica-medium-r-14.0" 164 | fontAlign "center" 165 | fgColor rgb 2560 0 47104 166 | bgColor rgb 47872 47872 47872 167 | limitsFromDb 168 | nullColor rgb 60928 46592 11008 169 | smartRefresh 170 | fastUpdate 171 | newPos 172 | objType "controls" 173 | endObjectProperties 174 | 175 | # (Text Control) 176 | object activeXTextDspClass 177 | beginObjectProperties 178 | major 4 179 | minor 7 180 | release 0 181 | x 148 182 | y 65 183 | w 80 184 | h 20 185 | controlPv "SIM1:LO:UINT16" 186 | format "decimal" 187 | font "helvetica-medium-r-12.0" 188 | fontAlign "left" 189 | fgColor rgb 0 0 0 190 | bgColor rgb 29440 57088 65280 191 | editable 192 | motifWidget 193 | limitsFromDb 194 | nullColor rgb 60928 46592 11008 195 | smartRefresh 196 | fastUpdate 197 | newPos 198 | objType "controls" 199 | endObjectProperties 200 | 201 | # (Text Control) 202 | object activeXTextDspClass 203 | beginObjectProperties 204 | major 4 205 | minor 7 206 | release 0 207 | x 148 208 | y 115 209 | w 80 210 | h 20 211 | controlPv "SIM1:SYNC_OUT:INT32" 212 | format "decimal" 213 | font "helvetica-medium-r-12.0" 214 | fontAlign "left" 215 | fgColor rgb 0 0 0 216 | bgColor rgb 29440 57088 65280 217 | editable 218 | motifWidget 219 | limitsFromDb 220 | nullColor rgb 60928 46592 11008 221 | smartRefresh 222 | fastUpdate 223 | newPos 224 | objType "controls" 225 | endObjectProperties 226 | 227 | # (Text Control) 228 | object activeXTextDspClass 229 | beginObjectProperties 230 | major 4 231 | minor 7 232 | release 0 233 | x 148 234 | y 140 235 | w 80 236 | h 20 237 | controlPv "SIM1:LOCK_OUT:INT32" 238 | format "decimal" 239 | font "helvetica-medium-r-12.0" 240 | fontAlign "left" 241 | fgColor rgb 0 0 0 242 | bgColor rgb 29440 57088 65280 243 | editable 244 | motifWidget 245 | limitsFromDb 246 | nullColor rgb 60928 46592 11008 247 | smartRefresh 248 | fastUpdate 249 | newPos 250 | objType "controls" 251 | endObjectProperties 252 | 253 | # (Static Text) 254 | object activeXTextClass 255 | beginObjectProperties 256 | major 4 257 | minor 1 258 | release 1 259 | x 8 260 | y 140 261 | w 130 262 | h 20 263 | font "helvetica-medium-r-14.0" 264 | fontAlign "center" 265 | fgColor rgb 0 0 0 266 | bgColor index 3 267 | useDisplayBg 268 | value { 269 | "LockIO output" 270 | } 271 | endObjectProperties 272 | 273 | # (Related Display) 274 | object relatedDisplayClass 275 | beginObjectProperties 276 | major 4 277 | minor 0 278 | release 0 279 | x 115 280 | y 175 281 | w 120 282 | h 20 283 | fgColor rgb 0 0 0 284 | bgColor rgb 29440 57088 65280 285 | topShadowColor rgb 55808 55808 55808 286 | botShadowColor rgb 17920 17920 17920 287 | font "helvetica-medium-r-12.0" 288 | icon 289 | buttonLabel "asyn records" 290 | numPvs 8 291 | numDsps 4 292 | displayFileName { 293 | 0 asynRecord.edl 294 | 1 asynRecord.edl 295 | 2 asynRecord.edl 296 | 3 asynRecord.edl 297 | } 298 | menuLabel { 299 | 0 Octet driver 300 | 1 Modbus input driver 301 | 2 Modbus output driver 302 | 3 SyncIO driver 303 | } 304 | symbols { 305 | 0 "P=SIM1:,R=OctetAsyn" 306 | 1 "P=SIM1:,R=InputAsyn" 307 | 2 "P=SIM1:,R=OutputAsyn" 308 | 3 "P=SIM1:,R=SyncIOAsyn" 309 | } 310 | replaceSymbols { 311 | 0 1 312 | 1 1 313 | 2 1 314 | 3 1 315 | } 316 | endObjectProperties 317 | 318 | # (Menu Button) 319 | object activeMenuButtonClass 320 | beginObjectProperties 321 | major 4 322 | minor 0 323 | release 0 324 | x 244 325 | y 90 326 | w 95 327 | h 20 328 | fgColor rgb 0 0 0 329 | bgColor rgb 47872 47872 47872 330 | inconsistentColor rgb 17920 17920 17920 331 | topShadowColor rgb 55808 55808 55808 332 | botShadowColor rgb 17920 17920 17920 333 | controlPv "SIM1:SYNC_IN:INT32.SCAN" 334 | indicatorPv "SIM1:SYNC_IN:INT32.SCAN" 335 | font "helvetica-medium-r-12.0" 336 | endObjectProperties 337 | 338 | -------------------------------------------------------------------------------- /modbusApp/op/opi/autoconvert/array_test.opi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | -1 6 | -1 7 | 8 | false 9 | 10 | 11 | 12 | 5.1.0 13 | 14 | 15 | 16 | 5 17 | 100 18 | 19 | true 20 | 21 | array_test 22 | 23 | 24 | true 25 | true 26 | false 27 | true 28 | false 29 | Display 30 | 250 31 | 446 32 | 76 33 | 34 | 35 | false 36 | 37 | 38 | 39 | 40 | 41 | 42 | 0 43 | 1 44 | true 45 | 46 | 47 | 48 | 49 | 50 | 51 | 25 52 | 1 53 | Label 54 | 55 | 56 | true 57 | true 58 | false 59 | 60 | 61 | false 62 | Array Test 63 | 64 | true 65 | 1 66 | true 67 | Label 68 | 120 69 | false 70 | 65 71 | 7 72 | 73 | 74 | 75 | 76 | modbusArrayTest.opi 77 | 78 | true 79 |

SIM1:

80 | UINT16: 81 |
82 | 1 83 | UINT16 84 |
85 | 86 | modbusArrayTest.opi 87 | 88 | true 89 |

SIM1:

90 | INT16: 91 |
92 | 1 93 | INT16 94 |
95 | 96 | modbusArrayTest.opi 97 | 98 | true 99 |

SIM1:

100 | INT32_LE: 101 |
102 | 1 103 | INT32_LE 104 |
105 | 106 | modbusArrayTest.opi 107 | 108 | true 109 |

SIM1:

110 | INT32_BE: 111 |
112 | 1 113 | INT32_BE 114 |
115 |
116 | false 117 | false 118 | false 119 | 120 | 121 | 122 | false 123 | 124 | 125 | 126 | 6 127 | 1 128 | true 129 | 130 | Default 131 | 132 | false 133 | 134 | 135 | 136 | 20 137 | 138 | Menu Button 139 | 140 | 141 | 142 | 143 | true 144 | true 145 | false 146 | 147 | 148 | false 149 | $(pv_name) 150 | $(pv_value) 151 | false 152 | true 153 | Menu Button 154 | 120 155 | 98 156 | 58 157 |
158 | 159 | 160 | false 161 | 162 | 163 | 164 | 165 | 166 | 167 | 0 168 | 1 169 | true 170 | 171 | 172 | 173 | 174 | 175 | 176 | 20 177 | 1 178 | Label 179 | 180 | 181 | true 182 | true 183 | false 184 | 185 | 186 | false 187 | Arrays 188 | 189 | true 190 | 1 191 | true 192 | Label 193 | 60 194 | false 195 | 33 196 | 58 197 | 198 |
199 | -------------------------------------------------------------------------------- /modbusApp/op/opi/autoconvert/modbusStringTestTop.opi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | -1 6 | -1 7 | 8 | false 9 | 10 | 11 | 12 | 5.1.0 13 | 14 | 15 | 16 | 5 17 | 100 18 | 19 | true 20 | 21 | modbusStringTestTop 22 | 23 | 24 | true 25 | true 26 | false 27 | true 28 | false 29 | Display 30 | 280 31 | 147 32 | 151 33 | 34 | 35 | 36 | modbusStringTest.opi 37 | 38 | true 39 |

SIM1:

40 | SO 41 | SI 42 | WFOut 43 | WFIn 44 |
45 | 1 46 | Modbus String Test 47 |
48 |
49 | false 50 | false 51 | 52 | 53 | 54 | false 55 | 56 | 57 | 58 | 0 59 | 1 60 | true 61 | 62 | Default 63 | 64 | false 65 | 66 | 67 | 68 | 25 69 | 70 | Action Button 71 | 0 72 | 73 | 74 | 75 | 76 | true 77 | true 78 | false 79 | 80 | 81 | 82 | StringTest 83 | false 84 | $(pv_name) 85 | $(pv_value) 86 | true 87 | Action Button 88 | 158 89 | 61 90 | 46 91 |
92 | 93 | 94 | false 95 | 96 | 97 | 98 | 99 | 100 | 101 | 0 102 | 1 103 | true 104 | 105 | 106 | 107 | 108 | 109 | 110 | 25 111 | 1 112 | Label 113 | 114 | 115 | true 116 | true 117 | false 118 | 119 | 120 | false 121 | Modbus String Test Top 122 | 123 | true 124 | 1 125 | true 126 | Label 127 | 264 128 | false 129 | 8 130 | 10 131 | 132 |
133 | -------------------------------------------------------------------------------- /modbusApp/op/ui/autoconvert/modbusStringTestTop.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 147 8 | 151 9 | 280 10 | 100 11 | 12 | 13 | 14 | 15 | 16 | QWidget#centralWidget {background: rgba(187, 187, 187, 255);} 17 | 18 | caTable { 19 | font: 10pt; 20 | background: cornsilk; 21 | alternate-background-color: wheat; 22 | } 23 | 24 | caLineEdit { 25 | border-radius: 1px; 26 | background: lightyellow; 27 | color: black; 28 | } 29 | 30 | caTextEntry { 31 | color: rgb(127, 0, 63); 32 | background-color: cornsilk; 33 | selection-color: #0a214c; 34 | selection-background-color: wheat; 35 | border: 1px groove black; 36 | border-radius: 1px; 37 | padding: 1px; 38 | } 39 | 40 | caTextEntry:focus { 41 | padding: 0px; 42 | border: 2px groove darkred; 43 | border-radius: 1px; 44 | } 45 | 46 | QPushButton { 47 | border-color: #00b; 48 | border-radius: 2px; 49 | padding: 3px; 50 | border-width: 1px; 51 | 52 | background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, 53 | stop:0 rgba(224, 239, 255, 255), 54 | stop:0.5 rgba(199, 215, 230, 255), 55 | stop:1 rgba(184, 214, 236, 255)); 56 | } 57 | QPushButton:hover { 58 | background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, 59 | stop:0 rgba(201, 226, 255, 255), 60 | stop:0.5 rgba(177, 204, 230, 255), 61 | stop:1 rgba(163, 205, 236, 255)); 62 | } 63 | QPushButton:pressed { 64 | background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, 65 | stop:0 rgba(174, 219, 255, 255), 66 | stop:0.5 rgba(165, 199, 230, 255), 67 | stop:1 rgba(134, 188, 236, 255)); 68 | } 69 | 70 | QPushButton:disabled { 71 | background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, 72 | stop:0 rgba(174, 219, 255, 255), 73 | stop:0.5 rgba(165, 199, 230, 255), 74 | stop:1 rgba(134, 188, 236, 255)); 75 | } 76 | 77 | caChoice { 78 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 79 | stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, 80 | stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); 81 | } 82 | 83 | caChoice > QPushButton { 84 | text-align: left; 85 | padding: 1px; 86 | } 87 | 88 | caSlider::groove:horizontal { 89 | border: 1px solid #bbb; 90 | background: lightgrey; 91 | height: 20px; 92 | border-radius: 4px; 93 | } 94 | 95 | caSlider::handle:horizontal { 96 | background: red; 97 | border: 1px solid #777; 98 | width: 13px; 99 | margin-top: -2px; 100 | margin-bottom: -2px; 101 | border-radius: 2px; 102 | } 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 61 113 | 46 114 | 158 115 | 25 116 | 117 | 118 | 119 | 120 | 0 121 | 0 122 | 0 123 | 124 | 125 | 126 | 127 | 187 128 | 187 129 | 187 130 | 131 | 132 | 133 | StringTest 134 | 135 | 136 | Menu 137 | 138 | 139 | Modbus String Test 140 | 141 | 142 | modbusStringTest.adl 143 | 144 | 145 | P=SIM1:,SO=SO,SI=SI,WFOUT=WFOut,WFIN=WFIn 146 | 147 | 148 | false 149 | 150 | 151 | 152 | 153 | QFrame::NoFrame 154 | 155 | 156 | 157 | 0 158 | 0 159 | 0 160 | 161 | 162 | 163 | 164 | 0 165 | 0 166 | 0 167 | 168 | 169 | 170 | Modbus String Test Top 171 | 172 | 173 | ESimpleLabel::WidthAndHeight 174 | 175 | 176 | Qt::AlignAbsolute|Qt::AlignHCenter|Qt::AlignVCenter 177 | 178 | 179 | 180 | 8 181 | 10 182 | 264 183 | 25 184 | 185 | 186 | 187 | caLabel_0 188 | caRelatedDisplay_0 189 | 190 | 191 | -------------------------------------------------------------------------------- /modbusApp/src/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | TOP = ../.. 4 | include $(TOP)/configure/CONFIG 5 | 6 | #---------------------------------------- 7 | # ADD MACRO DEFINITIONS AFTER THIS LINE 8 | #============================= 9 | #================================================== 10 | # Build an IOC support library 11 | 12 | # .dbd will be created from Include.dbd 13 | DBD += modbusApp.dbd 14 | DBD += modbusSupport.dbd 15 | 16 | INC += drvModbusAsyn.h 17 | INC += modbusInterpose.h 18 | INC += modbus.h 19 | 20 | LIBRARY_IOC = modbus 21 | 22 | USR_CFLAGS += -DUSE_TYPED_RSET 23 | USR_CPPFLAGS += -DUSE_TYPED_RSET 24 | 25 | LIB_SRCS += drvModbusAsyn.cpp 26 | LIB_SRCS += modbusInterpose.c 27 | LIB_SRCS += testModbusSyncIO.cpp 28 | LIB_LIBS += asyn 29 | LIB_LIBS += $(EPICS_BASE_IOC_LIBS) 30 | LIB_SYS_LIBS_WIN32 += ws2_32 31 | 32 | #============================= 33 | # build an ioc application 34 | 35 | PROD_IOC += modbusApp 36 | modbusApp_DBD += base.dbd 37 | modbusApp_DBD += asyn.dbd drvAsynIPPort.dbd drvAsynSerialPort.dbd 38 | modbusApp_DBD += modbusSupport.dbd 39 | 40 | # _registerRecordDeviceDriver.cpp will be created from .dbd 41 | modbusApp_SRCS_DEFAULT += modbusApp_registerRecordDeviceDriver.cpp modbusMain.cpp 42 | modbusApp_SRCS_vxWorks += modbusApp_registerRecordDeviceDriver.cpp 43 | 44 | PROD_IOC += testClient 45 | testClient_SRCS += testClient.cpp 46 | 47 | PROD_LIBS += modbus 48 | PROD_LIBS += asyn 49 | PROD_LIBS += $(EPICS_BASE_IOC_LIBS) 50 | 51 | PROD_SYS_LIBS_solaris += socket 52 | 53 | # 54 | include $(TOP)/configure/RULES 55 | #---------------------------------------- 56 | # ADD RULES AFTER THIS LINE 57 | -------------------------------------------------------------------------------- /modbusApp/src/modbus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: modbus.h 3 | * 4 | * Notes: This file includes a number of defines and structures for generating 5 | * modbus messages. Note that the structures are packed. 6 | * 7 | * Author: Mark Rivers 8 | */ 9 | 10 | #ifndef MODBUS_H 11 | #define MODBUS_H 12 | 13 | /* Modbus function codes */ 14 | #define MODBUS_READ_COILS 0x01 15 | #define MODBUS_READ_DISCRETE_INPUTS 0x02 16 | #define MODBUS_READ_HOLDING_REGISTERS 0x03 17 | #define MODBUS_READ_INPUT_REGISTERS 0x04 18 | #define MODBUS_WRITE_SINGLE_COIL 0x05 19 | #define MODBUS_WRITE_SINGLE_REGISTER 0x06 20 | #define MODBUS_WRITE_MULTIPLE_COILS 0x0F 21 | #define MODBUS_WRITE_MULTIPLE_REGISTERS 0x10 22 | #define MODBUS_REPORT_SLAVE_ID 0x11 23 | #define MODBUS_READ_WRITE_MULTIPLE_REGISTERS 0x17 24 | 25 | #define MODBUS_EXCEPTION_FCN 0x80 26 | 27 | #define MAX_MODBUS_FRAME_SIZE 600 /* Buffer size for input and output packets. 28 | * 513 (max for ASCII serial) should be enough, 29 | * but we are being safe. */ 30 | 31 | 32 | /* Pack all structures defined here on 1-byte boundaries */ 33 | #pragma pack(1) 34 | 35 | /* Note: GCC X.XX on the ARM has a bug an does not correctly process #pragma pack(1), 36 | * so we use the following macro */ 37 | #ifdef ARM 38 | #define PACKED_STRUCTURE __attribute__((__packed__)) 39 | #else 40 | #define PACKED_STRUCTURE 41 | #endif 42 | 43 | /* All Modbus messages over TCP/IP are preceeded by the MBAP header */ 44 | 45 | typedef struct modbusMBAPHeader_str 46 | { 47 | unsigned short transactId; 48 | unsigned short protocolType; 49 | unsigned short cmdLength; 50 | } PACKED_STRUCTURE modbusMBAPHeader; 51 | 52 | 53 | 54 | /*---------------------------------------------*/ 55 | /* structure definitions for Modbus requests */ 56 | /*---------------------------------------------*/ 57 | 58 | typedef struct modbusReadRequest_str 59 | { 60 | unsigned char slave; 61 | unsigned char fcode; 62 | unsigned short startReg; 63 | unsigned short numRead; 64 | } PACKED_STRUCTURE modbusReadRequest; 65 | 66 | typedef struct modbusReadResponse_str 67 | { 68 | unsigned char fcode; 69 | unsigned char byteCount; 70 | unsigned char data[1]; 71 | } PACKED_STRUCTURE modbusReadResponse; 72 | 73 | typedef struct modbusWriteSingleRequest_str 74 | { 75 | unsigned char slave; 76 | unsigned char fcode; 77 | unsigned short startReg; 78 | unsigned short data; 79 | } PACKED_STRUCTURE modbusWriteSingleRequest; 80 | 81 | 82 | typedef struct modbusWriteSingleResponse_str 83 | { 84 | unsigned char fcode; 85 | unsigned short startReg; 86 | unsigned short data; 87 | } PACKED_STRUCTURE modbusWriteSingleResponse; 88 | 89 | typedef struct modbusWriteMultipleRequest_str 90 | { 91 | unsigned char slave; 92 | unsigned char fcode; 93 | unsigned short startReg; 94 | unsigned short numOutput; 95 | unsigned char byteCount; 96 | unsigned char data[1]; 97 | } PACKED_STRUCTURE modbusWriteMultipleRequest; 98 | 99 | 100 | typedef struct modbusWriteMultipleResponse_str 101 | { 102 | unsigned char fcode; 103 | unsigned short startReg; 104 | unsigned short numOutput; 105 | } PACKED_STRUCTURE modbusWriteMultipleResponse; 106 | 107 | typedef struct modbusReadWriteMultipleRequest_str 108 | { 109 | unsigned char slave; 110 | unsigned char fcode; 111 | unsigned short startReadReg; 112 | unsigned short numRead; 113 | unsigned short startWriteReg; 114 | unsigned short numOutput; 115 | unsigned char byteCount; 116 | unsigned char data[1]; 117 | } PACKED_STRUCTURE modbusReadWriteMultipleRequest; 118 | 119 | typedef struct modbusExceptionResponse_str 120 | { 121 | unsigned char fcode; 122 | unsigned char exception; 123 | } PACKED_STRUCTURE modbusExceptionResponse; 124 | 125 | /* Revert to packing that was in effect when compilation started */ 126 | #pragma pack() 127 | 128 | #endif 129 | -------------------------------------------------------------------------------- /modbusApp/src/modbusInterpose.h: -------------------------------------------------------------------------------- 1 | /* modbusInterpose.h */ 2 | /* 3 | * Interpose interface support for Modbus with TCP/IP or serial 4 | * 5 | * Author: Mark Rivers 6 | */ 7 | 8 | #ifndef modbusInterpose_H 9 | #define modbusInterpose_H 10 | 11 | #include 12 | 13 | typedef enum { 14 | modbusLinkTCP, 15 | modbusLinkRTU, 16 | modbusLinkASCII, 17 | modbusLinkUDP 18 | } modbusLinkType; 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif /* __cplusplus */ 23 | 24 | epicsShareFunc int modbusInterposeConfig(const char *portName, 25 | modbusLinkType linkType, 26 | int timeoutMsec, int writeDelayMsec); 27 | #ifdef __cplusplus 28 | } 29 | #endif /* __cplusplus */ 30 | 31 | #endif /* modbusInterpose_H */ 32 | -------------------------------------------------------------------------------- /modbusApp/src/modbusMain.cpp: -------------------------------------------------------------------------------- 1 | /* _APPNAME_Main.cpp */ 2 | /* Author: Marty Kraimer Date: 17MAR2000 */ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "epicsExit.h" 11 | #include "epicsThread.h" 12 | #include "iocsh.h" 13 | 14 | int main(int argc,char *argv[]) 15 | { 16 | if(argc>=2) { 17 | iocsh(argv[1]); 18 | epicsThreadSleep(.2); 19 | } 20 | iocsh(NULL); 21 | epicsExit(0); 22 | return(0); 23 | } 24 | -------------------------------------------------------------------------------- /modbusApp/src/modbusSupport.dbd: -------------------------------------------------------------------------------- 1 | registrar(drvModbusAsynRegister) 2 | registrar(modbusInterposeRegister) 3 | 4 | -------------------------------------------------------------------------------- /modbusApp/src/testClient.cpp: -------------------------------------------------------------------------------- 1 | // This program tests creating a new drvModbusAsyn object and using it to do I/O using absolute addressing from 2 | // a pure C++ program without an IOC. 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | epicsUInt16 data[256]; 19 | int i; 20 | 21 | /* Use the following commands for TCP/IP 22 | * drvAsynIPPortConfigure(const char *portName, 23 | * const char *hostInfo, 24 | * unsigned int priority, 25 | * int noAutoConnect, 26 | * int noProcessEos); */ 27 | drvAsynIPPortConfigure("Koyo1","camaro:502",0,0,0); 28 | asynSetOption("Koyo1", 0, "disconnectOnReadTimeout", "Y"); 29 | 30 | /* modbusInterposeConfig(const char *portName, 31 | * modbusLinkType linkType, 32 | * int timeoutMsec, 33 | * int writeDelayMsec) */ 34 | modbusInterposeConfig("Koyo1", modbusLinkTCP, 5000, 0); 35 | 36 | /* drvModbusAsyn(const char *portName, const char *octetPortName, 37 | * int modbusSlave, int modbusFunction, 38 | * int modbusStartAddress, int modbusLength, 39 | * modbusDataType_t dataType, 40 | * int pollMsec, 41 | * const char *plcType); */ 42 | // Use absolute addressing, modbusStartAddress=-1. 43 | drvModbusAsyn *pModbus = new drvModbusAsyn("K1", "Koyo1", 0, 2, -1, 256, dataTypeUInt16, 0, "Koyo"); 44 | 45 | // Write 10 bits at address 2048 46 | memset(data, 0, sizeof(data)); 47 | data[0] = 1; 48 | data[2] = 1; 49 | data[4] = 1; 50 | data[6] = 1; 51 | data[8] = 1; 52 | printf(" Writing [1 0 1 0 1 0 1 0 1 0] to adddress 2048\n"); 53 | /* asynStatus doModbusIO(int slave, int function, int start, epicsUInt16 *data, int len); */ 54 | pModbus->doModbusIO(0, MODBUS_WRITE_MULTIPLE_COILS, 2048, data, 10); 55 | 56 | // Read them back 57 | memset(data, 0, sizeof(data)); 58 | pModbus->doModbusIO(0, MODBUS_READ_COILS, 2048, data, 10); 59 | printf("Read back ["); 60 | for (i=0; i<10; i++) printf("%d ", data[i]); 61 | printf("] from address 2048\n"); 62 | 63 | // Write 10 words at address 3072 64 | for (i=0; i<10; i++) data[i] = i; 65 | printf(" Writing [0 1 2 3 4 5 6 7 8 9] to adddress 3072\n"); 66 | pModbus->doModbusIO(0, MODBUS_WRITE_MULTIPLE_REGISTERS, 3072, data, 10); 67 | 68 | // Read them back 69 | memset(data, 0, sizeof(data)); 70 | pModbus->doModbusIO(0, MODBUS_READ_HOLDING_REGISTERS, 3072, data, 10); 71 | printf("Read back ["); 72 | for (i=0; i<10; i++) printf("%d ", data[i]); 73 | printf("] from address 3072\n"); 74 | 75 | } --------------------------------------------------------------------------------