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

about programming

about programming

Chirag03
Established Member

Hello everyone,

here i have attached XMl file of my program file, prevously i have used case for programming to move next case. but i am not able to jump to next case instead of signal toggle between true and false after completing first case. 

basically i have made program for 10 point for continous cycle but it only works for perticular 10 point if i only add 5 points instead of 10 then this is not working, therefore i have used case but as i mentioned above case is also not working for random points between 1 to 10. if there any alternative to perform perticular task.

 

 

3 REPLIES 3

AndreasL
Long-established Member

It's quite hard to figure out what you're trying to do. 

But I cant find any assignment to the case, for instance point[3]

I usually write sequences in ST like this

CASE Point[3] OF
    1:
        MoveLinearAbsolute[3](ExecuteCmd:= TRUE, ...);

        IF MoveLinearAbsolute[3].Done THEN
            MoveLinearAbsolute[3](ExecuteCmd:= FALSE, ...);

            //  Move to the next state
            Point[3]:= 2;
        END_IF;
END_CASE

But a tip is to use named enumerations for the case, makes it much easer to debug:

https://alltwincat.com/2021/11/16/local-enumerations/

 

Chirag03
Established Member

Thank you for your Email.

It is robot programming for 10 position which you see in attached XML file and it is completly working continue in cycle. I want to run this program from HMI . There is 10 position pre fix right now and now i want to run 5 or 4 or 3 position instead of  10  position from HMI So according to that, which type of changes i have to do programming.

For me the key question is which data is given by the HMI and so the customer?

  • If you always have the table of 10 points but not all are filled:
    You just want to run trough used points simply use an if in your case structure to jump to the next one if no point is given.
  • If you always have the table of 10 points all are filled:
    You want to limit the number of used points, you have to give some variables like starting number and end number or a list of number that should be run through and then use them to jump to the wanted steps.
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