am i correct? excel & logix CSV communication.

fusion

Member
Join Date
Jul 2005
Location
Auckland
Posts
26
hi all. I have recently got Rslogix working with Import Asci file from Excel.CSV format. but i not sure if i under stand the data correctly

--> what i mean is the individual column that Rslogix reads. Have a look at my attachment to see what i mean. I have succesfuly imported and exported from and to excel.csv, and rslogix receives the designated file number - N1:3 etc and their respective file names - On/Off etc..

QUESTION -->but i cnt tell if the file number are receiving the data i.e 1 or 0 to turn the individual file high or low.. I am doing this in offline mode of rslogix, do i have to be onlin run mode to see the data change?
 
I think you have the wrong idea of the function of a CSV file and logix.
The *.csv is used to import the data structure you wish to use during the development of the program, not to write to the data while the PLC is running.
To write to a data point and change its value you need to do a DDE write which involves usually, RSLinx(not the lite ver.) Excel and a VBA coded function.
Regards Alan Case
 
You can enter values which you wish to place in a particualar memory location from that file within RSLogix, however, this can get really tedious if you have a lot of numbers to enter, say for a very long sequencer or a large look up table or large recipes.

To avoid the tedium of entering the information by hand, or having to go online and use DDE, you can do the following:

Click File->Save As. Change the file type to SLC library file, and save the program. Now open the .SLC file in notepad or other suitable asciConnection: closei editor. As you scroll down you will see all of your ladders and descriptions in menumonic text. Scroll past the ladders and you will come to the data files.

You will see some sections that look like this:
DATA N210:0
% N210:0 % -31 559 0 0 203 1 2 0 0 0
% N210:10 % 0 100 15 10 22 -22 15 240 682 -1
% N210:20 % -354 146 0 0 2457 22 85 400 75 0

This is an N210 file I grabbed from a SLC inport of one of my programs. Note how it is formated - and have a look around the .SLC file to understand how they are set up.

Now using excel, generate the large data file in the same format, and save it as a space delimited text file. Don,t forget to include the header to identify the file and type. Open that file in wordpad now. You should have a file that looks something like what I pasted above. Now go back to the original file and copy/paste in the first line of the fiConnection: closele. You have to have at least rung run in a SLC library file, so come down to file 2 and cut/paste the first rung and copy it over to the new file. Save that file with the .SLC extension.

Your file will look like this:
START 1747-L552B % 1747-L552B 5/05 CPU - 32K Mem. OS501 Series C %
LADDER 2
% Rung: 0 %
SOR XIC S:1/15 JSR 101 EOR

DATA N250:0
% N250:0 % 0 10 20 30 40 50 60 70 80 90
% N250:10 % 100 110 120 130 140 150 160 170 180 190
% N250:20 % 200 210 220 230 240 250 260 270 280 290

Now open RSLogix and the program in which you need the data. (Make sure you have a backup first just in case) Go to the end of ladder 2. Select the rung with the END instruction and right click (on thConnectioConnection: closen: closee rung number, not the rung) and select Import from SLC libary. Select the SLC file you just created. In my example above the data file N250 will be imprted with all the numbers in place and so will the SOR XIC S:1/15 JSR 101 EOR rung. Make sure you delete the imported rung. Viola, you have just imported a data file with numbers.

PS: Its really not a tedious as I made it sound, and once you have done it the first time, it will be a breeze to do. Play around with partial exports and imports.
 
Last edited:
For ASCII imports of CSV files I have created an excel spreadsheet with conditional formatting that flags you if any field is too long. I'll upload it later (I dont have it here) and anyone who wants to use it can feel free to do so.
 
CSV import template in Excel

OK, as promised, here is an Excel file to use for importing symbols and comments into RSLogix500.

This file already contains the comments for a PID control block, just delete them and put in whatever you want. If any field is too long the field will turn yellow. It does not however detect illegal characters. I use the auto-fill feature because Excel can auto-increment AB addresses. Eg, enter B3/0 in the address column, grab the lower right corner of the cell, and drag it down. The rows will fill with B3/1, B3/2, etc.

After you are done, delete Row 1, and save it as a .CSV file and import it into the RSLogix500 database.
 
Hi alan, alaric. Thanks for the file alaric. Yep i DO have the CLassic Version of Rslinks. And i did have the wrong idea bout the CSV. Misunderstanding i think but while going through it i learnt that i couldnt do a real time update and had to continusly import *.csv file.
I am gonna try the slc method but is it gona work with ML1500? i hope it does cos my project is due on friday and im dying to get this thing to comunicate! hope it does soon. am reading DDE as fast as i can.
 
The use of a library file (.SLC) is for offline programming only in the ML1500. You cannot use it for online realtime updates. DDE is the way to go there.
 
Fusion,

You haven't made it totally clear what you're trying to achieve with the .xls file but have a look at both the Custom Data Monitor and the Tag Uplouad/Download utilility which you should find in the Tools folder of the Logix5000 CD. They may be helpful.
 
hmmm

wel im trying to send data to plc from excel- online, so that i can control the stop position of a motor. I tried comunicating with ML1500 from C+ based program but it wasnt sucesful. Now i have made a user interface in Excel and am trying to comunicate form there. Im using Rslogix500 and ML1500 with Rslinx Classic (jus paid $800 for it) so i hope this works by friday other wise im gtn sum asswhoping!
 
Go to the Rockwell Online Knowledgebase and search for "dde AND poke". There are several appnotes that show how it can be done.

If your sig is true then you're gonna get covered in glory!
 
well what do u know!

ok, i have been trying to cold link the system and gues what! got it working! finally! but at the moment i only sent one cell from excel at a time. but hey its a step forward for me anyways.

had a bit of code in VB excel which made it all posible,

//--------VB CODE----COLD LINK----//

SUB DDE_Write_RSlinx()
DDEChannel = Application.DDEInitiate(app:="Rslinx", topic:="Conect_to_Excel")
DDEItem = "N7:0"
Set RangeToPoke = Worksheet("Sheet1").Range("A1")
Application.DDEPoke DDEChannel, DDEItem, RangeToPoke
Application.DDETerminate DDEChannel
End SUB
//--------------
anyone can use the code, but you will need to change the 'topic' to what ever file you have have in Rslinx and you will need to name your excel sheet as "RSLINXXL.xls" without the "".

Thanks to everyone for the help. Hope this helps someone in the future :)
 
So i can see the code being added to the Data table in Rslinx, but the linx DDE/OPC Topic Configuration, tab to Data collection and in the Processor Type box, ML1500 is not an option! that sux!
 
Not Sure what you are doing wrong, but I have an ML1500 talking to excel bi-directional. Did not have to do anything in linx other than configure a topic. Regards Alan Case
 

Similar Topics

Daft question coming up...When I want to modify a value, what's the best/correct way to do this? At the moment, I am entering the value (e.g...
Replies
8
Views
412
Good day. I encountered a problem when calibrating a channel on the IF16H module. The module is located in the local backplane along with the...
Replies
5
Views
726
I have some programs that i received from 1 of our programmers whos installing a new machine in our plant. He added them to a external hard drive...
Replies
9
Views
1,304
Hi, At the moment, If the user fails to provide a valid username/password, the image attached appears "Invalid password or user name. Logon has...
Replies
12
Views
1,545
Hi, In a Direct On Line circuit for CW and CCW operation of a 3 phase motor, what is the right way to interlock the contactors. 1) Use a NC...
Replies
11
Views
1,527
Back
Top Bottom