Execute HART Commands Through Producer/Consumer Data
These are some guidelines to execute HART commands through Producer/Consumer Data.
- A command execution starts with a rising edge of Command.Execute in the consumer data.
- Command.ReadyToExecutein the producer data is reported as 1 for a HART device when the HART device has no outstanding commands that are initiated from the consumer data and Command.Execute is 0 in the latest received consumer data.
- SetCommand.Executeto 1 only whenCommand.ReadyToExecuteis 1.
- After initiating a command execution, set it back to 0 onceCommand.ReadyToExecuteof 0 in producer data is received.Command.ReadyToExecutetransitioning from 1 to 0 indicates that the HART module has received the command execution request.
- After a command is complete, check the status of all producer data in theCommandtag before retrieving the response data of the command.
A Typical Command Execution Sequence
- To execute a HART command, set Command.Execute to 1 in the consumer data whenCommand.ReadyToExecute= 1 in the producer data of the HART device.
- After the HART module receives the consumer data,Command.Active= 1 andCommand.ReadyToExecute= 0 are reported in the producer data of the HART device.
- Once the controller receivesCommand.ReadyToExecute= 0, which means that the module has received the execution request, you can setCommand.Executeto 0 in the consumer data.
- When the HART command execution is complete, the HART module reportsCommand.Completed= 1 andCommand.ReadyToExecute= 1 in the producer data of the HART device together with the command result and response data.
- To initiate another command execution, repeat steps 1 to 4.
Command Completed within an RPI
- To execute a HART command, setCommand.Executeto 1 in the consumer data whenCommand.ReadyToExecute= 1 in the producer data of the HART device.
- After the HART module receives the consumer data, the HART command is completed within an RPI. HenceCommand.Completed= 1 andCommand.ReadyToExecute= 0 are reported in the next producer data of the HART device. An active state is not reported for the command.
- Once the controller receivesCommand.ReadyToExecute= 0, setCommand.Executeto 0 in the consumer data.
- When the HART module receives the consumer data, the next producer data of the HART device reportsCommand.ReadyToExecute= 1.
- To initiate another command execution, repeat steps 1 to 4.
Command with a Parameter Error
- To execute a HART command, set Command.Execute to 1 in the consumer data whenCommand.ReadyToExecute= 1 in the producer data of the HART device.
- After the HART module receives the consumer data, it verifies the request data and finds some parameters (for example, invalid characters for Packed ASCII or string length longer than configured) that cannot be converted to HART type successfully. The HART module reportsCommand.Active= 0,<nameofcommand>.Command.ReadyToExecute= 0,Command.Complete= 0, andCommand.ParameterError= 1 in the producer data of the HART device.
- When the module receivesCommand.ReadyToExecute= 0, setCommand.Executeto 0 in the consumer data. WithParameterErrorbit set, the execution is rejected due to errors in the command request data.Command.ParameterErrorNumberin the producer data indicates the index of the first invalid parameter in the command request data.
- Once the controller receivesCommand.ReadyToExecute= 0, setCommand.Executeto 1 in the producer data of the HART device.
- Initiate a new execution by settingCommand.Executeto 1 in the consumer data.
- When the HART module receives the consumer data and finds that the command request data in the consumer data still has errors, it reportsCommand.ReadyToExecute= 0 andCommand.ParameterError= 1 in the producer data of the HART device again.
- Once the HART module receivesCommand.ReadyToExecute= 0, the module receives the latest execution request and you can setCommand.Executeto 0 in the consumer data. WithParameterErrorbit set, the latest execution request is rejected due to errors in the command request data.
- The HART module reportsCommand.ReadyToExecute= 1 in the producer data of the HART device.
- To start a new execution, setCommand.Executeto 1 in the consumer data.
- When the HART module receives the consumer data and verifies that the command request data are all valid, it sends the command to the HART device and reportsCommand.ReadyToExecute= 0,Command.Active= 1, andCommand.ParameterError= 0 in the producer data of the HART device.
Command Overlap
- SetCommand.Executeto 1 in the consumer data whenCommand.ReadyToExecute= 1 in the producer data of the HART device.
- After the HART module receives the consumer data,Command.Active= 1 andCommand.ReadyToExecute= 0 are reported in producer data of the HART device.
- Once the controller receivesCommand.ReadyToExecute= 0, the module receives the execution request and you can setCommand.Executeto 0 in the consumer data.
- Without waiting for the outstanding command to complete, setCommand.Executeto 1 in the consumer data again.
- The HART module reportsCommand.Overlap= 1 in the producer data of the HART device.
- SetCommand.Executeto 0 in the consumer data.
- IfCommand.Executeis set to 0 in Step 6, after HART command execution is complete, the HART module reportsCommand.Completed= 1 andCommand.ReadyToExecute= 1 in the producer data of the HART device together with the command result and response data.
- To initiate another command execution, repeat steps 1 to 7.Command.Overlapis only cleared when a new command execution is started successfully.
Provide Feedback