Dear Community User! We are updating our platform to a new system.
Read more: Important information on the platform change.

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

how to debug and set schedule by sdk

how to debug and set schedule by sdk

WEI_You
Established Member

I am a new user to build app by SDK,in my code,I register a callablefactory(myfactory) to scheduler, and then I can chose the callablefactory when the snap installed in my ctrlX CORE ,it work fine

WEI_You_0-1666948446232.png

but now I want konw whether I can debug the function of my callable,because,the cycle function writen by 

the function[common::scheduler::SchedEventResponse myCallable::execute()]
I set the breakpoint,and start debuging ,framework start,but I cannot hit the breakpoint which set in mycallable.cpp,if the breakpoint set in active.cpp,it can be hit
WEI_You_1-1666948807518.png

so,I need install app again everytime when I change the callable function now,how can I debug in my app build environments,not in device.it can help me to test function code and convenient to develop the app by SDK

5 REPLIES 5

nickH
Community Moderator
Community Moderator

Hello, 

it is possible to debug in the build environment. What you are likely missing in your project is a scheduler configuration, which includes the bundle you are creating in your code. That's why your callable did not get created and the execute method didn't get triggered. 

Just take a look at the samples we provide (for example automation.scheduler). There is the folder "solutions/activeConfiguration/scheduler". In this folder you have a scheduler configuration. You could use a similar configuration for your bundle, but you would have to change the name of the callable in the programs.json (from HelloCallableFactory to your Callable name).

Best regards, 

Nick

 

WEI_You
Established Member

hello nick:

thank you for the answer,but I have not debug success after change by the example

2022-11-03_15h21_32.png

 first I change the callablefactory name of scheduler sample,

2022-11-03_15h22_43.png

 second,I change the name of callable in programs.json(solutions/activeConfiguration/scheduler)and I also add a task like the sample

2022-11-03_15h26_27.png

2022-11-03_15h25_26.png

 then I bulid and run build task ,inatall the app again,but the scheduler cannot automatic add task or add callable in the task(ctrlXAutomation which already exist) I can found my callable normally ,I need add it by myself.

finally ,I start debugging "Framework x64"

2022-11-03_15h28_17.png
you can see the breakpoint which I already set in the execute method before build task,and framework work good,but I don't know how to hit the breakpoint in vscode debugging

nickH
Community Moderator
Community Moderator

I think you are mixing to things here. There are two ways to test your bundle. 

  1. You can install the snap on a real or on a virtual ctrlX CORE. Here you would set the scheduler configuration manually in the webinterface and add your callable. Here you can take a look at the trace logs in the logbook and check if your callable works like you would expect. But you can't hit any breakpoints here.
  2. You can debug your bundle inside your build environment. For this type of debugging you don't need a ctrlX CORE or ctrlX CORE virtual! Here you don't have a webinterface for the scheduler. To add a configuration here you would need to insert a configuration for the scheduler like you will find in our samples (solutions/activeConfiguration/scheduler).
    Hint: This is the same kind of configuration you can also find in the app data of a ctrlX CORE. So you could also download the app data of a ctrlX CORE when you did the debugging type 1 and bring it to the build environment for the type 2. 

WEI_You
Established Member

ok!!! it is a best news of the way 2 in this month(For this type of debugging you don't need a ctrlX CORE or ctrlX CORE virtual!)

 I very very want know the way how to hit the breakpoint which in the exectue method.or tell me "it can't achive, you can't hit the breakpoint in  " the type 2 just like the a virtual ctrlX CORE without the webinterface? the understand is right? so I cannot test the method in my bundle inside?Can't be tested individually, only as a whole bundle?

actually,what I want to know is how to debug the method which provide by other serve(like scheduler ,motion), I build my app by SDK,so it is convenient to us if I can debug in vscode(my build environment),please tell me the detail or  some document .

the bad result I think is I need install again and again to test my function.it is the worst news for my team.it means I cannot do the code testing!!!

nickH
Community Moderator
Community Moderator

This type (2) of debugging is already implemented in the RT-SDK! And this was part of your Advanced SDK Training. (I assume you participated in the training, because this is the only way to get the RT-SDK).

You just build the example (e.g. automation.scheduler) and start the debugging. You can see this in the video attached. Of course breakpoints are hit here.

I would guess, that something in your scheduler configuration is not right. And thats why your callable does not get created. Please take a look at the scheduler configuration we provide in the samples or create a scheduler config on a ctrlX CORE (like I mentioned in the post above). 

One additional information: Its not possible to debug samples which use the motion app via this way, because the motion-bundles are at the moment not included in the build-environment.

 

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