How to Convert CSV data (recipe) into Binary

K

Thread Starter

K Khan

Have an application where there can be as many as 1000 recipes each having 5 parameters. Have a software that can generate all these 1000 recipes into a CSV format automatically (All 5 Parameters columnwise and 1000 recipes in rows). But I can only import a binary file format from the PLC's ladder software, now i need some kind of utility which can convert this recipe file into a binary format.
 
M

Michael Batchelor

What PLC and what software are you using. And how does your PLC program go about parsing this binary file? I can think of half a dozen ways to write that code, but what is *YOUR* code doing? You're missing a critical piece of information without knowing the binary format definition.

MB
--
Michael R. Batchelor

Industrial Informatics, Inc.
1013 Bankton Cir., Suite C
Charleston, SC 29406

843-329-0342 x111 Voice
843-412-2692 Cell
843-329-0343 FAX
 
You can open up a .csv file extension with Microsoft Excel. You can then write a equation to convert decimal numbers to binary. Look up 'dec2bin' in Microsoft help.

You can enter an equation like =dec2bin(a2,8)

a2 = cell a2
8 = display binary result to 8 digits.

You may have to install dec2bin in tools, add-ons.

Hope this helps.
 
K

Ken Emmons Jr.

It seems that you will need to know the binary file format that your software will accept, it is probably not just a matter of converting the text data to binary. Converting the data is easy, finding and understanding the binary file format may or may not be.

If you don't have the document of the binary format available, you might try using a hex editor application on a small, simple file with known data that is similar to your file you intend to use (e.g. with 3 recipe rows instead of 1000), and try to find out how the file data is arranged.

~Ken
 
Top