Program ZClient ; { Example client script that calls the LepZAxis script via DDE } { The LepZAxis script can be used on its own as a manual z-axis controller but, if required, other scripts can control the motor simply by calling its shared procedures. } { This VPascal program calls shared stepping procedures defined in the LepZAxis script. A DDE conversation is used to make the connection to the motor control script. The DDE server is V for Windows itself and the topic is "Proc" which is where shared procedures are available. } var Ch,i ; begin { Start a DDE conversation with the built-in server } Ch := DdeInitiate( 'VWin','Proc' ) ; if Ch = 0 then halt( 'Could not connect' ) ; { Home the z-axis controller } DdeExecute( Ch,'GotoHomePos' ) ; DdeExecute( Ch,'WaitWhileBusy' ) ; { Execute 5 forward steps at 1 second intervals } for i := 1 to 5 do begin DdeExecute( Ch,'StepFwdFine' ) ; delay( 1000 ) ; end; { End the conversation } DdeTerminate( Ch ) ; end