I raised this issue when the Matrix web site was down and the forum was not operational. I had some email traffic with Steve, I am now concerned that this issue my have been missed on the Beta version because it is not logged on the forum.
Extract From E-mail 1/12/2009 to Steve Tandy
I am working on a CAN Bus test platform for a CAN demonstrator. I am using Matrix Hardware E block and MIAC to emulate a CAN Bus system and developing the firmware for each node using Flowcode 4. I require to make some minor changes to the CAN controller registers to put the device into "One Shot Mode" and write a second macro to interrogate the status of theTXB control registers. My intention was to call the BitModify macro, to set the one shot mode setting parameters locally and call it from a custom macro, the code compiled to 'C' without any problems. However I did find difficulty when calling the macro from the component macro flow diagram as it is asking for parameters that are not required and there seems no way of turning this off. I would assume that the parameters created in the edit screen would be used when calling the macro also the local variables are greyed out.
Best regards,
Jim
Custom Component Macro's Issue
Moderator: Benj
-
Sean
- Valued Contributor

- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: Custom Component Macro's Issue
Hello Jim,
I have tried to replicate your problem, and received an error message during compilation.
The custom code prototype for the CAN_BitModify function appears to require 4 parameters. The 4th parameter (cfg) is not required - we are looking into why this is displayed.
I created a new CAN macro called OneShotMode, containing the following test code:
FCD_CAN0_CAN_BitModify(0,0,0);
return;
The presence of only the 3 required parameters in the CAN_BitModify function call allowed compilation to be completed successfully.
No parameters are required to be passed to the OneShotMode macro from Flowcode.
I have tried to replicate your problem, and received an error message during compilation.
The custom code prototype for the CAN_BitModify function appears to require 4 parameters. The 4th parameter (cfg) is not required - we are looking into why this is displayed.
I created a new CAN macro called OneShotMode, containing the following test code:
FCD_CAN0_CAN_BitModify(0,0,0);
return;
The presence of only the 3 required parameters in the CAN_BitModify function call allowed compilation to be completed successfully.
No parameters are required to be passed to the OneShotMode macro from Flowcode.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Custom Component Macro's Issue
Hello Jim
I have fixed the problem in the component code file. Save the attached file into your Flowcode v4/Components directory and restart Flowcode, the fourth additional parameter should now have dissapeared.
Let me know if you have any further problems.
I have fixed the problem in the component code file. Save the attached file into your Flowcode v4/Components directory and restart Flowcode, the fourth additional parameter should now have dissapeared.
Let me know if you have any further problems.
- Attachments
-
- PIC_CAN.c
- (36.45 KiB) Downloaded 288 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Custom Component Macro's Issue
Hi Ben,
I have managed to get a work around for most of the Macro's I have written, for instance the read switches on the CAN(2) has been rewritten and used to read registers in the can controller. The problem I find creating new custom macro's is the code randomly sets the number of parameters, an experiment you can try, generate two new macro's no need to write any code. On using them on a Flowcode diagram you will find the macro will ask for a set of parameters for one of the standard macro's.
Thanks
Jim
I have managed to get a work around for most of the Macro's I have written, for instance the read switches on the CAN(2) has been rewritten and used to read registers in the can controller. The problem I find creating new custom macro's is the code randomly sets the number of parameters, an experiment you can try, generate two new macro's no need to write any code. On using them on a Flowcode diagram you will find the macro will ask for a set of parameters for one of the standard macro's.
Thanks
Jim
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: Custom Component Macro's Issue
This issue has been fixed and we hope to release a patch for it in February. If you don't mind, I wouldn't mind trying out the fix on you before I release it. Can I send you and undated exe? If so, please email me and I'll try to get it to you sometime next week.