Yes, HART commands can be sent to a HART device via htest, which is a customized CINT interpreter. It is a convenient and useful way to make sure that your hardware components are functional and connected properly, and you are able to communicate with the device successfully. This is a powerful tool installed on the HART Test System and allows you to check the response of the HART device to various HART commands before you start running full fledged tests. 


To send a command from the HART Test System to your device, connect a registered RS-232 HART modem between the serial port designated for the HART Master and the device. Then follow these steps -


1. start htest.

2. identify the device from within htest.

3. build the desired command message.

4. send the command message to the device, receive the response and display the request and response bytes.



1. To start htest, open a terminal on the HART Test System, type "htest" (without quotes) on the command line and press <Enter>. This will start the interpreter which will allow single HART commands to be sent to the device when composed with the proper syntax. For more information about htest command syntax and the API functions available for use with htest, refer to PS20017 HTEST Application Manual under User Guides.


2. Once htest starts, you will see the htest prompt on the terminal as follows -

htest>

 

Identify the connected device via the ident_device() function from within htest as follows -

htest> {ident_device(0);}


Any value between 0-9 can be used for the queue number as an argument for ident_device(). The same queue value must be used for all other functions once it is used in ident_device(). The ident_device() function prints the polling address of the device by sending the short frame Command 0 to the device. No other HART command can be sent to the device via htest unless ident_device() is successful. An unsuccessful command returns '-1'.


3. To build a message to send a HART command, say, long frame Command 0, use the bld_msg() function as follows -

htest> {bld_msg(0, 0, 0, "");}


See PS20017 HTEST Application Manual under User Guides for meaning of the various parameters.


4. To send the command last built via the bld_msg() function,  and see the response received, use the send_recv_msg() function as follows -

htest> {send_recv_msg(0);}


This would display the command bytes sent to the device and the response bytes received (if any). Once the device is identified via step 2, steps 3 and 4 can be repeated any number of times for various commands. Step 2 does not need to be repeated if the modem connection has not been broken and htest session not ended.


To quit htest and return to the command line shell prompt on the terminal, type q on the htest prompt as follows -

htest> q


To see the FSK bus traffic while sending single commands, connect a registered RS-232 HART modem between the serial port designated for the HSniffer and the device. Then, open another terminal and type "hsniffer" (without quotes) on the command line and press <Enter>. This will open a new terminal window and start hsniffer in it. HSniffer displays the bus traffic during the execution of short Command 0, which cannot be seen in the htest terminal. That is an additional way to verify that data is going to the DUT in case ident_device() fails. The HSniffer window can be closed by typing <Ctrl-C> in it.


Please note that only one instance of the HART Master can be running on a Test System at a time.