RobotStudio event

EGMStreamStart \SampleRate argument has no effect

edited March 2021 in RAPID Programming
I use EGM Position Stream to obtain real-time robot pose information. I initialize it as follows:

EGMGetId egm_id_position_stream_0;
EGMSetupUC ROB_1, egm_id_position_stream_0, "default", "EddieEgm0", \Joint;
EGMStreamStart egm_id_position_stream_0, \SampleRate:=16;

The EGM manual says:
Data type: num
Input data reading sample rate in multiples of 4 milliseconds. Valid values are 4,
8, 12, 16, etc.

Despite I specify \SampleRate:=16, the robot sends EGM data at 250Hz (i.e. at 4ms interval instead of 16ms). It happens for both RobotStudio and the real robot.

RobotWare version:

Why is this and how to fix it?


  • Does the same problem occur with EGMActJoint or EGMActPose? 
  • @xerim I don't know, didn't try.
  • Not sure if this is the fix for your problem, but I did notice a discrepancy between the code you shared in your first post and the example code in the Application Manual for Externally Guided Motion.

    the egmID is declared after the \SampleRate argument for the EGMStreamStart command 
  • @xerim this does not look like a correct syntax:

    (and if I remove the comma I get an extra syntax error).