Many times enough the worst part about starting a new RS Logix 500 PLC project is typing in all the descriptions and symbols for all your bits and I/O. Luckily there is an easy way to go about doing this monotonous task. I use EXCEL to wiz through this busy work.
I've created an EXCEL template file that you can download here. Once you've downloaded the EXCEL file you can kind of see how the template layout works.
The rows are formatted to the maximum width of characters that RS Logix will allow. Simply type in the address, bits, timer files or whatever memory files you want to include for a description. Make sure you include a symbol for your description. Use under scores for spaces with your symbol names you create. Learning to use symbols to program will save you a ton of time in programming because it's easier to remember the symbol name "RUNNING" rather than B3:1/3 means "running". More about symbol programming in another article.
One EXCEL trick that I use quite often is the AUTO FILL feature. That's where I just type the first address and drag down to auto fill the rest of the address in the card rack.
Once you've created your excel sheet. It's now time to save the excel sheet as a CSV format. The database import tool in RS Logix is designed to accept a CSV file that you create.
In Excel, click on File Save As.
Choose CSV (Comma Delimited). Type a file name for your CSV file.
Now start RS Logix, and click on Tools, Database, ASCII Import.
Change the option to CSV.
Find your file name you saved earlier, make sure you have CLOSED Excel by now, otherwise you will get a can't open file error, because Excel still has the file open in the background.
Once your file is imported, click on the database, address/symbol in the tree viewer. We need to delete just a little bit of trash the template file imported into your database.
What you are looking for is the header columns from the excel template. These get imported also so it's just best if we delete these.
Delete these extra database entries by clicking and highlighting the row and simply hitting delete. Once you have cleaned up your database, you should be ready to start programming!
PLC Advance
7/31/11
RSLinx DDE to VB6
It is possible to use Visual Basic to create a custom MMI when RSLinx Professional is available. Thismethod uses DDE (Dynamic Data Exchange) and is somewhat slow, but it is an easy way to get limited amounts of data from a PLC.
The first step is to create a topic in RSLinx Professional (must be the professional version). In the example uses here, the topic is called ‘LID_PUNCH’. You can use whatever name you wish, it is important that the topic matches the LinkTopic setup in Visual Basic. Select DDE/OPC from the menu bar in RSLinx as shown in Figure 1. Then select Topic Configuration
Figure 2 shows the actual setup for the topic that is named LID_PUNCH. The machine in example uses an Allen-Bradley SLC5/04. The Data Source is an SLC5/04 that is highlighted under IP address10.100.100.118.
Next, select the Data Collection tab, and setup the PLC type. Figure 3 shows that a SLC503+ has beenselected for the type, and the Polled essages time has been set for 1000msec. If we request the data later in Microsoft Excel, we will be updating the cell in the spreadsheet every 1000 msec according to this value.
Once the topic has been configured in RSLinx, a simple Visual Basic program can be configured that has a text box and a command button on a form. The following code can be placed in the command button Click event:
Text1.LinkTopic = ”RSLinx|LID_PUNCH”
Text1.LinkItem = ”N7:0”
Text1.LinkMode =2
Text1.LinkRequest
The above code will cause data from address N7:0 to appear in the text box whenever the command buttonis clicked.
The first step is to create a topic in RSLinx Professional (must be the professional version). In the example uses here, the topic is called ‘LID_PUNCH’. You can use whatever name you wish, it is important that the topic matches the LinkTopic setup in Visual Basic. Select DDE/OPC from the menu bar in RSLinx as shown in Figure 1. Then select Topic Configuration
Figure 2 shows the actual setup for the topic that is named LID_PUNCH. The machine in example uses an Allen-Bradley SLC5/04. The Data Source is an SLC5/04 that is highlighted under IP address10.100.100.118.
Next, select the Data Collection tab, and setup the PLC type. Figure 3 shows that a SLC503+ has beenselected for the type, and the Polled essages time has been set for 1000msec. If we request the data later in Microsoft Excel, we will be updating the cell in the spreadsheet every 1000 msec according to this value.
Once the topic has been configured in RSLinx, a simple Visual Basic program can be configured that has a text box and a command button on a form. The following code can be placed in the command button Click event:
Text1.LinkTopic = ”RSLinx|LID_PUNCH”
Text1.LinkItem = ”N7:0”
Text1.LinkMode =2
Text1.LinkRequest
The above code will cause data from address N7:0 to appear in the text box whenever the command buttonis clicked.
MicroLogix PTO Instruction
The PWM function is only available when using the BXB models of the MicroLogix 1200 or 1500
Locate the Function Files under Controller in RSLOGIX 500 v4.00 or later and select
the PTO tab, then select the [ + ] next to PTO:0 ( See Below )
Enter the following parameters as the "Minimum Configuration" required for the PTO to generate pulses.
PTO:0.OUT Select Destination Output for pulses : Output O:0/2 or O:0/3
PTO:0.OF Output Frequency - Frequency of pulses : 0 to 20,000 Hz
Data less then zero and greater then 20,000 generates a
PTO error
PTO:0.TOP Total Output Pulses - Determines total number of pulses
to be generated by the controller
PTO:0.ADP Accel/Decel Pulses - How many of the total pulses will
be used for the Accel/Decel component
The following example will generate 10,000 pulses on Output O:0/2
at a frequency of 500Hz and 100 pulses will be used for Accelerating
and 100 pulses will be used for Decelerating.
The following ladder logic will need to be entered into File #2
By toggling Bit B3/0 the PTO can be activated. Once running the PTO will generate the number of pulses entered into the PTO:0.TOP word and then stop. To restart, toggle B3/0.
General information on the PTO
Once running the PTO will continue to generate pulses until all pulses have been generated or the PTO:0/EH ( Enable Hard Stop ) bit has been activated.
Once the EH bit is set the instruction will generate a PTO error of 1 (hard stop detected).
In order to clear this error the PTO instruction must be scanned on a false rung of logic, and the EH bit must be off.
To change the Total Output Pulses Generated in a working program a new value can bemoved into PTO:0.TOP by using the MOV command.
Locate the Function Files under Controller in RSLOGIX 500 v4.00 or later and select
the PTO tab, then select the [ + ] next to PTO:0 ( See Below )
Enter the following parameters as the "Minimum Configuration" required for the PTO to generate pulses.
PTO:0.OUT Select Destination Output for pulses : Output O:0/2 or O:0/3
PTO:0.OF Output Frequency - Frequency of pulses : 0 to 20,000 Hz
Data less then zero and greater then 20,000 generates a
PTO error
PTO:0.TOP Total Output Pulses - Determines total number of pulses
to be generated by the controller
PTO:0.ADP Accel/Decel Pulses - How many of the total pulses will
be used for the Accel/Decel component
The following example will generate 10,000 pulses on Output O:0/2
at a frequency of 500Hz and 100 pulses will be used for Accelerating
and 100 pulses will be used for Decelerating.
The following ladder logic will need to be entered into File #2
By toggling Bit B3/0 the PTO can be activated. Once running the PTO will generate the number of pulses entered into the PTO:0.TOP word and then stop. To restart, toggle B3/0.
General information on the PTO
Once running the PTO will continue to generate pulses until all pulses have been generated or the PTO:0/EH ( Enable Hard Stop ) bit has been activated.
Once the EH bit is set the instruction will generate a PTO error of 1 (hard stop detected).
In order to clear this error the PTO instruction must be scanned on a false rung of logic, and the EH bit must be off.
To change the Total Output Pulses Generated in a working program a new value can bemoved into PTO:0.TOP by using the MOV command.
7/28/11
Excel Connect to ControlLogix (DDE)
To Read tags form Control Logix PLC (Allen Bradley) used RSLinx (DDE) Follow this step.
Step 0 -> Open Excel software
Step1 -> In RSlinx software go to menu DDE/OPC-> Topic configuration
Step 2 -> create your DDE/LINK
Click on New
Then give a name to this new link : for example : emulator
Then give the path to the online PLC
Click on Apply : your DDE/OPC link have been created
Click on Done.
Step3-> Goto Menu Edit-> Copy DDE/OPC Link
Then choose your DDE/OPC Link : Emulator->Online
Choose the tag you need : for exemple Test_Tag
Then click on OK
Step 4-> Paste link in Excel
In Excel software
Choose a cell and then using the right button of your mouse click on special paste
Choose « paste with link » then click on OK
Step 0 -> Open Excel software
Step1 -> In RSlinx software go to menu DDE/OPC-> Topic configuration
Step 2 -> create your DDE/LINK
Click on New
Then give a name to this new link : for example : emulator
Then give the path to the online PLC
Click on Apply : your DDE/OPC link have been created
Click on Done.
Step3-> Goto Menu Edit-> Copy DDE/OPC Link
Then choose your DDE/OPC Link : Emulator->Online
Choose the tag you need : for exemple Test_Tag
Then click on OK
Step 4-> Paste link in Excel
In Excel software
Choose a cell and then using the right button of your mouse click on special paste
Choose « paste with link » then click on OK
Subscribe to:
Posts (Atom)