SLC to a Mettler Toledo BBK Scale RS-232 (thru Devicenet)

Sign in to follow this  
Followers 0

1 Screenshot

About This File

Here is a sample program that talkes to a Mettler Toledo BBK scale using a Point I/O RS232 ASC module on device net. Way powerful module!

To query the scale you need to send an ASCII command:

S<CR><LF>

This is the capital "S" a carriage return then a line feed.

In the Allen Bradley SLC PLC you'll need to send special characters.

ST18:10 (see PDF file data_file.pdf page 25)

string value to printer from PLC

S^M^J

^M in Allen Bradley means = carriage return

^J in Allen Bradley means = line feed

Next you have to parse the data the scale just returned to you.

Starting at Rung 5 in the PDF read the string from the scale (through devicenet) and begin to parse out the "data".

The scale sends the PLC a string like this:

^S^JS S 0.000 lb

See ST18:0 in the data_file.pdf.

Begin to count characters to the data you need weight in the case. Then "extract" the portion of the string into another ST18:1 register.

You'll notice that the data has a decimal point in the string. Allen Bradley doesn't support "string to real" function so you'll need to extract the whole number then extract the decimal point value into two separate strings. Once you do that you can do a string to integer conversion. Once it's an integer format both the whole number and decimal place you can add the two values back together like it was before as a real type format or floating point using ladder logic to do the math.