Sign in to follow this  
Followers 0
callelundin

FileXXX in Cicode, lagging?

4 posts in this topic

Heya folks! Im logging some integers using "Dev" commands and im puting them in a temporary file. This works great! But then im trying to use "File" to copy, move, rename and delete the file. This is not working very good! Im using this code: !Here i copy the file to another location! FileCopy ("C:\Swegon\db\RapportT1kWh.dbf", "C:\Swegon\db\Lager_T1\kWh\RapportT1kWh.dbf",0); !Here i make a new name for the file to current date! FilePath=FileMakePath("",PathToStr("C:\Swegon\db\Lager_T1\kWh\"),SystemDatum,"dbf"); !Here i rename it to current date! FileRename("C:\Swegon\db\Lager_T1\kWh\RapportT1kWh.dbf",FilePath); !Here i delete the old file! FileDelete("C:\Swegon\db\RapportT1kWh.dbf"); All thoose 4 command i do with 1 trigger signal. And sometimes it works great and othertimes its takes two or three tryes. Is it becuse im doing the "file" command to fast? should i do one command and then wait a minut and then do the next? Do anybody have a similar problem? This im doing on 10 diffrent loggfiles, and its pretty good but it aint perfect! help? tip? :)

Share this post


Link to post
Share on other sites
I would be tempted to put a Sleep(1) in between each command to give it some time to do the copy etc. and see if that makes it any better

Share this post


Link to post
Share on other sites
Be a bit careful with sleep - do not make it very long - do not know about the latest version but I made a mistake years ago and put in the wrong number - Citect almost stoped whiule sleep was on. I put in 100 seconds isntead of 1 second - took a while to find the problem.

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  
Followers 0