MonitorAcc command in ADL

I'm having trouble with the ADL examples in the ADL reference for accessories.

The help file gives the syntax for MonitorAcc as 

Function MonitorAcc(Dev1 As Integer, Dev2 As Integer, Dev3 As Integer, Dev4 As Integer, TimeVal As Integer) As Boolean

but the example uses MonitorAcc(0,400), which produces an error unless you use 5 integers as the syntax describes. However, every combination of 5 integers that I tried returned a False. What is the correct way to use this command and to read what was saved in the database?


I'm using WinUV with a Cary60.



  • Hello:


       If I read the request correctly, you want to retrieve stored information from the database. I would probably use the GetVal command to read what is located in the database node of interest. The syntax for the command is :



    This will return the value, either numerical or string, and assign it to Node_value. A real example would be :

                                 Dim Start_Wave as single

                                 Start_Wave=GetVal(“Scan Start”)


    This returns the starting wavelength of the scan.


    What is it that you are wanting to get from the database? I believe the MonitorAcc command is to look at the status of certain accessories and may not be the command you want.





  • Hi Mike,

    We have a custom device that connects to where the slide stepper motor normally connects. When we move it, it sometimes takes 30 seconds to finish moving. My hope was to query the accessory board in real-time to get the actual position as it moves. I thought that MeasureAcc or MonitorAcc might do it, but if memory is correct, MeasureAcc returns the database value (which is where it is moving to, not where it is), despite the help file saying that it reads the accessory controller directly.


    The help file says defines MonitorAcc:

    Accessory Commands

    DefinitionThis command allows you to automatically update the database periodically from the accessory controller.

    so I thought I might be able to update the database in real-time using MonitorAcc and MeasureAcc to get the values out in real-time.


    The help file defines MeasureAcc:

    Accessory Commands

    DefinitionThe MeasureAcc function reads the value of an accessory. This differs from GetAcc as this actually requests a new reading from the device, whereas Getacc will just return the last requested value.


    That is my goal, but the focus of my original question is "What is the correct syntax of the MonitorAcc command?" because the examples in the help file give a syntax error.




  • Sorry about the delay in responding.   I think it would be best to contact your local Agilent office for support on the ADL questions. 

Was this helpful?