CSV file creation in RSView


Thread Starter

Jeffrey D. Brandt

Since I don't feel like having my local distributor steal my work by asking my customer's location or business, I'll ask THIS group a simple RSView32 question: Is is possible, without jumping though hoops and buying special add-ons, to use RSView32 to create a single line comma separated value file, like: ABC123,23.012,1.222,X,0,122 where the numbers shown come from tags in the target PLC, and the file name of the .CSV file is also a variable in the RSView database/tagname dictionary (or whatever they call it today) Jeffrey D. Brandt http://users.supernet.com/jdbrandt/
Very easy to do in RSView VBA language, if you are somewhat familiar with Visual Basic. There are many appnotes on Rockwells web site that show how to read a tag value into VBA. You then use the PRINT statement, if I recall correctly, to format the line and print it to a file. Any decent book on VB or Quickbasic would show an example. If you cannot figure it out, email me and I can dig out an example. It should only take a few lines of code to do this. Bill Sturm
I wanted to know too, so I called Rockwell. No, you can't export to csv, but yes to .dbf database using logging. On a button command, log to dbf file. you will not be able to format like in wonderware, and you will get time and date and milliseconds. Trevor

Jeremy Pollard

The RSView object model is esoteric at best but it is easy to create gTagDB.GetTag("tag_Name_here").value is the call to use to get the value Using the stabdard VB stuff Open FileToOpen For Output As #1 ;append and Input are options print #1, gTagDB.GetTag("tag_Name_here").value, gTagDB.GetTag("other_tag_Name_here").value close #1 You can use the Write statement as well. Good luck Cheers from: Jeremy Pollard, CET [email protected] On The Web - http://www.tsuonline.com PLCopen North America - [email protected] www.PLCopen.org the Training Factory, Inc. Programmable Controller Support Systems The Software User Newsletter ONLINE The Crazy Canuckian! 8 Vine Crescent, Barrie, Ontario L4N 2B3 705.739.7155 Fax 705.739.7157