Hello all,
I’m getting an error with the MC_BR_CamAutomatGetPar funtion. When I use MC_GearIn first then I use MC_BR_CamAutomatGetPar , I get an error.
The Logger is shown below:
Thanks,
Tung
Hi @nguyenthanhtung ,
I don’t think MC_BR_CamAutomatGetPar_AcpAx is designed to upload the parameters of an internal automat:
Have you tried to call that function block with one automat defined in your Axis feature?
Ciao
Valerio
Actually, I’m want to use all synchronous functions to show my to clients. After use MC_GearIn Or MC_CamIn then I can’t not use functions related to CamAutomat such as MC_BR_CamAutomatCommand, MC_BR_CamAutomatGetPar_AcpAx, it has an error with ID -1067317233. But when I warm start the controller and use the MC_BR_CamAutomatCommand frist, it still work.
Hi @nguyenthanhtung ,
Actually, I’m want to use all synchronous functions to show my to clients.
I guess you could choose a different path to explain how in B&R we implement the synchronization between axes (master - slave), you could start your presentation for example with only mapp Cockpit and zero lines of code:
Next step you could add couple of function blocks, MpAxisCoupling for Gear in and Cam in and MpAxisCamSequencer for Automat in you task.
In the final step I will present the PLCOpen motion function blocks.
You know step by step from top to bottom…
Just an idea
Ciao
Valerio
Hi @valerio.manenti ,
So, it’s impossible to use functions related to CamAutomat after used Synchronous functions such as MC_GearIn, MC_GearOut in the programming, right ?
No
You should execute the sequence below with no error:
Step 1) Power on Master and Slave Axis (Master,Slave: Disabled → Stanstill )
Step 2) Home direct (ref pulse off) both Master and Slave Axis (Master,Slave: Standstill → Homing → Standstill)
Step 3) Call MC_GearIn on the Slave(Master: Standstill; Slave: Standstill → Synchronized Motion)
Step 4) Call MC_MoveVelocity on the Master(Master: Standstill → Continuous Motion; Slave: Synchronized Motion)
Step 5) Call MC_GearOut on the Slaver(Master: Continuous Motion; Slave: Synchronized → Continuous Motion)
Step 6) Call MC_Stop on Master and Slave Axis (Master,Slave: Continuous Motion → Stopping → Standstill)
Step 7) Call MC_BR_CamAutomatCommand on Slave Axis (Master: Standstill, Slave: Standstill → Synchronized Motion)
Ciao
Valerio
I’m so sorry @nguyenthanhtung!
I did a test in simulation and I have reproduced your issue:
On the first sequence below I call MC_GearIn and then MC_BR_CamAutomatCommand
On the second below, I don’t call MC_GearIn and no issue when I call MC_BR_CamAutomatCommand
I’ll ask a clarification to my colleagues in Support and I’ll update you when I have news.
Ciao
Valerio
Hi everyone,
this behavior is intended.
After any coupling function block e.g. MC_GearIn or MC_CamIn (other than MC_BR_CamAutomatCommand) was activated, calling MC_BR_CamAutomatGetPar or
MC_BR_CamAutomatCommand will result in the error mentioned in the OP.
The purpose is, that the application should not be allowed to control the cam automat with MC_BR_CamAutomatCommand when it was parametrized by
MC_GearIn, MC_CamIn, etc. and interfere with that function blocks internal operation.
MC_BR_CamAutomatCommand can be used when the cam automat was parametrized via a cam automat feature at start-up, or by MC_BR_CamAutomatSetPar.
The following sequence will not result in an error:
Edit:
Calling MC_BR_CamAutomatGetPar after a coupling FB (e.g. MC_GearIn, MC_CamIn, etc.) is also prohibited on purpose to prevent the following use case:
Preventing this allows for extentions and optimizations in the cam automates the coupling FBs parametrize, without influencing existing applications.
Thanks so much @Martin.Schrott for the clarification!
@nguyenthanhtung I modified a little bit my sequence, I followed the guidelines from Martin and as you see below no more issue:
I’m going to mark the comment from Martin as solution.
Ciao
Valerio