Support >> Manuals >> Writing your own software to communicate with iLoad digital USB load cells
Writing Your Own Software to Communicate with iLoad Digital USB Load cells
Since the iLoad Digital USB Load cells present themselves to
Windows as COM ports, it is very easy to write your own program to read the load cells
loads. Simply open the COM port from your application and send the string
O0W1<CR>. Then read the returned string back in millipounds. We recommend
the following steps:
- Open
the port at 9600 (baud rate is not important), N, 8, 1.
- Write a <CR> to the port.
- Wait
for a few milliseconds (say, 100 to 1000, this depends on your hardware, try a
longer wait first then shorten it to see what works. (An alternative is to wait
until there is a required number of characters in the input buffer, in this way
the wait time is reduced to a minimum).
- Read
the input buffer and discard till there are no characters to read. (You can
check if you get an 'A' back)
- Write
O0W1<CR> to the port,
- Wait
again for a few milliseconds.
- Read
the input buffer and process. This will contain the weight.
- Repeat
Steps 5 to 7 as needed.
- Discard
any bytes left in the input buffer before you close the port.
- Close the port.
If callbacks (or events) are available, it is preferable
to use them instead of polling the load cells in step 7 above. This way Windows
will inform the application that there is data to be read.
Examples for Labview and Matlab are available on our
support pages.