Location5 (debug message printing)
- Last UpdatedFeb 14, 2023
- 3 minute read
The Location5 attribute causes the interface to print debugging messages. For normal operations, Location5 should be zero (no debug printing). However, during a first time installation of TCPResponse or the investigation of anomalous behavior, the user may wish to set Location5 to a non-zero value. See Troubleshooting common problems for details.
A non-zero value in a point's Location5 point attribute tells the interface to print debugging messages to the message log. The interface automatically incorporates point attribute changes. Therefore, you do not have to stop and restart the interface to enable/disable these debugging messages. However, you may have to wait up to two minutes for point changes to take effect.
|
Location5 |
Meaning |
|---|---|
|
0 |
No debugging |
|
1 |
Messages regarding point loading |
|
2 |
Messages regarding network communications |
|
3 |
Messages regarding code execution |
|
4 |
Show response from server |
The effects of the value of Location5 are cumulative. That is, a debug value of 2 causes the interface also to take actions associated with a debug value of 1. The examples below use a test point named tcpresptest .
Location5 set to 1
A Location5 value of 1 results in debugging messages relating to whether the interface has loaded or rejected the point. For example:
PI TCPResponse 1> pt (tcpresptest) LOADED
PI TCPResponse 1> pt (tcpresptest) REFUSED; cannot find "DEVICE=" in InstrumentTag
Location5 set to 2
Set to Location5 a value of 2 to debug Bad Input or I/O Timeout values. The interface prints the message it receives from the underlying TCP/IP software. For example:
PI TCPResponse 1> pt (tcpresptest) connect() failed for 192.168.100.172:3389; err:10061 Connection Refused; is the device listening on the specified port?
Location5 set to 3
In general, if values for a point are unexpected, set the point's Location5 attribute to 3 and examine the message log. Afterwards, set Location5 back to 0 to prevent unwanted continuation of debugging messages. A value of 3 in Location5 causes the interface to print out messages as it executes various portions of the program code. For example, for a point configured for the measurement of HTTP server response times:
PI TCPResponse 1> pt (tcpresptest) connect() to 192.168.210.40:80 good; sending HTTP msg
The above message indicates the interface successfully connected to port 80 of the machine with IP address 192.168.210.40. The interface next sent HTTP messages like:
PI TCPResponse 1> pt (tcpresptest) aMsg.rval is 160.00
PI TCPResponse 1> pt (tcpresptest) aMsg sent to queue
The above messages indicate the interface has stored the value of 160.0 into its internal queue. Additional messages might be sent:
PI TCPResponse 1> pt (tcpresptest), found matching message in queue
PI TCPResponse 1> pt (tcpresptest), drval=160.00 returned to UniInt
The above messages indicate the interface has processed the value of 160.0 from its internal queue and returned this value to the UniInt template. Thus, the point's value should be 160.0. If the message does not appear, then the response time you are trying to measure is too long, and a timeout occurred.
Location5 set to 4
A value of 4 in Location5 causes the interface to show the reply message that it received from the server. For example:
>0000 32 32 30 20 63 6f 76 61 64 2e 6e 65 74 20 45 53 220 cova d.net ES
> 0010 4d 54 50 0d 0a MTP..
Setting Location5 to 4 is useful for determining user-specified replies (that is, REPLY= in the InstrumentTag ). As such, this debug setting is valid only for the following Location2 values:
|
Location2 |
Applicable keywords in InstrumentTag |
|---|---|
|
2 (FTP) |
DEVICE= (required); PORT= (optional); REPLY= (optional); |
|
3 (HTTP) |
DEVICE= (required); PORT= (optional); REPLY= (optional); |
|
4 (SMTP) |
DEVICE= (required); PORT= (optional); REPLY= (optional); |
|
7 (POP3) |
DEVICE= (required); PORT= (optional); REPLY= (optional); |
|
8 (IMAP) |
DEVICE= (required); PORT= (optional); REPLY= (optional); |