Anonymous - 2014-10-25

Originally created by: Russell Schwulst

Hi all. I am currently using a CX 8090 to log data to my pc. I write a CSV file to my pc. (FileOpen, FilePuts and FileClose). Everything is working fine except if there is a power failure. Let me explain. If my pc loses power, I have instructed the CX 8090 to write to it's memory but I am not too sure how to create the code in Twincat 2 to do this. My current instruction looks like like this:
F FB_FileOpenFB.bError THEN
EnableFileClose:=FALSE;
EnableFilePuts:=FALSE;
EnableFileOPen:=FALSE;
sNetId:='5.1.107.84.1.1';
sFileName:='Hard Disk\Jan\TextModeGen.csv';
ELSE
sNetId:='172.18.164.203.1.1';
sFileName:='C:\Temp_6\TextModeGen.csv';
END_IF
Is this the best way to do this?

Also, if the PC has powered down, the program seems to take a long time to start writing to the PC again. Sometimes it does not and all I do is open the Twincat PLC Control software (without logging into the program) and suddenly it starts writing again?
Your assistance will be much appreciated.

Home Test_v6.pro [242.05 KiB]