05.07.2013 Views

BSA Flow Software Installation and User's Guide - CSI

BSA Flow Software Installation and User's Guide - CSI

BSA Flow Software Installation and User's Guide - CSI

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Examples<br />

Typically the RS232 communication is event driven. Whenever data is<br />

arriving to the port the OS is informed. The controller software can be<br />

notified using events or messages depending on the architecture chosen. The<br />

protocol is designed so that the & character can be used as end character in<br />

the incoming data flow.<br />

It is important that the controller answers the comm<strong>and</strong>s send from the driver<br />

using the right protocol. If the driver cannot underst<strong>and</strong> the incoming answer<br />

it fails (see error code 1-5).<br />

If the controller needs to make time consuming operations, it must answer<br />

the incoming comm<strong>and</strong> before stating this. In this case the controller can<br />

choose to ignore incoming comm<strong>and</strong>s by answering them quickly.<br />

Example 1<br />

The user needs to change settings in his program every time the traverse is<br />

used, in this example max. speed set to 100 <strong>and</strong> a calibration constant to 333.<br />

He can use the initialisation string to set the settings from time to time, saved<br />

in the project.<br />

SendToSerialPort( "#INIT:SPEED100,CALIB333&" )<br />

IF ( ReceivedFromSerialPort() == "#INIT:0&" ) -> OK<br />

Example 2<br />

When the application wants to move to a position the co-ordinates are scaled<br />

from mm, used in the application, to µm used in traverse communication.<br />

x = 2.34594, y = 0.145, z = 2.5 (mm)<br />

SendToSerialPort( "#MOVE:2346,145,2500&" )<br />

IF ( ReceivedFromSerialPort() == "#MOVE:0&" ) -> OK<br />

We loose precision on the x co-ordinate, but it has no relevance.<br />

Example 3<br />

Reading the position can be done by calling<br />

SendToSerialPort( "#READ&" )<br />

6.5.2 Use of External Traverse files<br />

IF ( ReceivedFromSerialPort() == "#READ:0&" ) -> OK<br />

Other errors e>100 can be found by examining the return string.<br />

The External Traverse file can be enabled in the Region(s) menu in the<br />

region list.<br />

6-74 <strong>BSA</strong> <strong>Flow</strong> <strong>Software</strong>: Options <strong>and</strong> Add-ons

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

Saved successfully!

Ooh no, something went wrong!