You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old January 22nd, 2018, 03:07 PM   #1
ganutenator
Member
United States

ganutenator is offline
 
ganutenator's Avatar
 
Join Date: May 2002
Location: akron, ohio
Posts: 1,036
text file into excel

I wrote a script in Indusoft that backs up recipes to a text file.
I would like to allow the customer to view these in excel.
  Reply With Quote
Old January 22nd, 2018, 03:34 PM   #2
dmroeder
Lifetime Supporting Member
United States

dmroeder is online now
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,031
Uhh, right on...

I guess since you didn't really give many specifics, nor did you ask an actual question, I'll just say copy and paste the data in your text file into excel.
  Reply With Quote
Old January 22nd, 2018, 03:46 PM   #3
spaderkung
Member
Sweden

spaderkung is offline
 
Join Date: Aug 2007
Location: A flat type "4"
Posts: 335
Just open it in XL.

Format it before save into columns w any delimiter, XL will ask upon open.
__________________
Jon Bolmstedt, Inspired Automatician.
  Reply With Quote
Old January 22nd, 2018, 03:51 PM   #4
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,402
https://en.wikipedia.org/wiki/Comma-separated_values
__________________
  Reply With Quote
Old January 23rd, 2018, 03:05 AM   #5
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 923
You don't even need to use csv as long as the formatting is done consistently.

In Excel, go to Data tab, In the Get External Data section, you can choose from text, point to the file and define how the file is formatted for it to be able to split the data into cells.
  Reply With Quote
Old January 23rd, 2018, 05:05 AM   #6
AustralIan
Member
United Kingdom

AustralIan is offline
 
Join Date: Jan 2013
Location: UK
Posts: 754
You can no longer purchase hyundai excels new. Consider using an i30 for your application.
  Reply With Quote
Old January 23rd, 2018, 01:58 PM   #7
NetNathan
Lifetime Supporting Member
United States

NetNathan is offline
 
Join Date: Nov 2011
Location: Corona, CA
Posts: 1,433
Is it a CSV file?
InduSoft supports Active-X. The "Microsoft Spreadsheet" Active-X supplied with OWC11 will work to show CSV.
http://www.indusoft.com/Marketing/Ar...ntrols-Webinar

Are you using InduSoft Web Studio? It has recipe functions:
http://www.indusoft.com/Marketing/Ar...oft-Web-Studio
__________________
****Control Freak****
Net is where I be and Nathan is me.

Last edited by NetNathan; January 23rd, 2018 at 02:01 PM.
  Reply With Quote
Old January 23rd, 2018, 02:37 PM   #8
exabmorgan
Member
United States

exabmorgan is offline
 
Join Date: Feb 2008
Location: USA
Posts: 63
I've done this exact procedure with Indusoft Web Studio. The issue is that in a recipe data file Indusoft stores arrays of tags that are strings with a space between them and arrays of numbers with linefeeds. If the recipe doesn't have arrays than every line is a separate tag.

So the attached macro for excel in a text file works on four arrays, the first two are strings, the second two are numbers.

The recipe is loading arrays that contain 300 tags.
Attached Images
File Type: jpg 2018-01-23_15-34-10.jpg (58.5 KB, 15 views)
Attached Files
File Type: txt macro.txt (1.2 KB, 11 views)
File Type: txt Calcs.rcp.txt (266 Bytes, 9 views)
  Reply With Quote
Old January 23rd, 2018, 06:51 PM   #9
exabmorgan
Member
United States

exabmorgan is offline
 
Join Date: Feb 2008
Location: USA
Posts: 63
Crud, I screwed that post up, code is good but that 'makes' a recipe from an Excel worksheet. And you said you wanted to Read a recipe.

Hopefully this excel file clears it it up, it does both write and read. (100 elements in these arrays)
Attached Files
File Type: xls WriteReadDAT.xls (60.5 KB, 12 views)
  Reply With Quote
Old January 24th, 2018, 08:38 AM   #10
ganutenator
Member
United States

ganutenator is offline
 
ganutenator's Avatar
 
Join Date: May 2002
Location: akron, ohio
Posts: 1,036
the indusoft saves data values to a text file. here a snipet of what the text file looks like:

I would like to allow the customer to view this as in a format that makes more sense to them.
Thinking of maybe using the vb in excel to read the lines of the text file and put them in the proper cells? but I don't know how to do that at the moment.

[Speed Config]
Pre1WashPassSpd=1.35
Pre1SlowFrntSpd=0.80
Pre1SlowRearSpd=0.80
Pre2WashPassSpd=1.35
Pre2SlowFrntSpd=0.80
Pre2SlowRearSpd=0.80
HiPressWashPassSpd=1.25
HiPressSlowWashPassSpd=0.70
HiPressSlowFrntSpd=0.70
HiPressSlowRearSpd=0.70
TriFoamWashPassSpd=1.50
LpChem3PassSpd=1.25
FoamWaterfallPassSpd=1.30
PresoakDwellPassSpd=1.50
RepositionPassSpd_hmi=1.57
MedPressPassSpd=1.57
SpotFreeWashPassSpd=1.25
TopMedPressPmpSpd=30
SideMedPressPmpSpd=30
SideHighPressNormalPmpSpd=48
SideHighPressTallPmpSpd=60
UnderbodyPmpSpd=30
  Reply With Quote
Old January 24th, 2018, 08:55 AM   #11
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,496
Does Indusoft gives you the option of saving as a .csv file or are you limited to .txt?
A .csv file is also a text file that Excel can open.
If Indusoft won't let you save as .csv, I suggest you create an Excel spreadsheet that displays the data the way you want and then save it as a .csv file. Open the .csv file with Notepad to see how the tagnames and values are arranged. Then modify your Indusoft script to create a file that matches the way the data is presented in the .csv file.
  Reply With Quote
Old January 24th, 2018, 09:00 AM   #12
ganutenator
Member
United States

ganutenator is offline
 
ganutenator's Avatar
 
Join Date: May 2002
Location: akron, ohio
Posts: 1,036
I want excel to read the file, look for ex: "Pre1WashPassSpd" and put it's value in a cell that I made pretty for the customer to see. aka, not display the tag name but something like Easy cleaning: Presoak 1 Wash Pass Speed 1.35 ft/sec. automatically.
  Reply With Quote
Old January 24th, 2018, 09:17 AM   #13
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,496
In Excel:

Open the text file
Locate the substring "Pre1WashPassSpd="
Extract the characters from the end of that substring until the next CRLF
Convert that to a number and put it into the appropriate cell
Repeat for the next tagname
  Reply With Quote
Old January 24th, 2018, 09:34 AM   #14
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Cobourg
Posts: 2,526
Using VBA:
https://stackoverflow.com/questions/...by-line-in-vba

Indusoft has some interesting applications on their website.
http://www.indusoft.com/products-dow...e-applications
An application for DDE to Excel. This would communicate directly to the excel file.

Regards,
Garry
__________________
Garry
http://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old January 24th, 2018, 08:37 PM   #15
ganutenator
Member
United States

ganutenator is offline
 
ganutenator's Avatar
 
Join Date: May 2002
Location: akron, ohio
Posts: 1,036
Now I am thinking that it would be better to generate a web page w/ the data.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Is it possible to convert a csv in excel to possibly a xls file? jsalzm1 LIVE PLC Questions And Answers 17 June 22nd, 2015 09:33 AM
factory talk : converting MER file to APA aminto89 LIVE PLC Questions And Answers 6 September 19th, 2014 04:25 AM
Siemens Read Text File JasonWade LIVE PLC Questions And Answers 3 January 15th, 2014 04:35 AM
Siemens S7-400, Exporting the online DB values to Excel or text file mailken LIVE PLC Questions And Answers 1 January 11th, 2011 03:54 PM
Intouch 9.5 reporting to Text File curlyandshemp LIVE PLC Questions And Answers 3 June 5th, 2009 05:52 AM


All times are GMT -5. The time now is 09:21 PM.


.