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

How to Retain Axis Position limits Set by PLC Program

How to Retain Axis Position limits Set by PLC Program

DCEN_Tony
Established Member

Hello,

I am able to change axis postion limits OK via PLC using DL_WriteNode to path 'motion/axs/{axisname}/cfg/lim/pos-max' for example but after power cycle the change is lost.

How do I make the change permanent?

Many thanks

1 REPLY 1

CodeShepherd
Community Moderator
Community Moderator

Like when using the ctrlX CORE Web UI you need to execute a save after changing the values to persists them to the active configuration. Then it will be the same after power cycle.

Right now I only know the way of writing the corresponding flatbuffer:

Declaration:

PROGRAM PLC_PRG
VAR
	fb_comm_datalayer_PersistenceParam: comm_datalayer_PersistenceParam;
	fb_DL_CreateNodeValue: DL_CreateNodeValue;
	bExecute: BOOL;
	bDone: BOOL;
	bActive: BOOL;
	bError: BOOL;
	NodeValueOut: CXA_Datalayer.DL_NodeValue;
	NodeValueIn: CXA_Datalayer.DL_NodeValue;
	bWrite: BOOL;
	fbBuilder: flatbuffers.FlatBufferBuilder;
	udiPhase: UDINT;
	strPhase: STRING := 'save';
	udiConfigurationPath: UDINT;
	strEmpty: STRING := '';
	udiId: UDINT;
END_VAR
VAR_INPUT
	NodePath: STRING(255) := 'motion/axs/Axis_1/cfg/save';
END_VAR

Implementation:

IF bWrite THEN
	fbBuilder(forceDefaults := TRUE);                   //Start flatbuffer builder and load with default values
	udiPhase := fbBuilder.createString(strPhase); 
	udiConfigurationPath := fbBuilder.createString(strEmpty);
	udiId := fbBuilder.createString(strEmpty);
	fb_comm_datalayer_PersistenceParam.startPersistenceParam(fbBuilder);
	fb_comm_datalayer_PersistenceParam.addPhase(udiPhase);
	fb_comm_datalayer_PersistenceParam.addConfigurationPath(udiConfigurationPath);
	fb_comm_datalayer_PersistenceParam.addId(udiId);
	fbBuilder.finish(fb_comm_datalayer_PersistenceParam.endPersistenceParam());
	NodeValueIn.SetFlatbuffer(fbBuilder);                 //Set flatbuffer out of the builder in the variable to be written
	bExecute := TRUE;
	bWrite := FALSE;
END_IF

fb_DL_CreateNodeValue(
	Execute:= bExecute, 
	Done=> bDone, 
	Active=> bActive, 
	Error=> bError, 
	ErrorID=> , 
	ErrorIdent=> , 
	ClientId:= , 
	NodeName:= NodePath, 
	NodeValueIn:= NodeValueIn, 
	NodeValueOut:= NodeValueOut);
	
IF bDone THEN
	bExecute := FALSE;
END_IF

 

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