We are moving! We are currently migrating our community to the new Bosch Connected Industry Online Portal. The community will be available latest in the new year again, until then it will be in read-only mode. Click here for more information.
11-15-2022 11:00 AM
Dear Colleagues,
We are working here on an object for our ToolControl system, and we use also RFID for it.
First we started to use the DataTagAccess object, and we parametrised inside with the interface.
Since then we learned the we don't need the read command, so we only use the fix code from the BIS V-6110 peripheral.
During startup my object's ParCfg is parametrised with the interface.
I can use the fixcode in my project with the following line:
_manageUidToString(_parcfg.iDataTagStream.Uid,_uidInString=>OutImm.BoxHead.UniqueId);
(Where we just convert array of bytes to string.)
Problem comes when I would like to check TagPresent:
_tagPresR( CLK := _parCfg.iDataTagStream.TagPresent );
I got an exception immediately when I would like to use it any way. (Tried with direct use also, without rising edge)
If I use directly the peripheral (Peripherals._A204HeadChannel.TagPresent) then it is working, but I had one idea what I don't like to use it in the object, to put it into the OnApplyPar immediately, and hand it over to a local bool.
Do You have any idea to use the _parCfg.iDataTagStream.TagPresent inside my code somehow?
Solved! Go to Solution.
11-15-2022 02:28 PM - edited 11-15-2022 02:37 PM
Hello,
its not allowed using _parCfg from outside.
If you need the value for TagPresent, you can using Unit.OutImm.TagPresent.
One quastion, do you create your own object?
11-15-2022 02:30 PM
I would like to use it inside my lib, in a method under the Unit.
11-15-2022 02:38 PM - edited 11-15-2022 02:40 PM
At what exact moment do you access the interface ?
Is it possible that the interface is not yet set but is already being accessed ?
Try to check the interface is set, before accessing it :
IF ( _parCfg.iDataTagStream <> XNULL )
THEN
_tagPresR( CLK := _parCfg.iDataTagStream.TagPresent );
END_IF
But as Düscha explained, you normaly should not access the _parCfg parameters from outside the function block,
where the _parCfg is declared...
11-15-2022 02:41 PM - edited 11-15-2022 02:47 PM
Have you copy ParCfg to _parCfg.
For example in the method OnUnitOperationalEnter
Have you set ParCfg.iDataTagStream := InstanceFromYourPeripheral;