Print

How to Write your Own Software with our iLoad Digital Load Cells

The iLoad, iLoad TR and iLoad Pro USB Load Cells as well as the DQ-1000U/DQ-4000U series capacitive load cell interfaces that work with the iLoad Mini series load cells, all have a built in ASCII Command Set that can be used to communicate with the devices. You can write your own software using any commonly available programming languages such as C, C++, Python, C# or other languages. You can also communicate with these devices via Matlab, LabVIEW and other instrumentation tools.

How to Connect

If the device drivers are installed correctly, all our devices show up as Virtual COM ports on a PC, Mac or Linux machine. On a PC they can be seen under Device Manager under the Ports section as COMXX e.g. COM2, COM12 etc. Under the Mac or Linux machines, they show up under /dev/ttys1 etc.

Connection Settings

Open the serial using port using 9600-N-8-1, No Flow Control
If you have purchased high speed version of DI-1000, try 230400 baud rate, in this case try 230400-N-8-1, No Flow Control.

Command Set

When sending commands to the load cell, simply send command<CR> where <CR> is the carriage return character (0x0D). There is no need to send the line feed character (0x0A). When reading from the sensor, you need to process both the <CR> and <LF> characters.

When you Send a <CR> command, you get back an "A" for acknowledgement of the connection. Once you get back an "A" you are in business!

You can then send a "?" command to get back a list of commands available for THAT particular device. Commonly available commands for the iLoad Series are shown below:

 Command     Function
  ENTER   This just pings the port and the sensor responds with “A” to indicate that it is set up and ready.
  CT0   This sets the tare (or zero) for the sensor. If you plan to zero out a preload, please use this command.

  O0W1
  or
  W

  The O0W1 command outputs the weight or force reading once. (The output will be in millipounds, mLB.
  Do not change the default units)
  (W command is not supported in all firmware versions).

  O0W0   O0W0 outputs a continuous stream of weight or force readings. Hit <Enter> to stop streaming.
  The output is in 1/1000 of a pound (millipound).
  E.g., if the reading returned is 2345, the sensor reading is equivalent to 2.345 lb.
  SLC   This command outputs a floating point number that indicates the load capacity of the sensor in lb.
  SS1   This command outputs a factory ID of the sensor.
  This command can be used to identify each load cell uniquely.
  The user can burn his own serial number (or any other identifying string) into the load cell by issuing the
  CS1 <id> command.
  However this should be done only if the user is writing his own software and needs IDs that are  different  from the predefined IDs.
  O0T1   Outputs the elapsed time (in milliseconds since the last tare) and the weight (in millipounds) once.
  O0T0   Outputs the above time and weight information continuously. Hit <ENTER> to stop the output.
  CPS xx   Set averaging parameter 1.
  xx
is a number between 32 and 1023.
  Higher numbers 'smoothen' the readings but slow down the  response.
  Higher numbers also increase the sensor resolution.
  (It is not recommended that the user change this setting.)
  CSS yy

  Set averaging parameter 2.
  yy is a number between 1 and 15. 1 means no averaging.
  15 means highest averaging. Higher settings  smoothen the data at the cost of latency.

  (For firmware versions 9E and above set CSS=1)

  CLA zz   Set averaging parameter 3. (Only available in firmware versions 9E and above)
  zz is a number between 1 and 256. (1 means no averaging, 256 means highest averaging)
  ?   Shows the version number and commands available. Some of the commands are for internal use only.
  UNITS   Do not change the predefined units. By default UNITS are set to mLB (millipounds).
  The Loadstar software  will correctly interpret the readings and convert them.
  If you are writing your own software, then read the weights in mLB and do the required unit conversions  yourselves.

 

IMPORTANT NOTE: If the user is writing his or own software to read the iLoad digital load cells, it is recommeded to remove averaging and use the following settings:


CPS 64 or CPS 128 or CPS 256 (the higher the CPS value, the slower the output values but better the resolution)
CSS 1
CLA 1
Then perform any needed averaging in the application itself.