Q: Can I use the FileWriteVar function block to export data as a .csv file?
A: No, the FileWriteVar function block does not write the data in an understandable .csv file. The file type is .csv, but the data is written as raw binary data, with the intention that the data can be loaded back into the CPU in the future, with the FileReadVar function block.
If we use FileWriteVar on the following set of data

The file would look as follows when viewed with a HEX editor.

Date/Revision History
First review 9/29/2025 V1.0
Author:
Ed Gallagher – Technical Support Specialist
References
NJ/NX-series Instructions Reference Manual
Example Attached - FileWriteVar.smc2
Example Attached - hextreme.msi
Example Attached NJ Data Log Function Block and PDF
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article