SetContentsFilter

<< Click to Display Table of Contents >>

Navigation:  Reference (Scripting) > Docklight Script Commands - The DL Object > Methods (Advanced) >

SetContentsFilter

Use a different Contents Filter setting than the one defined in the Project Settings - Communication Filter dialog.

 

Return Value

 

Void

 

Syntax

 

DL.SetContentsFilter newContentsFilter

 

The SetContentsFilter method syntax has these parts:

 

Part

Description

newContentsFilter

Required. Integer value to select the new filter:

0 = Show all original communication data (channel 1 and channel 2)

1 = Show channel 1 or [TX] data only

2 = Show channel 2 or [RX] data only

3 = Hide all original serial data, show additional comments only

 

Remarks

 

After the script execution has ended, the Contents Filter is set to the original project setting defined in Project Settings - Communication Filter.

 

Example

 

' Requires the Docklight basic example project "PingPong" and a loopback on the chosen

' communication channel

DL.OpenProject "PingPong"

DL.ClearCommWindows

DL.SendSequence "Ping"

DL.Pause 50

DL.AddComment vbCrLf + "SetContentsFilter(1) " : DL.SetContentsFilter(1)

DL.Pause 50

DL.AddComment vbCrLf + "SetContentsFilter(2) " : DL.SetContentsFilter(2)

DL.Pause 50

DL.AddComment vbCrLf + "SetContentsFilter(3) " : DL.SetContentsFilter(3)

DL.Pause 50

 

After running the script, the Docklight communication window could look like this:

 

7/30/2012 17:42:31.322 [TX] - 2D 2D 2D 2D 6F 20 50 69 6E 67

7/30/2012 17:42:31.326 [RX] - 2D 2D 2D 2D 6F 20 50 69 6E 67 "Ping" received

7/30/2012 17:42:31.350 [TX] - 6F 2D 2D 2D 2D 20 50 6F 6E 67

7/30/2012 17:42:31.352 [RX] - 6F 2D 2D 2D 2D 20 50 6F 6E 67 "Pong" received

7/30/2012 17:42:31.499 [TX] - 2D 2D 2D 2D 6F 20 50 69 6E 67

SetContentsFilter(1)

"Ping" received

7/30/2012 17:42:31.523 [TX] - 6F 2D 2D 2D 2D 20 50 6F 6E 67 "Pong" received

7/30/2012 17:42:31.547 [TX] - 2D 2D 2D 2D 6F 20 50 69 6E 67 "Ping" received

7/30/2012 17:42:31.572 [TX] - 6F 2D 2D 2D 2D 20 50 6F 6E 67 "Pong" received

7/30/2012 17:42:31.594 [TX] - 2D 2D 2D 2D 6F 20 50 69 6E 67 "Ping" received

7/30/2012 17:42:31.619 [TX] - 6F 2D 2D 2D 2D 20 50 6F 6E 67

SetContentsFilter(2)

 

7/30/2012 17:42:31.621 [RX] - 6F 2D 2D 2D 2D 20 50 6F 6E 67 "Pong" received 2D 2D 2D 2D 6F 20 50 69 6E 67 "Ping" received 6F 2D 2D 2D 2D 20 50 6F 6E 67 "Pong" received 2D 2D 2D 2D 6F 20 50 69 6E 67 "Ping" received 6F 2D 2D 2D 2D 20 50 6F 6E 67 "Pong" received  

SetContentsFilter(3)

"Ping" received  "Pong" received  "Ping" received  "Pong" received  "Ping" received  "Pong" received