Sign in to follow this  
Richard

.csv file imported to DaqFac

Recommended Posts

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. 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this