Read a block
The following program reads a block of timer values from
N7:0 through N7:4
once the Read Block
button (Command1) is pressed. The block of data is read into the text property of a text box with the name of txtBlock
. If you want to take the Tab characters out of the text box, set the text box MultiLine
property to True
.Sub Command1_Click ()
txtBlock.LinkTopic = "RSLinx|testsol" | 'Assign DDE application|topic to DDE text box |
txtBlock.LinkItem = "N7:0,L5,C5" | 'Assign DDE link item to DDE text box (L5 = Length of 5, C5 = 'Format the data to go in 5 Columns via Tabs) |
txtBlock.LinkMode = 2 | 'Open DDE link (manual) |
txtBlock.LinkRequest | 'Request data from RSLinx |
txtBlock.LinkMode = 0 | 'Close DDE link |
End Sub |
Provide Feedback