12-06-2021 09:18 AM - edited 01-13-2022 01:03 PM
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 ...
#01 #02 #03 #04 #05 #06
#07 #08 #09 #10 #11 #12
#13 #14 #15 #16 #17 #18
#19 #20 #21 #22 #23 #24
12-06-2021 09:30 AM - last edited on 12-07-2021 10:38 AM by nexidator
Do you know that the Object Browser can not only update your Std, but also clean up your Std?
The clean up function deletes all unused objects/peripherals.
12-06-2021 09:34 AM - edited 12-09-2021 10:05 AM
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).
12-07-2021 09:47 AM - edited 12-07-2021 09:48 AM
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:
Declaration:
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:
VAR
/// 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;
END_VAR
--------------------------------------------------------------
IF( Station.PcdAccess.ExecState = OpconExecState.DONE )
THEN
Station.PcdAccess.Execute := FALSE;
_retVal := OK;
ELSIF( Station.PcdAccess.ExecState = OpconExecState.ERROR )
THEN
Station.PcdAccess.Execute := FALSE;
// get currently active errors
Station.PcdAccess.GetPendingEvents(OpconEventQueryType.ERROR, _eventQuery);
// search for error "unkown identifier"
_eventFound := FALSE;
FOR _i := 1 TO _eventQuery.UsedEntries
DO
IF( _eventQuery.Entry[_i].Number = PcdAccessServerEvents.ERR_UNKOWN_ID )
THEN
// OOID must also be compared because event numbers are not unique
_equalOoids := OpconObjectIdIsEqual(_eventQuery.Entry[_i].ObjectId, PcdAccessConstants.OOID);
IF( _equalOoids )
THEN
_eventFound := TRUE;
EXIT;
END_IF
END_IF
END_FOR
IF( _eventFound )
THEN
// create new part if it doesn't exist on PCD server
_retVal := JUMP1;
ELSE
// any other error -> stop automatic chain
_env.ChainControl := OpconChainControl.ERROR;
END_IF
END_IF
12-08-2021 11:29 AM
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:
12-09-2021 09:49 AM
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
Loc103K201_PressCylinder.Unit.SetOutputs(BasMoveSetOutputMode.ALL_TRUE);
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.