COMPILING & UPLOADING CUSTOM PLC PROGRAMS INTO THE BARIONET ------------------------------------------------------------------------------ - All necessary files can be found in the support & downloads section of www.datanab.com - Copy the following files into a folder. (lets call the folder 'C:\TEST') 1) tokenizer.exe 2) web2cob.exe 3) mimetype.ini - Create a subfolder of TEST called PLC_code. ie. C:\TEST\PLC_code - Write your PLC code in a file called 'barionet.bas' and copy it into C:\TEST\PLC_code\. Programs can be written into a standard text file with any basic tool such as Notepad. You can see some example programs at: http://www.datanab.com/docs/barionet/programs/ The programming manual can be downloaded from: http://www.datanab.com/docs/barionet/manuals/v146/Barionet_BCL_Manual_V1_46_20041012.pdf - When finished, you need to compile the code into the .TOK format by using the tokenizer.exe program. To do so, open up a Cmd Prompt window and run the below cmd, making sure that you are at the correct path of C:\TEST> when you run it: tokenizer.exe PLC_code/barionet.bas - the above command means: "use the tokenizer.exe program to compile the barionet.bas code located in the PLC_code folder into a .tok file." After you run the cmd a new file called 'BARIONET.TOK' will be created in the C:\TEST\PLC_code directory. - Next, copy the ERRORS.HLP file into the C:\TEST\PLC_CODE directory. This file will allow the BarioNet to generate more descriptive error message when debugging your programs. For info on debugging your programs, see the app note at: http://www.datanab.com/docs/barionet/appnotes/Using_syslog_&_IpLogger_to_debug_BCL_programs.pdf - Now you need to wrap the 'BARIONET.BAS', 'BARIONET.TOK', and 'ERRORS.HLP' files into one .cob file that the controller can read. To do so, run the following command in the same cmd prompt window at the C:\TEST> prompt: web2cob.exe /o barionet.cob /d PLC_code - the above command means: "use the web2cob.exe packaging program to create an output file named 'barionet.cob' from the source files located in the directory 'PLC_code'. After running that command, a new file called 'barionet.cob' will be created within the C:\TEST\ folder. - now you need to upload the packaged file 'barionet.cob' into an open memory area. To do so, use the same Cmd Prompt window and run the following command at the C:\TEST> prompt: tftp -i 172.16.17.1 PUT barionet.cob WEB5 - in the above command, substitute your controller's ip address with the one listed. The above command uses a built-in windows tool called tftp to transfer the barionet.cob file in binary mode via ftp to the ip address specified. It transfers it to the WEB5 portion of the BarioNet's memory. - typically WEB1 & WEB2 are used for the built in web application, help application, and PIC firmware. WEB3 is reserved. This leaves WEB4, WEB5, & WEB6 available for the user. Each memory area is 64KB, so if your .cob file is larger than that, it will run over into the next memory area. In our webpage example we uploaded our web code to WEB4, that's why in this example we are uploading our PLC code to WEB5. The webpage example can be found at: http://www.datanab.com/docs/barionet/appnotes/creating_and_uploading_custom_webpages.txt