Write a block
The following program reads five user-inputted numbers located in five text boxes (named
txtBlock1-txtBlock5
). The necessary DDE string is then constructed, stored in the text property of a text box with the name of txtPokebox
, and sent to RSLinx Classic. This program is performed once the Command1
button (Write Block) is clicked.Sub Command1_Click ()
tab1 = Chr$(9) | 'Define tab1 as TAB (ANSI code for TAB = 9) |
The following line strings the data together with a Tab separating the numbers
txtPokebox.Text = txtBlock1.Text & tab1 & txtBlock2.Text & tab1 & txtBlock3.Text & tab1 & txtBlock4.Text & tab1 & txtBlock5.Text
txtPokebox.LinkTopic = "RSLinx|testsol" | 'Define DDE application and Topic |
txtPokebox.LinkItem = "N7:0,L5" | 'Define DDE link item |
txtPokebox.LinkMode = 2 | 'Open DDE link (manual) |
txtPokebox.LinkPoke | 'Write data to RSLinx |
txtPokebox.LinkMode = 0 | 'Close DDE link |
End Sub
Provide Feedback