Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 6 of 10

Class 8030 Type CRM-510 Network Interface Module: 7: Application Programming

Pages 27 to 29 of 44, from Class 8030 Type CRM-510 Network Interface Module

The original document is the PDF (1.3 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Square D 8030 CRM-510 and Schneider 8030 CRM-510

Page 27 read from a scan by OCR; it may hold reading errors

6.4.3.2 Sending Register Data to the 8881 PC

When a D-LOG module or SY/MAX processor puts register data into an 8881 PC, a conversion has to be made to the data. This is necessary because the D-LOG and processor operate on BINARY data while the 8881 system operates on BCD data. Therefore, when you put data into an 8881 system you must perform a BINARY to BCD conversion on the data before the data is sent to the 8881 PC.

Example of a “PUT” Using a D-LOG Module where Y and Z are the network device numbers of the D-LOG module and

10 Route Y, Z

8881 PR-3. 200A =Q where Q contains the data to be sent to the 8881 PC. 30 GOSUB 100: = Perform BINARY to BCD conversion. 40 PUTN A.800: Send data to the 8881 PC. 50 END

100 IFA < 0 OR A > 999 THEN PRINT “*DATA ERROR": END

110 B = INT (A/10): C = INT (B/10):

D=B-C*t0:B = A-B* 10:A = C*256 + D*16+ B:RETURN

In the above program, lines 100 thru 110 perform the BINA- RY to BCD conversion. When the conversion is complete,

30598-257-02 Page 27 variable *A* will contain the corrected data ready to be sent to the 8881 PC.

Example of a “WRITE” Using a SY/MAX Processor

SPEC LET $50 = s49 «BED | 2 >- - - - - - ROUTE, ROUTE - STAT, LOCAL, REMOTE - COUNT Ht WRITE2, - $40 850s 800 1

In the above example, rung | converts the data in register 49 to BCD. Then in rung 2 this converted data is sent to the 8881 PC.

The above examples illustrate one approach to communications for the 8881 PC.

Caution must be exercised when writing to the 8881 PC. Data values greater than 999 will be interpreted by the 8881 PC as shift register (bit type) information.

Note: Only the data values need be converted, no conversion is necessary for addresses.

7.0 APPLICATION PROGRAMMING

There are many ways to program PC to PC communication rungs. The following section provides several examples to help describe programming of communication rungs.

7.1 Communication Rung Operation

The communication rung consists of three parts: (f) rung information - registers involved, (2) status register, (3) an initiating contact.

7.1.1 RUNG INFORMATION

Rung information contained in a read or write rung describes which registers will be transmitted/received between PCs and how many registers will be communicated at once.

zo STAT LOCAL - - REMOTE, - COUNT [ - tT write 2 $90 $15 $20 1 | f .

Figure 7.1 - Sample WRITE Rung

In Figure 7.1 the communication rung contains three information areas. These areas are local, remote, and count.

Lacal - refers to registers in the PC that will initiate the communication rung.

Remote - refers to registers in the PC that will receive the data.

Count’ - defines how many consecutive registers will be involved.

NOTE: Model 300 PC maximum count is 16. Mode] 500 PC maximum count is 64.

The word READ or WRITE refers to the direction of the data exchange.

READ - Data is read from the remote PC register and put into the local PC register.

WRITE - Data from the local PC is written into the data register of the remote PC.

In example 7.1 register 15 wil] be written into register 20 of the remote PC.

Page 28 read from a scan by OCR; it may hold reading errors

Page 28 = 30598-257-02

7.1.2 STATUS REGISTER

The status register kecps track of the communication rung and will provide information on:

1. Rung continuity - power flow up to the box (bit 22) 2. Message progress - has message been sent (bit {7) 3. Communications error detected (bits I through 14) 4. Cammunication message completed (bit 16)

5. Remote device HALT/RUN status (bit 15}

The status register contains data which refers to communication progress, and any errors that were cncountered. This data is sent by the remote device to the initiating device, in response to a Read or Write command.

The above status information will be available until the rung is opened. Any time the rung is opened the status register will be cleared (set tu 0).

NOTE: Each communication rung must have a unique status register number.

7.1.3 INITIATING CONTACT

The initiating contact can consist of a single normally open or normally closed contact or several contacts.

When the initiating contact is closed, the communication rung will be enabled and bit 22 of the status register will turn on. Any time the initiating contact is opened, the rung will be reset and the status register will be cleared (set to 0).

When performing communications, it is recommended that the initiating contact be closed until the communication rung has finished communicating (bit 16 turned on). If the initiating coniact will only be present for one scan, it is recommended that you put in a seal circuit to maintain the rung continuity until the communication rung is finished.

7.2 Communication Rung Examples

This section describes several communication rungs. They are:

Ll. Single register READ rung

2. Multiple register READ rung

3, Enabling multiple communication rungs

4, Efficient communications (write on data change)

Al. examples have been designed using the following rules:

1. Each rung must have a unique status register number.

2. The initiating contact must remain closed until the communication mung has finished.

3. Registers are grouped together whenever possible.

7.21 SINGLE REGISTER READ

Zz l StTat LOCAL, - REMOTE, - COUNT } - T READ 2 590 $20 $30 1 | |

The above exampte will READ the contents of register 30 from the remote PC and put the data into register 20 of the local PC (LOCAL PC - refers to the PC containing the communication rung).

7.2.2 MULTIPLE REGISTER READ zg slat LOCAL ~ - REMOTE, - COUNT {| TREAD 2 $91 $26 $30 3 |

The above rung will READ the contents of register 30, 31. and 32 from the remote PC and put the data into registers 20, 21, and 22 of the local PC.

LOCAL REMOTE 20 - 30 21 READ 31 22 _ 32

If the above rung were a WRITE rung, the data exchange would be in the opposite direction.

LOCAL REMOTE 20 > 30 2i WRITE 31 22 > 32

7.2.3 MULTIPLE COMMUNICATION RUNGS

Enabling multiple communication rungs refers to sending more than one communication message using a single initiating contact.

z R92 R92 A tbat A “16 ai 92 R93 Ag +22

STAT LOCAL, - REMOTE, - COUNT, ,

A + | I WRITE2 $92 $50 $60 1

A ‘ - STAT LOCAL - - REMOTE, - COUNT, e - om WRITE 2 $% $53 $70 1

A STAT LOCAL, - REMOTE, COUMT ¢+ - + } - | WHITE 2 534 $55 Seu 1 |

In thefabove example] contact Z will start all communications. TO 22 Will seal in the initiating contact until all three communication rungs have been completed.

7.2.4 EFFICIENT COMMUNICATIONS it is often (mes not necessary to perform communications continuously. Instead it may only be necessary to communicate once a second, minute, or hour. The following nings have been designed to WRITE data from one PC to another only when a change in data has occurred. By sending only the data changed. you minimize the activity on the network ai-lowing other network devices a turn to get on the network sooner.

Additional rungs were added to:

1. Detect a communication fault.

2. Automatically re-send the communication message if fault is detected or if the message was not completed in 4 specified time.

3. Periodically send data (update) the remote PC, even though no change in data has occurred.

This last feature allows ihe remote PC to determine the active State of the local PC. (No update - local PC may have a fault).

Page 29 read from a scan by OCR; it may hold reading errors

RUNG | - - TMR- - TIME Rg RO Sx tt) CLEAR 05 on aS =50 RS RUNG 2 Rd { } -03 st + s3H RUNG 3 Rg RO., - ROUTE-ROUTE, STAT, LOCAL -REMOTE-COUNT , LAF 1 waite 2 1 2 629 st sa 1 bs 0s) RUNG 4 29 | TLET $30=0 : $1 RUNG $ H fF Sx > 10 { ) - RUNG 6 RQ ORD Rg 0 0 © RUNG 7 | Rg =

4 ] 04 Goals for this circuit were:

1. Send data only when data changes - reduce communications, 2. Recover from any communications fault - loss of power - open cable - no acknowledge from remote device. 3. Periodically send and update if no changes have taken place. 4. Alert operator when fault is detected.

The WRITE on 2 change circuit utilizes:

$29, S30, and S31 9-1, 9-2, 9-3, 9-4, and 9-5

- three registers - five relays

30598-257-02 Page 29

S| and S41 are arbitrarily chosen register values.

The following is a description of rung functions.

Rung 1

Provides master timing function for (1) fault detection and (2) periodic update. The decode should be set to the maximum delay between communication updates (periodic update time).

When the timer reaches the decode, coil 9-1 will turn ON for one scan.

- enabling rung two

- resetting rung one (timer)

Normally closed contact 9-5 also resets the timer when a comnuunication fauit is found,

Coil 9-3 when ON, indicates that an update should be sent. Cuil 9-3 will seal itself ON until normally closed 29-16 opens up, signifying the WRITE rung (rung 3} has finished. Other conditions that will cause an update are:

- contact 9-1, periodic update

- contact 9-4, halt/run update

- if S1 #S31, comparison of data change

Rung 3

The WRITE rung sends an update when rung two turns ON. The processor will communicate using port two and WRITE register 1 to register 41 in the remole device.

CAUTION: This rung will change the contents of register 41 in the remote device.

When the WRITE rung is sent, bit 17 of status register 29 will turn ON (29-17) enabling rung four.

Normally closed contact 9-5 will reset the WRITE rung if a fault is detected in rung five. When the WRITE rung is done communicating, bit 16 of status register 29 will turn ON (29- 16); resetting rung two.

Rung 4

When normaily open contact 29-17 is ON {indicating the WRITE rung is in progress) the timer (S30) will be reset and S| will be copied into register 31; updating register 31 to the latest change. Once this rung is solved, the "IF’ comparison in rung two will turn off.

Rung 5

Coil 9-5 when ON, indicates a communication fault. Once detected, the timer in rung one will reset and start (iming. The communication rung will be reset and enabled again. Finally, Jatch coil 9-2 (rung 7) will turn ON, indicating a fault had taken place.

Since the timer in rung one was reset, rung five will also turn OFF until the [F box is salved true again.

The comparison [F $30 > 10 is used to detect a toss of communication. The value compared to register 30 should be large enough to allow the WRITE rung to finish its communication cycle. If for any reason the WRITE rung does not finish, the IF comparison will become true, turning ON coil 9-5.