Hey, it’s december. The time when the day starts with opening a door of an Advent calendar.
Check out the official BCI Advent calendar on LinkedIn with some interesting piece of information every day.
But just these days I noticed in a discussion that there are so many small improvements from Control plus bundle V1.0 to V2.3 that some of you maybe missed. What would be more obvious than showing you a tip every day ...
You can add external tools or batch files to the Control plus Studio menu bar:
In the attachment you can find an example batch file to clean up the station folder (batch file must be placed in station folder).
By default objects and add-ons do not have an output for any active error number, but they provide an array with all active events. By checking for an specific event you can program a specific behaviour.
This is how to realize it in an application:
Implementation in an waiting step after command execution:
PS: If the object or add-on do not provide a special functionality it is not possible to "mute" specific events or acknowledge them automatically.
Source code for copying:
/// temporary FB instance with list of currently active events
_eventQuery : OpconEventQuery;
/// flag if a special event is currently active (found in query)
_eventFound : BOOL;
/// temporary counter of FOR loop
_i : DINT;
/// compared OOIDs are equal
_equalOoids : BOOL;
IF( Station.PcdAccess.ExecState = OpconExecState.DONE )
Station.PcdAccess.Execute := FALSE;
_retVal := OK;
ELSIF( Station.PcdAccess.ExecState = OpconExecState.ERROR )
Station.PcdAccess.Execute := FALSE;
// get currently active errors
// search for error "unkown identifier"
_eventFound := FALSE;
FOR _i := 1 TO _eventQuery.UsedEntries
IF( _eventQuery.Entry[_i].Number = PcdAccessServerEvents.ERR_UNKOWN_ID )
// OOID must also be compared because event numbers are not unique
_equalOoids := OpconObjectIdIsEqual(_eventQuery.Entry[_i].ObjectId, PcdAccessConstants.OOID);
IF( _equalOoids )
_eventFound := TRUE;
IF( _eventFound )
// create new part if it doesn't exist on PCD server
_retVal := JUMP1;
// any other error -> stop automatic chain
_env.ChainControl := OpconChainControl.ERROR;
The BasMove object is a really powerful object. "BasMove" is the abbreviation for basic movement. It can be used for any use case with digital in-/outputs, for example belt motor, fan motor, hydraulic power pack, electrical cylinders and of course pneumatic cylinders.
The parameters for the object are maybe as complicated as powerful the object is. Therefore a short guide for the parameters for the default case of a pneumatic cylinder:
Once again a topic about the BasMove object for pneumatic cylinders:
The BasMove object has two commands, one for each end position. But there is also a method to set the outputs without any command. This can be used for special purposes, special initialization/cancel behaviour, etc.
The method needs to be called only once, not cyclically, for example:
// fill both sides with compressed air
To prevent hard hitting of the end in case of empty compressed air lines there is also another solution for the homing:
With the parameter ParCmd.OutputPulsing:=TRUE the valve output(s) will be pulsed if the cylinder is not in any end position. This is helpful for 5/3 or 2x 3/2 directional valves, for 5/2 directional valves it is useless. With the pulses the compressed air lines will be filled with compressed air slowly. It prevents that the cylinder hits the end hard because of missing counterpressure.
It should work for almost all cylinder sizes without changing the pulse parameters in ParCmd structure.