You are on page 1of 3

Applied Engineering Integration Note

)UDPH:RUN7HUPLQDO&RPPDQGV

,QWURGXFWLRQ
All DVT SmartImage Sensors running FrameWork use system-specific commands for
communicating with the FrameWork user interface. These commands are published on the DVT
website. This note describes one use of the FrameWork commands.

A full-length FrameWork commands list can be obtained from the DVT website. This document is
titled FrameWork 1.3 Full Commands List.

The use described here shows how to externally set SoftSensor parameters from a Visual Basic
application. A technical note on using Microsoft Visual Basic to communicate with a SmartImage
Sensor can be found on the DVT website under this title: Visual Basic-Display TCP/IP Data.

7HUPLQDO&RPPDQGV
For easier development testing, the terminal commands can be used from a FrameWork terminal
window. Open the FrameWork terminal by pressing CTRL+ALT+T. Below is a picture of the
FrameWork terminal.

Figure 1 The FrameWork Terminal

Practice using the terminal commands with the following session:

Command Response
#PQ a list of Products currently in RAM on the SmartImage Sensor

#PS1 selects the Product with an ID of 1 (choose this number by looking at the
response from the #PQ command – the first column is this ID)

#SQ query the SoftSensors in the selected Product (note: this command must come
after a #PSx command to select a Product)
Integration Note

&RPPDQG6HTXHQFHWR6HWD6RIW6HQVRU7KUHVKROG
This section illustrates the sequence of commands to set the threshold for a SoftSensor, called
“TestInput”. All of the following descriptions reference a Product called “Commands” and here is
the Result Table for the Product:

Command Response Explanation


#PSN #PSN is the
Product Select –
by Name
command. The
Product Name is
the exact string
name of the
Product (which is
shown on the
Result Table or
can be obtained
with #PQ).

#SQ #SQ is the


Sensor Query
command. The
output structure
is: <sensor ID>
<sensor type ID>
<sensor name>.
You will need the
sensor ID for the
next command.

2
Integration Note

#SP 1 1 0 8000 #SP is the Sensor


Parameter
command. The
structure used
here is: <sensor
ID> 1 0
<threshold value
* 100>. To set a
threshold of 80,
use a value of
8000. This
structure is fully
documented on
page 31of the
commands list.

The result of the above session is that the “TestInput” SoftSensor now has a threshold of 80.0.
The following image illustrates this:

Figure 2 New Threshold

&RQFOXVLRQV
This application is made more useful with a short Script SoftSensor called “minvalue” as follows:
minvalue.Angle = TestInput.Threshold
With this line of script, you reference the newly set threshold parameter for the “TestInput”
SoftSensor.

To make your application more flexible, make sure to allow for queries for new Product names
and / or SoftSensor ID’s. Hard-coding Product names into Visual Basic, for example, is not
recommended. If the user changes the Product name, then the VB code would need updating.

You might also like