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 ...
    • 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.
    • 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 ...
    • Can I use Motion Perfect v4 with the new MC404-Z?

      The MC404-Z and other new products require the latest version of Motion Perfect to run them.  At the time of writing this post, the latest version is MPv5 version 5.0.2 and that is the recommended version for programming the MC404-Z 4 axis stepper ...
    • EURO 404 - Motion Problem at SERVO_PERIOD 250

      A motion problem could occur when running MC403, MC405, Euro404 or Euro408 at 250 usec servo period. The moves would stop (buffers frozen) and an uncommanded movment could occur on one axis in an XY pair. The issue occured very infrequently and was ...