Page 1 of 1

Communicating the Agilent ChemStation through VB6.0

Posted: Sat Jul 26, 2014 3:27 am
by nence
Hi,everyone here.Recently,i'm using Visual Basic program to communicate with Agilent ChemStation by Dynamic Data Exchange(DDE) method.Here is my code.

With text1
.linktopic="hp3118|CPNOWAIT"
.linkmode=2
.linkitem="REGSIZE(CHROMREG)"
.linkRequest
End Eith

With these code,text1 can not request the result of "REGSIZE(CHROMREG)" command.When linkItem was set to standard variable like "_DATAPATH$", results was showed in text1 successfully.How to fix my code, please help me out.Thanks.

Re: Communicating the Agilent ChemStation through VB6.0

Posted: Sun Jul 27, 2014 3:41 pm
by GasMan
It is some time since I used DDE with VB6 and ChemStation, but I seem to remember that DDE is handling strings. You may need to convert the number to text. The fact that it works with the datapath, which will be text, may explain it.

Gasman

Re: Communicating the Agilent ChemStation through VB6.0

Posted: Mon Jul 28, 2014 2:11 pm
by nence
It is some time since I used DDE with VB6 and ChemStation, but I seem to remember that DDE is handling strings. You may need to convert the number to text. The fact that it works with the datapath, which will be text, may explain it.

Gasman
Thank you for your response.
But unfortunately it does't work. I've set linkitem to another variable like "_ERROR",that is a numerical variable. And this code returns the correct numerical result. I've also tried 'val$' command to convert the number to text.It also does't work.
For simplicity, my objective is making some VB code to obtain the remote command results, like 'regsize(myreg)' , 'objhdrname$(myreg,1)', and more.
From Agilent's user guide ebook, i found something about 'Items with the CPWAIT and CPNOWAIT Topics'.They says 'You can specify any ChemStation command processor variable, command, or macro as an item'.But i don't know how to use it.