Yes ....
I am able to write out to an external text file with this setup but how can I append to this file as the information changes before i close the file out ..... This method looks like it is giving you the very last instance of the data as output into the file ....
I have a rotary indexer that i want to create a second file called "O4105.txt" and take the (abc.x) value that get when i set up my program with a different "Tool Orientation" The output is good from this portion of the post and give me the correct "A" Axis rotation output per my CAM programs ....
Below is the area pulled from my .cps file where I create the TextFile and write out the ".abc.x" value into it ..... It creates the file OK but i need a way to keep the file open and append the values as they change when i post out and then close the file at the end of the post....
I think i'm looking for a way to "Append" to the file and not just repeatedly opening up the file and "overwrite" the first line with last variable captured when posting...
writeBlock(
// gMotionModal.format(0),
conditional(machineConfiguration.isMachineCoordinate(0), "M92 ( INDEXER WILL ROTATE TO A" + abcFormat.format(abc.x)) + ")",
// conditional(machineConfiguration.isMachineCoordinate(0), aOutput.format(abc.x)),
conditional(machineConfiguration.isMachineCoordinate(1), bOutput.format(abc.y)),
conditional(machineConfiguration.isMachineCoordinate(2),
cOutput.format(getDirectionalABC(previousABC.z, abc.z, cOutput)))
);
var outputPath = getOutputPath();
var programFilename = FileSystem.getFilename(outputPath);
var outputP = FileSystem.getFolderPath(outputPath);
op=outputP+ "\\"+ programFilename + ".txt";
var file = new TextFile(op, true, "utf-8");
file.writeln("G0 A" + (abcFormat.format(abc.x)));
file.close();
}
Thanks in advance.
Brian.