Working With Online Devices
124
NetLinx Studio (v2.4 or higher)
The
SEND_STRING 0
message is obviously completely customizable - whatever is typed in will be
what you are going to get.
This can be used as a way to see the value of variables at specific points in the code, by sending that
information from that point, instead of stopping execution with a breakpoint. This is especially
useful if programmers have to watch non-printable data bytes that only show as blank boxes in
Windows programs, the
SEND_STRING 0
code can reformat the data as a string of printable ASCII
characters.
The 'debug.axi' file (
attached to Technote #461
) contains 16 subroutines useful for this type of
debugging and other purposes, e.g.
DPS_TO_STRING
and
STRING_TO_DEV
are useful for passing
DEV
information between masters via a virtual device in a master-to-master scenario. Theses
subroutines were created as an AXI so programmers could use a single
#INCLUDE
at the top of the
program rather than having to dig through the old programs and find the appropriate code to cut and
paste.
1.
FUNCTION CHAR[17] DEV_TO_STRING (DEV dvDEV)
Formatting NetLinx device structures as strings take a little more than the simple
ITOA(<device>)
that was done in Axcess.
This function takes a
DEV
and returns a string in the '
<number>:<port>:<system>
' format.
2.
FUNCTION CHAR[25] DEVCHAN_TO_STRING (DEVCHAN dcDC)
This function returns a
DEVCHAN
as a string with brackets in the format
'
[<number>:<port>:<system>,<chan>]
'.
3.
FUNCTION CHAR[25] DEV_CHAN_TO_STRING (DEV dvDEV, INTEGER nChannel)
Same as
DEVCHAN_TO_STRING
but takes a separate
DEV
and
INTEGER
as parameters.
Returns '
[<number>:<port>:<system>,<chan>]
'.
4.
FUNCTION CHAR[25] DEVLEV_TO_STRING (DEVLEV dlDL)
This function returns a
DEVLEV
as a string in the format
'
<number>:<port>:<system>,<lev>
'.
5.
FUNCTION CHAR[25] DEV_LEV_TO_STRING (DEV dvDEV, INTEGER nLevel)
Same as
DEVLEV_TO_STRING
but takes a separate
DEV
and
INTEGER
as parameters.
Returns '
<number>:<port>:<system>,<lev>
'.
6.
FUNCTION CHAR[17] DPS_TO_STRING (DEV dvDEV)
This function takes a
DEV
and returns a string in the '
<number>:<port>:<system>
' format.
Same as
DEV_TO_STRING
except it always returns the actual system number, not system 0, if
the device is so defined.
7.
CALL 'SEND 131 BYTE PACKETS TO MASTER' (sSTRING[])
Strings sent to the master will be truncated if they are longer than 131 bytes. This call breaks
the strings up if they are longer than 131 bytes. Otherwise, it does not modify the string.
Use with master v2.10.81 or higher "
MSG ON 2
" mode to see only the data in the
sSTRING
.
8.
CALL 'SEND 7BIT ASCII TO DEBUG' (dvDEBUG,STR1[],STR2[],nLine,nMode)
This call is similar to '
SEND ASCII TO MASTER
' but with a little more flexibility:
dvDEBUG
is
the destination device for the string. It could be the local master, a virtual device on the local
system (see
TN435
), an IP device, serial device, etc.…
Содержание NETLINX STUDIO V2.4
Страница 1: ...instruction manual Software NetLinx Studio v2 4 or higher ...
Страница 16: ...NetLinx Studio v2 4 or higher 4 NetLinx Studio v2 4 or higher ...
Страница 32: ...The NetLinx Studio v2 4 Work Area 20 NetLinx Studio v2 4 or higher ...
Страница 44: ...Working With Workspace Files 32 NetLinx Studio v2 4 or higher ...
Страница 88: ...Working With Systems and System Files 76 NetLinx Studio v2 4 or higher ...
Страница 118: ...Programming 106 NetLinx Studio v2 4 or higher ...
Страница 152: ...Working With Online Devices 140 NetLinx Studio v2 4 or higher ...
Страница 199: ...Index 187 NetLinx Studio v2 4 or higher ...