Install and Test a MVI46-MCM Modbus Module for SLC-500
by Nugroho Budi from controlmanuals.com
The MVI46-MCM is a Modbus communication module provided by ProSoft Technology. The module can be installed in a SLC500 rack so it can communicate to other Modbus devices.
This article assumes you have an Allen Bradley SLC 5/03, 5/04, or 5/05 processor with a power supply of adequate capacity for the MVI46-MCM plus any Input/Output (I/O) modules you intend to use.Â For the purposes of this lab, and to match the supplied sample ladder, we will assume a configuration as follows:
- A-B 1747-L551 5/05Processor â€“ 16K Memory, OS500
- A-B 1746-A7 7-Slot Chassis (rack)
- A-B 1746-P1/P7 Power Supply
If different hardware is used, modifications to the sample ladder file, MVI46MCM.RSS will need to be made to obtain a properly functioning program.
Installing the Module
- Before installing the MVI46-MCM into the SLC chassis, check the position of the Interface Configuration Jumpers on the bottom of the module.
The Setup Jumper is only necessary when used to flash a firmware upgrade onto the module.Â For normal configuration and operation, this jumper must be positioned as shown in the diagram above.Â We will be using the RS-232 interface, so check that the PRT2 and PRT3 jumpers are positioned as shown above so the module will communicate in RS-232 mode.
- NOTE:Â For this step, and at any time when you are installing or removing hardware to or from the chassis, you MUST do so with the POWER OFF!Â SLC modules are NOT HOT SWAPABLE.Â Attempting to insert or remove modules while the chassis is powered-up can result in damage to the module, the processor, the Power Supply, and/or the Chassis itself!
Chassis slots are numbered sequentially, left to right, starting at zero for the leftmost slot.Â The processor always goes in Slot 0.Â Install the MVI46-MCMÂ module into the slot next to the processor.Â This will place the module in Slot 1.Â The rest of the chassis slots should be left empty, for now.Â If done correctly, your installation should look similar to the following illustration:
- Set the processor key switch to the REM position and power up the chassis.
After its boot cycle, the processor will be ready to accept programming.Â At this point, you may ignore any RED LEDs indicating processor or module faults.Â Until a valid project (program) is loaded into the processor it may show a fault.
Configure RSLinx to Talk to SLC
- Attach a null modem cable (or the A-B CP3 programming cable) from your PC serial port to the serial port on your SLC processor, called Channel 0.
- Open RSLinx.Â Click on the â€œCommunicationsâ€ drop-down menu.Â Click on the â€œConfigure Driversâ€ option.Â If youâ€™re running a newer version of RSLinx, youâ€™ll see a dialog box like this one:
If you already have a RS-232 DF-1 driver configured, skip to the Auto Configure instructions in Step 5.
- Click the down arrow in the â€œAvailable Driver Types:â€ option box and click on â€œRS-232 DF-1 devicesâ€, as shown, and click the â€œAdd Newâ€¦â€ button.
- You will now be prompted to name your driver.Â For most cases, the default name will be acceptable.Â To match the sample project used in this lab, accept the default name by clicking the â€œOKâ€ button.
- Next, you will see the driver setup dialog box.
- First, click the down arrow in the â€œComm Port:â€ option box and click the Comm port that matches the number on your PC (usually Comm1, Comm2, Comm3, or Comm4).Â
- Then, click the down arrow in the â€œDevices:â€ option box and click the â€œSLC-CH0/Micro/PanelViewâ€ option.Â
- Finally, click the â€œAuto Configureâ€ button.Â RSLinx will then query the processor, establish a communications link, and adjust the driverâ€™s parameters to match the processorâ€™s current port configuration.Â Donâ€™t worry if the parameters in your driver donâ€™t match the ones shown in the following example.Â As long as the window reports â€œAuto Configuration Successful!â€, whatever parameters appear for baud rate, parity, error checking, etc. will be correct.Â A successful result will look something like this:
In some instances, RSLinx will fail to Auto Configure.Â If this happens to you, first check that your cable is OK, properly connected, and that you are selecting the correct Comm port.Â Once this is verified, if Auto Configure fails, you will need to completely wipe the processor memory and reset it to factory defaults.Â Consult the A-B product documentation, the A-B website, or A-B Tech Support for instruction on how to do this.Â Once done, the RSLinx should be able to Auto Configure.
Clicking on â€œOKâ€ will return you to this dialog:
If the driver status is â€œRunningâ€,Â you have now successfully configured RSLinx to talk to the processor.Â Click the â€œCloseâ€ button to close this dialog and then exit but do not shutdown RSLinx by clicking the â€œFileâ€ menu option and then â€œExit and Shutdownâ€. Be sure to click the â€œExitâ€ option.
Use RSLogix500 to Modify the Sample Project
- Next, we will load and configure the sample ladder logic program and download it to the processor.Â Start RSLogix500.Â It should come up to a blank window, like this:
- Click on the â€œFileâ€ drop-down menu, click â€œOpenâ€ and browse to the folder where you saved the sample ladder and double-click the file, â€œMVI46MCM.RSSâ€ that is included on the MVI46MCM CD.
This will open the sample project.Â We can now configure the sample ladder to get it ready for the next exercise.
- Youâ€™ll get a window that looks like this.Â If not, then click on the â€œViewâ€ Menu, and make sure there are check marks beside â€œStandardâ€, â€œOnlineâ€, and â€œTabbed Instruction Barâ€ options.
- In the left pane Project Tree area, under the Controller folder, double-click on the â€œIO Configurationâ€ icon.Â This will display the I/O Configuration dialog box:
- Click on â€œOTHERâ€ in Slot 1, as shown, then click the â€œAdv Configâ€ button.
Make sure the values are as shown.Â If they are not, set them to these values.Â Otherwise, the module will not function properly.Â Details on module setup are contained in the Userâ€™s Manual in Section 3.3 â€œSetting Up the Moduleâ€.Â After you verify the values, click â€œOKâ€ or â€œCancelâ€ to close this dialog box.Â Click on the Exit icon () in the upper-right corner of the I/O Configuration dialog to close it and return to the main window.
- In the left pane Project Tree area, under the Data Files folder, double-click on the N10 â€“ MCM CFG icon.Â Set the values in this file to match the ones shown below.
|MCM Ports 1 & 2 Cmds
|Port 1 / Port 2
|- N10:10 / N10:40Â Port Enable/Disable
|- N10:11 / N10:41Â Port Type
|- N10:12 / N10:42Â Float Flag
|- N10:13 / N10:43Â Float Start
|- N10:14 / N10:44Â Float Offset
|- N10:15 / N10:45Â Protocol
|- N10:16 / N10:46Â Baud Rate
|- N10:17 / N10:47Â Parity
|- N10:18 / N10:48Â Data Bits
|- N10:19 / N10:49Â Stop Bits
|- N10:20 / N10:50Â RTS On Delay
|- N10:21 / N10:51Â RTS Off Delay
|- N10:22 / N10:52Â Min. Response Delay
|- N10:23 / N10:53Â Use CTS Line
|- N10:24 / N10:54Â Slave ID
|- N10:25 / N10:55Â Bit Input Offset
|- N10:26 / N10:56Â Word Input Offset
|- N10:27 / N10:57Â Output Offset
|- N10:28 / N10:58Â Holding Register Offset
|- N10:29 / N10:59Â Command Count
|- N10:30 / N10:60Â Min. Command Delay
|- N10:31 / N10:61Â Command Error Pointer
|- N10:32 / N10:62Â Response Timeout
|- N10:33 / N10:63Â Retry Count
|- N10:34 / N10:64Â Error Delay Count
|- N10:35 / N10:65Â Reserved
|- N10:36 / N10:66Â Guard Band
|- N10:37 / N10:67Â Guard Band Timeout
This configuration data will set module Port1 to be a Modbus Master and Port2 to be a Modbus Slave.Â Both ports will be set for Modbus RTU mode, 57,600-baud, no parity, 8 data bits, 1 stop bit.Â Hardware handshaking will be disabled (RTS/CTS not used.)Â We will be able to use up to 5 Modbus Commands and any Modbus Command Errors will be sent to module memory beginning at register address 300, which will then appear in SLC data table N31, beginning at N31:100.Â With this configuration, we can use a second null modem
cable and two DB9M-to-RJ45 pigtails to connect the two ports together, which in turn will allow us to send and get data from the module with our sample ladder.Â Click on the Exit icon () in the upper-right corner of the Data File N10(dec) dialog to close it and return to the main window.
- We will now configure our Modbus commands for Port1.Â In the left pane Project Tree area, under the Data Files folder, double-click on the N11 â€“ P1 CMDS icon.Â Set the values in this file to match the ones shown below.
|MCM Ports 1 & 2 Cmds
|Port 1 / Port 2
|- N11:0 / N12:0Â Cmd Enable
|- N11:1 / N12:1Â Internal Address
|- N11:2 / N12:2Â Poll Interval Time
|- N11:3 / N12:3Â Count
|- N11:4 / N12:4Â Swap Code
|- N11:5 / N12:5Â Node Address Device ID
|- N11:6 / N12:6Â Function Code
|- N11:7 / N12:7Â Device Address Register
This creates one Modbus command for Port1, our Master port.Â This command will send a request out Port1 to the Modbus Slave at Slave ID 2 (our Port2), as configured in N10.Â The command will get twenty 16-bit words (registers) of data from Destination Address 0, our module address 0, the first word of our WRITE DATA area, and move it out Port2, in Port1, and store it in Internal Address 200, our module address 200, the first word of our READ DATA area.Â This command will execute once each second. Â This way, any values we poke into data table addresses N32:0 through N32:19 will, after a short delay, appear in the corresponding addresses in data table N31.Â Click on the Exit icon () in the upper-right corner of the Data File N11 (dec) dialog to close it and return to the main window.
- In the left pane Project Tree area, under the Data Files folder, double-click on the N12 â€“ P2 CMDS icon.Â Set all the values in this file to zero and click on the Exit icon () in the upper-right corner to close this window and return.
- In the left pane Project Tree area, under the Data Files folder, double-click on the N32 â€“ WRITE DATA icon.Â Set the values in this file as shown.
This will give us some beginning data values for the Modbus command we just created.Â Click on the Exit icon () it the upper-right corner to close this window and return.
- In the left pane Project Tree area, under the Data Files folder, double-click on the N31 â€“ READ DATA icon.Â Set the values in this file to zero so that we will know that any values that appear there are the result of our ladder logic execution.Â Click on the Exit icon () in the upper-right corner to close this window and return.
- We are now ready to save our new project before downloading.Â In the main window, click on â€œFileâ€, then â€œSave Asâ€ to get the Save As dialog box.Â In the File Name: box, type â€œ46Test1â€, as shown, and click the Save button.
Congratulations!Â You now have a functioning program that will move data to and from the module.
Downloading and Testing the Modified Sample Project
- Make sure your null modem cable (or CP3 programming cable) is still attached between your PC Comm port and the processor RS-232 port.Â Take the two DB9M-to-RJ45 pigtails and the other null modem cable and connect the lower two ports on the MVI46MCM module,
P2 APPLICATION and P3 APPLICATION, with these cables.
- Set the processor key switch to the â€œPROGâ€ position.Â In RSLogix500, click the down-arrow next to the â€œOFFLINEâ€ status and click â€œDownloadâ€¦â€ from the menu.
When you see the confirmation dialog, click the â€œYesâ€ button.
The sample ladder is currently configured for a 1747-L551 SLC 5/05.Â If you are using a different processor, when you try to download, you will see the following:
If you get this warning screen, click the â€œOKâ€ button.Â RSLogix will automatically determine the actual processor type you are using and adjust the IO Configuration to match your installed processor.Â You should then see the following window:
When it comes up, make sure the â€œClear I/Oâ€ box is NOT checked, as shown, and click â€œOKâ€.Â A Download Progress dialog will flash through several progress bars as various parts of the program are loaded.Â Eventually, you should see:
Click the â€œYesâ€ button.Â The RSLogix status box will change to show you are on-line live with the processor.Â You can also tell you are on-line when you see the colored blocks and ladder rotating in the status box.Â The faster they rotate, the higher your connection speed.Â It should look like this (with animated ladder):
If you had to change your processor type, now would be a good time to re-save the program.
- Next, we will change the SLC 500 processor key switch from â€œPROGâ€ to â€œRUNâ€ and back to the â€œREMâ€ position.Â If you have a good program, the processor RUN LED will light up solid green and, on the MVI46MCM module, the OK LED will change from red to green, the APP STATUS and BP ACT LEDs will be amber and the LEDs for P2 and P3 will flash green about once every second.Â The RSLogix status box should look like this:
If, however, the processor â€œFAULTâ€ LED flashes red and you see this,
it indicates some kind of hardware or software problem.Â Common causes include: hardware failure, ladder logic errors, and installing the MVI46MCM module in a different chassis slot than the one selected in the I/O Configuration, I/O modules in the configuration that are not actually installed in the chassis, and more.Â Assuming you are still on-line with the processor, to see what might be causing the problem, you can check the â€œProcessor Statusâ€ dialog for the Major Error Code causing the fault.Â In the Project Tree, under the
â€œControllerâ€ folder, click on â€œProcessor Statusâ€ then click on the â€œErrorsâ€ tab to see the fault.Â An example of having the module in the wrong slot is shown.Â Your error may be different.
Do whatever is required to fix the root cause of the fault and then turn the key switch from â€œREMâ€ to â€œPROGâ€ to â€œRUNâ€ and back to â€œREMâ€ to get the processor running normally.
- NOWâ€¦Weâ€™re ready for some real fun.Â Take a few minutes to look at the three LAD files in our test program.Â For a detailed explanation of what these files do, look at Chapter 4 â€“ Ladder Logic in the Userâ€™s Manual, beginning on page 25.
Now, look in LAD 4 â€“MCM CMDS at rungs 0002 and 0003.Â Bit B3:0/0 in rung 0002 is called the Cold Boot bit.Â Bit B3:0/1 in rung 0003 is called the Warm Boot bit.Â Either may be toggled to force the module to restart, reload its configuration and any Modbus commands.Â This is a handy feature that makes it easy to change and test different configurations and commands.Â Itâ€™s quicker and safer to toggle these bits than to recycle the processor or power-down and power-up the chassis to accomplish the same thing.Â Toggling either of these bits allows configuration and command changes to be performed without halting the processor.Â This can be very useful when added one of our modules to an existing application already in use at a customer site.Â As we progress through the rest of this exercise, we will be returning to this ladder and these rungs often as we modify and test our program.
Toggle one of these bits now and watch the LEDs on the front of the module as you do so.Â You should see the P2 and P3 LEDs stop the regular blinking they had been doing, the OK LED will briefly turn red then go back to green, and then the P2 and P3 LEDs should resume their blinking once a second.
To toggle the bit, right-click on its picture then click on â€œToggle Bitâ€ at the bottom of the context menu, as shown.Â Be sure to watch the face of the MVI46-MCM module as you click.
- Now we can check to be sure our program is moving the data as it should.Â Remember previously that we zeroed out our READ DATA table and put test values in our WRITE DATA table.Â If our program is working correctly, we should now have the same values in the same relative addresses in our READ DATA as in the WRITE DATA.Â First, letâ€™s check the WRITE DATA table to be sure our test values are still there.Â In the Project Tree, under the Data Files folder, double-click â€œN32 â€“ WRITE DATAâ€.
Yep!Â Our test data is still there, just the way we left it.Â Now, for the moment of truthâ€¦does our N31 â€“ READ DATA table look the same?
- Double-click on â€œN31 â€“ READ DATAâ€ and letâ€™s see.Â If your tables overlap each other, you can click-and-hold on the blue Title Bar of either one, drag it to a different position in the window, and release.Â Ready, GO!
YES!!!!!Â They MATCH!Â Now, that was easy, wasnâ€™t it?Â You can experiment further with the above by changing the values in Data File 32, N32:0 through N32:19.Â With the PLC in Run Mode the values in Date File 31, N31:0 through N31:19 should, after a very short delay match those in Data File 32.
Using ModScan to simulate the Modbus Master
- Using Windows File Explorer, go to the CD and expand the yellow folder in the left side tree pane titled Utilities under the InRAx folder until you see a folder titled Modscan.
- Double-click on the compressed folder in the right side Explorer pane to extract its contents.Â Choose or create a new folder to contain these files.Â A suggestion would be to create a new folder titled Modscan, and then extract the compressed files into this new folder.
- After extracting the Modscan files, locate and double-click on the file titled Modscan.exe.Â You should see the following program appear.
- This is the Windows program called Modscan.Â This is a shareware program and can be used for 30 days, after which you are asked to purchase it.
- To use the program, click either Cancel or OK to close out the â€œRegistration Informationâ€ dialog window. You may have to click once inside the window, and then click OK. Repeat if necessary. Now we are ready to use the program.
- Remove the short RJ45 pigtail cable from Port 1 on the MVI46-MCM and then disconnect it from the RS232 Null Modem cable.Â Now connect the RS232 Null Modem cable directly to the COM 1 port on your computer.Â If you currently have another cable connected to
your computerâ€™s COM 1 port for interfacing to the SLC-500, first go offline with RSLogix 500 software, then disconnect that cable and connect the RS232 Null Modem cable that was previously connected to Port 1 of the MVI46-MCM module.Â We should now have COM1 on our PC connected with a RS232 Null Modem cable directly to Port 2 on our MVI46-MCM module which is configured as a Modbus Slave device.
- In the Modscan program, click on the menu choice called â€œSetupâ€, and then click on Serial.Â Configure the settings as shown below. Click OK when done.
- Now click Setup, then Display and make sure that Data and Decimal have check marks beside them.Â Click on Setup, then Protocol and make sure RTU is checked also.
- Now configure the main window as below.
- Now click on the menu item â€œActionâ€, then Start Poll.Â You may have to clear a popup window first, but you should see results like below which shows our original data that was in our Data File 32.
The register addresses are on the left and listed 40001 through 40020 and each registers value is directly to the right of it.
Congratulations, you have just used a Windows software program called Modscan acting as a Modbus Master device to go out and read data from our MVI46-MCM moduleâ€™s Port 2 which is a Modbus Slave device.
NOTE : Based on my experience the MVIMCM for SLC500 is unable to be a Slave and must be A MASTERÂ to communicate with other Modbus PLC/Devices (Scadapack32, Micromotion, UltraSonic Flow Meter GM868..)