txt1.LinkMode = 2
'Set up link as manual; open up link
Hello Menier,
Your app clearly requires an Auto mode, not Manual mode as shown above.
Herewith an excerpt from one of my DDE programs:
lblPeekIntegerData.LinkTopic = "RSLinx|ROBOT" 'Assign DDE application|topic to DDE label
lblPeekIntegerData.LinkItem = "N11:0,L20,C20" 'Assign DDE link item to DDE label (L20 = Length of 20, C20 = Format the data to go in 20 Columns via Tabs)
lblPeekIntegerData.LinkMode = 1 'Open DDE link (auto)
lblPeekIntegerData.LinkRequest 'Request data from RSLinx
Do not close the DDE link, let it run.
There are issues with DDE in Auto mode. If you switch power Off and On to the PLC and not to the PC you may find that DDE is hanging up. This will then require a re-start of the VB application. The way around this is not easy.
I solved it by using VB.NET and OPC.
There maybe an easier way to cope with this issue. If anyone has a solution I would like to hear it.
By the way I love Cape Town I used to live there (Gardens area).