Richard Posted June 1, 2017 Share Posted June 1, 2017 How do I setup from the the beginning to import information from a csv file? The file will be saved with a time stamp every min. I need to set up daqFac to get the different file every min. Of course the file will be labeled differently with the timestamp. Link to comment Share on other sites More sharing options...
AzeoTech Posted June 1, 2017 Share Posted June 1, 2017 I'm not quite sure which part you need help with. To read a CSV file, use the File.Open() function, then File.ReadDelim() and finally File.Close(). They are all described in 9.9 of the user's guide. Link to comment Share on other sites More sharing options...
Richard Posted June 2, 2017 Author Share Posted June 2, 2017 The part I am struggling with is that a folder is created and then a .csv file is created in that folder. So every min a folder and file are created. So what I need is to have it go to the folder and file every min and input that information. Link to comment Share on other sites More sharing options...
AzeoTech Posted June 2, 2017 Share Posted June 2, 2017 That's ok, but I'm still not sure where you are struggling. Is the issue figuring out the name of the folder and file? Link to comment Share on other sites More sharing options...
Richard Posted June 2, 2017 Author Share Posted June 2, 2017 Yes the folder will have a name such as "C:\File-201706020723" and changes with the time. then the file would be like "201706020723 meter #123456". I am really new to this and need help I guess from start to finish. I tried following the ex in ch 9 but could not get the data to import. I know I am messing it up either in the channel configuration or the scripting. Thanks for your time and help. Link to comment Share on other sites More sharing options...
Richard Posted June 6, 2017 Author Share Posted June 6, 2017 Can anyone help me with setting this up. I cant seem to figure this out. I need help with the whole process. Thanks. I am really a novice to this whole thing. Link to comment Share on other sites More sharing options...
AzeoTech Posted June 6, 2017 Share Posted June 6, 2017 OK, but I still don't see how you know what the folder name is if the file and folder are being created outside DAQFactory. But let's say you have a variable named timeStamp that has the time, and meterNumber that has the desired meter number. You can generate the full path using formatDateTime() and string concatenation: private string path = "c:\File-" + formatDateTIme("%Y%m%d%H%M", timeStamp) + "\" + formatDateTIme("%Y%m%d%H%M", timeStamp) + " meter #" + meterNumber If you are still having troubles, please provide detail on what you have done so far. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.