Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 16 Serial and Ethernet Communications

16.5 Monitoring and Debugging Communications

Scroll Prev Top Next More

To help you check your communications or debug communications problems, there are two different types of monitor windows.  Both are similar, but one is an auto-hiding docking control bar similar to the workspace and command / alert, while the other is what is called a modeless window and remains on top DAQFactory whilst letting you manipulate the rest of DAQFactory.  In general, you will probably want to use the docking window, activated through the View section of DAQFactory's main menu.  You can quickly jump to this window by pressing Ctrl-F2.  Once displayed, you can select a communications port from those you created by right clicking in the window and selecting the port.  Until you select a port, this window won't do anything.  If you want to stop monitoring after selecting a port, you can select None.  Since monitoring takes a little CPU power, this will also make DAQFactory run slightly faster.   Once a port is selected, you should see traffic, if there is any in the larger area at the bottom, and you can output a string as described below in the edit box at the top of the window and pressing Enter.

The only disadvantage of the docking window is that it will only display one communications port at a time.  Each port also has a monitor window.  To view the port's monitor window, simply open the configuration window for the comm device using the port and click on the Monitor button.  This will bring up the monitor window.  If you have already created channels to trigger the polling of your device, or your device simply streams data, you should see the communications in the main window.  If not, you probably will need to send some data to your device to trigger a response.  You can simply enter your output string at the top of the monitor window and hit send.  Note that you do not need to put quotes around your string.  You can also enter binary data here by preceding the ASCII code for the desired binary value with a backslash.  For example:

req\013\010

would output 5 characters, r, e, q, and a carriage return, line feed.  You can use \x notation to use hex values instead.  Here is the same in hex notation:

req\x0d\x0a

Note that you have to specify three characters after the slash, so req\xd\xa is invalid.  The exception are these control characters:

\n : new line character, a line feed, ASCII 10

\r : return character, a carriage return, ASCII 13

\t : tab character, ASCII 9

\\ : a backslash

so, req\013\010 is the same as req\r\n

Also note that a carriage return or line feed is not automatically outputted, so you must add it your self like the examples above if needed.  The reason DAQFactory does not automatically add a carriage return or linefeed is that most binary protocols do not use these characters as delimiters.

The main window displays the data going in and out of the port.  Data going out is preceded with Tx:, while incoming data is preceded with Rx: and displayed in a different color.  By default, the data is displayed as characters when they are displayable characters, and in the \ notation when they are binary characters.  You can force the display to always be in \ notation using the Display all chars as ASCII codes checkbox.  The Display codes in Hex will force \x notation.  If your data is all ASCII readable characters, you will probably also want to check the New Line on CR or LF.  This will cause the monitor to move to a new line whenever it sees a carriage return (ASCII 13) or LF (ASCII 10), or a CR/LF pair, making it much more readable.

Since data often comes very quickly, you can click the Pause button to stop the update of the monitor window.  Clicking the button again will resume the update.

Finally, the comm port monitor window is a modeless window.  This means that while it is displayed you can still manipulate the rest of DAQFactory.  So you can display the monitor window, and then while leaving it open, close your device configuration window and use DAQFactory while being able to monitor the details of the communication.  Its much more convenient to use the docking Comm Monitor window instead of the port's monitor window, but if you need to monitor more than one port at once, you should use the port's modeless window.