beautypg.com

Main program – Electro Cam PL-1746 Series User Manual

Page 126

background image

8-13 Utility & Example Ladder Programs

Main Program

Pulse Edit
Next we will talk about the Pulse Edit functions available through the backplane of the SLC CPU to the PL-1746. The first
thing that must be understood is the relationship between the Custom Data Monitor, the Main Program, and the Subrou-
tines. The Custom Data Monitor (CDM) provides an interface between your computer and the SLC PLC program running
in the SLC CPU. With the CDM, we can enter data into integer registers, binary registers, etc. We can also read from
registers internal to the SLC CPU. With the Pulse Edit CDM we enter data into the integer registers, which can then be
moved into the M0 registers in the SLC CPU. We also read from the M0 registers into the integer registers.

When we enter a ‘1’ in B3/0 in the CDM, the program jumps to the subroutine. Once in the subroutine, B3/0 sets B3/1 to
a high. B3/1 triggers (O)ne (S)hot (R)ising B3/10, which then copies N7:0, N7:1, N7:2, N7:3 and N7:4 to M0:1.896,
M0:1.897, M0:1.898, M0:1.899 and M0:1.900. If you refer to the PL-1746 manual quick reference chart for M0 and M1
files, you can see what each M0 register is doing with the data that is being moved to it. Once the above tasks have been
completed, all data is moved and/or copied to the appropriate ‘N’ register, ‘B’ registers are reset to zero, and the subrou-
tine returns to the main program to await furthur instructions.

Custom
Data
Monitor

Subroutine

C01 & C04 Example.rss (cont’d)

The Pulse Edit functions can do a variety of different tasks for ‘editing’ pulses. We can read, write, increment the ON edge
of a pulse, increment the OFF edge of a pulse, decrement the ON edge of a pulse, decrement the OFF edge of a pulse,
increment both the ON and OFF edge of a pulse, or decrement both the ON and OFF edge of a pulse. We will now
perform a few of the functions to familiarize you with how they can be used.

Read
To read the ON/OFF values from the CDM, we must do the following:
1.Enter the program in which we would like to edit a pulse from in N7:0.
2.Enter the channel where the pulse is located in N7:1.
3.If there is more than one pulse in this channel, we must write the pulse number that we would like to edit in N7:4. Until

we know how many pulses are in that channel we can enter ‘0’ (remember that in the ‘Digital Universe’, counting
systems start at ‘0’, so entering a ‘0’ here will allow us to edit the first pulse in that channel.)

4.Enter ‘1’ in N7:6.
5.Enter ‘1’ in B3/0.

(continued)