11.07.2015 Views

BCL Programmers Manual V2.00 (PDF) - Barix

BCL Programmers Manual V2.00 (PDF) - Barix

BCL Programmers Manual V2.00 (PDF) - Barix

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3 <strong>BCL</strong> basics3.1 Starting with <strong>BCL</strong>3.1.1 Simple programHere is a simple program to test that tokenizer, tftp uploading, <strong>BCL</strong> interpreter in the <strong>BCL</strong> device andsyslog daemon 1 are all working well:SYSLOG "Hi, everything is OK"ENDAfter the program is uploaded to the device and interpreted, messages similar to thefollowing should appear in the syslog:Dec 2 15:53:53 192.168.2.145 BARIX <strong>BCL</strong> Interpreter, V1.5Dec 2 15:53:53 192.168.2.145 Hi, everything is OK.Dec 2 15:53:53 192.168.2.145 <strong>BCL</strong> end<strong>BCL</strong> keywords are case insensitive. Parameters should be separated by a comma (',', ASCIIcharacter 44). For functions, the parameters should be in parenthesis, for example:I=PING("192.168.2.18",50)even if the value is not used:PING("192.168.2.18",50)3.1.2 CommentsIt is possible to have useful comments inside the source <strong>BCL</strong> file. The ' (apostrophe, ASCIIcode 39) character is used for commenting. All text after the apostrophe sign is ignored tillthe end of the line (CRLF).'This is our first program!SYSLOG "Hi, everything is OK"'end of our first program!END'send message using syslog commandFunctionally this program is exactly the same as the first program so the syslog output isidentical:Dec 2 15:53:53 192.168.2.145 BARIX <strong>BCL</strong> Interpreter, V1.5Dec 2 15:53:53 192.168.2.145 Hi, everything is OK.Dec 2 15:53:53 192.168.2.145 <strong>BCL</strong> end3.1.3 Command delimitersMost <strong>BCL</strong> statements can be delimited with new line (CRLF, ASCII codes 13,10) or ':' (colon,ASCII code 58) characters. 2 Comments and DIM statements (see section 4.1 Interger Arrays onpage 12) must be terminated with CRLF.3.1.4 Multi-line commandsIt is possible to write multi-line commands by putting an '&' character (ampersand) at theend of the line to be continued. An example follows:SYSLOG "1":SYSLOG"2":SYSLOG &1 For more information about syslog, see section 14, page 762 Using space (' ', ASCII code 32) as separator, which was possible in previous versions, is considered deprecated and will notbe supported in future versions of <strong>BCL</strong>.<strong>Barix</strong> AG | 7/106

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!