PLC Sample Code

Caps, LSS, CPT, Syswin, etc...

92 files

  1. Easy to use Modbus RTU Master for CP1L CP1H CJ1 CJ2 CS1

    This application is a ready to use Modbus RTU master for CP1L, CP1H, CJ1, CJ2, and CS1.
    The user creates 'tables' of items to read and write. The ladder code automatically performs the communications as setup by the user.
    The CJ1 / CJ2 / CS1 solution requires the use of a Protocol Macro on an SCU31 / SCU41 module, and the CP1L / CP1H function uses the Serial Gateway function of the CP1H / CP1L on a CP1W-CIF11 or CIF12.
    Sample NS screens are provided with an Omron 3G3JX inverter as an example Modbus RTU slave.
    Updated 1/7/2011 to include 3G3MX2 screen for NS, and to include CJ1W-SCU22,32,42 in documentation.
    Updated 9/19/2012 to support 2 ports on an SCU card (CS, CJ1, CJ2) or 2 ports on a CP1L / CP1H.

    21539 downloads

    Updated

  2. Syswin 3.4 Manual

    Manual for the Syswin Programming Software for Omron Plcs

    27558 downloads

    Updated

  3. CX-Programmer Ver.5 Introduction to Function Blocks Guide R121-E1-01

    CX-Programmer Ver.5 Introduction to Function Blocks Guide R121-E1-01. Quick start for using Function Blocks with CS/CJ Ver 3 CPUs.

    20651 downloads

    Updated

  4. TXD-RXD Quickstart Programs

    Collection of programs which demonstrate the use and setup of the TXD-RXD serial communication instructions. Examples for C200HE/G/X CPM2C CQM1 and CS/CJ PLCs
    Corrected CSCJ TXD_RXD program. Thanks BITS N BYTES

    9470 downloads

    Updated

  5. Modbus Protocol Macro

    Omron Protocol Macro for Modbus Communicaitons RTU. Master and Slave.. To be used with the CJ/CS serial cards capable of Protocol Macro.
    Original version by Omron.
    Modified by me getting rid of a couple of bugs!!!

    9391 downloads

    Updated

  6. Omron Modbus Slave Ladder

    Omron Modbus RTU slave ladder programs for C200HS Alpha CPM2 CQM1 CQM1H CS1 and CJ1 fot use with onboard serial port.

    9095 downloads

    Updated

  7. TXD-RXD Serial Port Handling

    Basic format for handling ASCII and Binary serial strings through an Omron Serial port. Covers control bits and TXD-RXD functions. Format is CPT 1.12 (.cpt)

    7194 downloads

    Updated

  8. Random Number Generator

    Generates a Pseudo random number using the mixed congrential method.
    Formula r(i+1) = (a r + b) MOD N
    This will generate a random number between 0 & N-1 with N = 2 (pwr 20) = 1048576 a = 1909 b = 221571
    The MOD operation is the integer

    3674 downloads

    Updated

  9. Analog Scaling Function block

    Function to scale an analog input. Allows input of lower and upper values for the range to which you are scaling, input for the maximum value of the analog input channel and the channel itself. There are three outputs that provide the scaled value in three formats: Real, Integer and BCD.

    6270 downloads

    Submitted

  10. FB Scale with parameters

    This function block will scale a value and output the rsult as an interger value and floating point (real) number. The result can be clamped or not clamped to the Min and Max range. Output bit indicating Over and Under range is also included.

    3914 downloads

    Updated

  11. SMS - GSM PLC Communications

    Files for Setup of a FALCOM A2D GSM modem to an Omron CJ1M-cpu22 to send SMS text messages. Included files are CX-Prgrammer File and Word Doc explaining the Setup.

    6219 downloads

    Updated

  12. Omron to AB EtherNetIP Explicit Messaging

    Example code to read and write integer and floating point data to and from CompactLogix, ControlLogix, and MicroLogix 1400 using EtherNet/IP.
    This works with Omron PLCs using CJ1W-EIP21 or CS1W-EIP21 EtherNet/IP modules, or CJ2H-xxx-EIP or CJ2M-CPU3x PLCs with built in EtherNet/IP.

    3675 downloads

    Submitted

  13. CP1L and CP1H EasyModbus FB

    Ideally suited to multiple Omron inverters connected on Modbus RTU network and where the Omron FB is too memory hungry.<br />Reads <u>upto</u> 16 registers from register 20 and writes to two registers (Fixed at 1 and 2). <br /><br />Set the serial port to Serial Gateway and set the baud rate to match the inverters. Inverter default is 81N. In the V1000 set H5-01 to the address. It must start at 1 and have no gaps.<br />The baudrate works upto 115200 (with V1000)<br /><br />Data format suits V1000 F7 E7. Don't use for V7 or J7.<br /><br />Data is only written on a change. The change is managed in the PLC NOT in the inverter. Data is read sequentially from node 1 to 'MaxNodes'.<br /><br />Not tested on CP1L-L (one serial port version). I think its Easy modbus addresses are different to two port versions.<br /><br />You can choose addresses within CIO only.<br /><br />Refer to any inverter manual for modbus addresses.
    Edit: the CP1L 14/20 use port two EasyModbus addresses. I think you can select Port 2 but set port 1 to Serial Gateway. Can someone try this??

    4468 downloads

    Updated

  14. Modbus TCP Client using FB's

    Example Implementation of Modbus TCP Client using Standard Omron Function Blocks.

    3792 downloads

    Updated

  15. Tracking product on conveyor

    Products arrive on conveyor irregularly pitched. Conveyor is equipped with an encoder or maybe a proxy looking at the sprocket.
    This program captures the position and then multiple FB calls can be made to give an output at a distance from the input point maybe at a label inspction point or reject unit.
    The Shift register readout FB can be called as many times as necessary.
    The encoder can be connected to a high-speed counter meaning that the PLC scan need not 'see' every number i.e the encoder counter can be asynchronous.
    I've simulated this in this program by incrementing the 'encoder' with a timed interrupt.
    Adjacent to the product position stack is a product status stack so data can be written in at any point too e.g. I'm in front of the label detect sensor - if it's on then I can enter a '1' (say) into the stack. As the status is kept in a Word then upto 16 devices can write into the stack. Subsequent writes are ORed with existing data.
    This can be achieved with FIFO but this method is more efficient as data is not actually moved just pointers to the data.

    4757 downloads

    Updated

  16. FINS Ethernet Master / Slave Solution

    Drop in code for Single Master and up to 30 Slave PLCs on FINS Ethernet.
    The Master PLC can be a CP1L-E, CJ2M, CJ2H, CS1, or any PLC capable of sending FINS commands.
    Originally designed to share data across a network of CP1L-E PLCs.
    Each PLC shares 100 words in each direction with the master PLC.
    The reads can be setup to read as fast as possible, or at a given interval.
    The writes can be change of state (COS) driven, as fast as possible, or at a given interval.
    .pdf manual included.

    2368 downloads

    Submitted

  17. Modbus RTU Sample Code CJ1/SCB

    This is sample code for receiving and manipulating data from Si-TEC CGC generator controller

    4988 downloads

    Updated

  18. Syswin 3.3 Manual

    Manual for Syswin 3.3 Programming Software for Omron PLCs

    4697 downloads

    Updated

  19. Toggle Button

    This program illustrates how to simply Toggle a bit on or off with a single input. (A basic flip flop if u like)
    Two versions are provided
    The first version will work in a CJ1 / CS1 PLC because of the direct diff funciton on the input bit.
    The se

    3103 downloads

    Updated

  20. Useable timer

    Hate BCD? Me too. Here's a timer FB that uses wait for it an INTeger preset.
    Easier to scale gives you the time remaining done bit and a timing bit.
    Use one of the system bits (P_1s etc.) to set the timebase.

    3492 downloads

    Updated

  21. Omron CS1 Sequencer

    OMRON CS1
    This is an example of a sequencer using a reversible shift register instruction
    Easy to troubleshoot because you can see what step it is on when the sequence stops for whatever reason.
    Easy to add steps and not too bad to insert steps.
    This program example shows the ease with which you can move to a specific step in the sequence after an alarm or stoppage.

    2666 downloads

    Updated

  22. Scaling in CJ1 CS1 PLC's

    The use of the old scaling functions SCL really suck when it comes to the new CJ1/CS1 PLC's mainly because it still relies on BCD etc....Today is so easy to use INT UINT values in the program i hardly ever use BCD any more.....
    Therefore I n

    3745 downloads

    Updated

  23. CX-Programmer Ver.5 Introduction Guide R120-E1-01.

    CX-Programmer Ver.5 Introduction Guide R120-E1-01. Quick start for beginning a project in CX-Programmer. Could also be useful for earlier versions of CX Programmer.

    6521 downloads

    Updated

  24. Modbus Protocol Macro Object Code

    This file contains the object code for Sleepy Wombat's Modbus Protocol Master PMCR. This is the file necessary if you do not have CX Protocol and want to use the Protocol Macro Transfer Utility found in the Omron - Utilities download section.

    3703 downloads

    Updated

  25. Example of Using Daylight Saving FB's

    Example of using the Daylight Saving Time FB that i have previouly up loaded.....You need to have uploaded all of the associated FB's for this to work...
    There is a pdf with the source code of the FB's in there as well. /thumbsupsmileyanim.gif style=vertical-align:middle emoid= border=0 alt=thumbsupsmileyanim.gif />

    2917 downloads

    Updated