SCOPE command and Motion Perfect

Motion Perfect problem when SCOPE command is used

When running the SCOPE command in a program, I think Motion Perfect doesn't like the SCOPE command being issued over and over when I run it. It seems more stable when I comment the SCOPE command out after it's ran once.
====================================================================================
Although SCOPE command is part of the Trio BASIC language and you are free to use it in your programs you should NOT do that when using oscilloscope tool in Motion Perfect.

The problem is that oscilloscope tool itself executes SCOPE command as part of its initialization when you press Trigger button and when it does so it uses its own settings and pre-configured channels.

So what effectively happens is that you first start the scope tool which applies its configuration.

Then you run your program which applies different settings and misconfigures the capture on the controller.

Finally the program executes TRIGGER command which instructs the controller to start collecting data.

In your particular case the SCOPE command in your program instructs the controller to capture data in TABLE range from 1000 to 1500 which is 500 samples.

The scope itself by default is configured and expects to capture only 20 samples x 10 divisions = 200 samples at the end of the TABLE range so at given point in time it gets confused and tries to read values beyond the end of TABLE.

That is where you get the error message in Motion Perfect.


In short if you want the start of data capture to be driven by your program you should put there only TRIGGER command but not SCOPE command.
    • Related Articles

    • Gathering analog input data using Flexslice Ain Module

      A Visual Studio program connecting over Ethernet will not be deterministic. So there will be timing errors. The built-in SCOPE command can be used to log data. It will save data to TABLE at the servo cycle rate. So if SERVO_PERIOD is 1000 usec, then ...
    • Trouble with table

      In the MC2xx range of Motion Coordinators, the TABLE is dynamic and the memory shared with the programs. When you first use it, there is no table. TABLE is allocated when it is written tot. You can see the size with TSIZE parameter. If a program ...
    • Reading blocks of data from TrioPC Motion ActiveX or DLL

      The ActiveX and DLL have a way to read blocks of data. The method is called PRMBLK. If you look at he help, it shows you the list. You need to define the type of block you want to read, for example DefineSystem would be used to read system values ...
    • Few questions regarding Motion Perfect

      If you want to do the same as the Motion Stop button in Motion Perfect then this is the command list done by Motion Stop: RAPIDSTOP(2) HALT WDOG=0 That stops all axes, stops all programs and disables the drives.
    • Will processes change with Motion Perfect 5?

      Process numbering is controlled entirely by the firmware so nothing should change when you update Motion Perfect.  For example, process numbers for MC405 are 0 to 9.