Topic: DMD0061

DEVCLEAR - Clear Device


The Clear Device (DEVCLEAR) instruction is used to perform a reset on the designated device. The individual actions that are done to perform a reset on a device are defined by the device itself.

 

The red triangle in the upper left corner indicates this is a Fully Asynchronous instruction.

 

Parameters:

Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.

 

Device - designates which of the configured Devices, or which Device Reference to close.

 

No devices available - indicates there is no device that is appropriate for this instruction. Select one of the following to create the required device:
 

 

If the Device is the Onboard Serial port or a port on a SERIO module, the following operations are performed:

  • any data in the Input Queue is deleted

  • any data in the Output Queue is deleted

  • the Serial Status register is cleared

  • the Serial Control register is cleared

 

If the Device is a UDP Connection, a TCP Client Connection, or a TCP Server Connection the following operations are performed:

  • any data in the Input Queue is deleted

  • any data in the Output Queue is deleted

  • the Packet Available flag is reset

 


On Success: - designates one of the following two options if the Clear Device operation is successful:

 

  • SET BIT - The specific BIT location will be SET OFF when the Clear Device instruction is first enabled, and then SET ON if the operation is successful. This value can be any writable bit location.
     

  • JMP to Stage - JMP to the specified Stage. The target Stage must be in the same Program as the Clear Device instruction, you cannot specify a Stage in a different Program. This selection will function the same as a standalone Jump to Stage instruction. Click here for more information on the Jump To Stage instruction.

 

On Error: - designates one of the following two options if the Clear Device operation is unsuccessful:
 

  • SET BIT - The specific BIT location will be SET OFF when the Clear Device instruction is first enabled, and then SET ON if the operation is unsuccessful. This value can be any writable bit location.

  • JMP to Stage - JMP to the specified Stage. The target Stage must be in the same Program as the Clear Device instruction, you cannot specify a Stage in a different Program. This selection will function the same as a standalone Jump to Stage instruction. Click here for more information on the Jump To Stage instruction.

 


See Also:

 


Related Topics:

 


Rung Example: