Configuration Basics |
Perform the steps in this section in sequence.
Module Editor | ||
Use TOPDOC NexGen's PLC » Module Editor to load and configure the MODBSLAV.TLM for use with SoftPLC, as shown in the figure below. Clicking Configure opens the configuration text editor. Then press Fetch to transfer the default MODBSLAV.LST file from the processor to the editor. This is the configuration file where you will assign the serial ports and datatable files to be used by the MODBSLAV driver. A maximum of 8 serial ports may be defined.

Modicon to Datatable Mapping | ||
SoftPLC datatable files can hold up to 10,000 elements per file. Therefore any of the standard Modicon memory regions can have the following reference number ranges:
| Modicon Memory Type | Supported Reference Number Range |
|---|---|
| Holding Registers | 400001 to 410000 |
| Input Registers | 300001 to 310000 |
| Input States | 100001 to 110000 |
| Output Coils | 000001 to 010000 |
Note
Usually the Modicon memory regions are assigned to an 'N' (Integer) file
within SoftPLC. The assignment must start at element number
zero. Notice the N104:0 used in the example below. Any
datatable file references made in the MODBSLAV configuration file must exist in
the associated SoftPLC's running APP file. This datatable memory must be
created by using TOPDOC NexGen. This TLM does not automatically create this
datatable memory for you.
Sample Configuration File | ||
Below is a sample MODBSLAV.LST file
; This is the configuration file for the MODBUS Slave TLM. ; Anything after a semicolon is ignored during parsing. ; There are two sections: [DRIVER] and [PORTS]: ; [DRIVER] contains global options, such as DEBUG and IOCHECK ; ; Set DEBUG to > 0 if you want diagnostic output temporarily. ; DEBUG=0 gives no diagnostic output. ; DEBUG=1 gives a nice Query Response trace. ; DEBUG=2 gives what 1 does and more. ; ; Set IOCHECK to YES if you want the turn around time to be reduced by ; having SoftPLC service the modbus commands more frequently than once ; per scan. This is effective only when you have more rungs than ; STARTUP.LST's oneCheckInterval setting. [DRIVER] DEBUG=0 IOCHECK=NO ; [PORTS] should include one line for each serial port you want active. ; All the StartAddress's must be based at element zero of a file of one of ; the following types: INTEGER, BIT, INPUT, or OUTPUT. [PORTS] ;COMPORT 0-31 where 0=COM1, 1=COM2, etc. ;| Baudrate: 9600 or 19200 or 38400 ;| | Databits: 8 ;| | | Parity: N or E or O ;| | | | Stopbits: 1 or 2 ;| | | | | Modbus slave address: 1 - 247 ;| | | | | | Holding Registers StartAddress: ;| | | | | | | Output Coils StartAddress ;| | | | | | | | Input Registers StartAddress ;| | | | | | | | | Input States StartAddress ;| | | | | | | | | | 1, 9600, 8, N, 2, 2, N104:0, N100:0, N103:0, N101:0 ;2, 19200, 8, N, 1, 4, N100:0, B3:0, N7:0, I:0 spare, as needed ; Make sure you use TOPDOC to create the Datatable Files that you ; are referencing for each port. ;EOF
Final Steps | ||
- After you have finished configuring the driver, press Save and then Send. This will save the MODBSLAV.LST file to your Windows workstation and then transfer the file to the SoftPLC's Flash disk.
- Now reboot the Tealware/SoftPLC Processor. SoftPLC is now ready to process Modbus serial data requests from the Master.
- The last step is to program the Modbus Master to send the read and write request(s) to the SoftPLC Modbus Slave.

