cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

motion: time for datalayer call to finish

motion: time for datalayer call to finish

Anonymous
Not applicable

Hello, 
I have questions about the timing of motion commands. When calling a command on the datalayer(eg. switching the operation state from configuration to running) the result is not instead. When I call the command with a createSync on the datalayer I expect the command to return the result when it finished. But when I check the state on the datalayer by reading the operation state with a readSync the operation state may haven't changed. So my questions:

  1. Is command finished after I call it with a Sync call on the datalayer?
  2. If yes, how long does it take until the state is refreshed?
  3. If no, how long can it take until the command is finished after we called it on the datalayer?
3 REPLIES 3

CodeShepherd
Community Moderator
Community Moderator

The write and read sync function will always return as soon as the writing/reading process has been finished.

If you write a command to the motion the kernel will start working on it after command is present (and write command has finished). How long it will last cannot exactly be foreseen because it depends on several topics (like usage of real axes).

The state will be refreshed as soon as the system reached it.

Anonymous
Not applicable

Thank you for your reply. My question is not fully clear yet. Is a sync call on the datalayer synchronous for the command that is called?

I will give a example, to switch the power of an axis. The sync switch power command of the axis is called. We get a DL_OK back from the datalayer. What is completed with this return:

  1. Is the bool for switching the power written into the datalayer - Yes
  2. Has the motion kernel started working on in -Yes
  3. Has the motion kernel finished the task?
  4. Is the new state written into the datalayer? 

My problem is that I can only check a finished execution with a state on the datalayer changing when the power has changed. I tested it and the state changes with a delay of the command which in my eyes is not fully sync when you say: 


@CodeShepherd wrote:

The state will be refreshed as soon as the system reached it.


The reason for this question is, that in time critical applications it is important to know if I have to wait for the state in the datalayer to change or if a successful datalayer writesync guarantees the successful execution.

A sync call is synchronous to the command execution called. So it waits until the kernel has accepted the command then returns a command ID that can be watched for state done. This is the standard case to be able to more things simultaneously.

So for your example:

  1. Is the bool for switching the power written into the datalayer - Yes
  2. Has the motion kernel started working on in it? -> check command ID
  3. Has the motion kernel finished the task? -> check command ID
  4. Is the new state written into the datalayer? -> check status

To my statement:
Executed command and changed state are two different things. When setting e.g. switch power to an axis the kernel is working on it and the readable state will change as soon as it is reached in the state machine. So you trigger the mechanism to change something and have to wait for it to be done.

So for your question:
A successful datalayer writesync guarantees only that command is accepted/denied by the kernel.
You have to wait for the state in the datalayer to change.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist