Page 1 of 1

Custom Component Macro's Issue

Posted: Thu Jan 28, 2010 8:42 am
by RayJim
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

Re: Custom Component Macro's Issue

Posted: Thu Jan 28, 2010 9:46 am
by Sean
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.

Re: Custom Component Macro's Issue

Posted: Thu Jan 28, 2010 12:35 pm
by Benj
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.

Re: Custom Component Macro's Issue

Posted: Fri Jan 29, 2010 11:33 am
by RayJim
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

Re: Custom Component Macro's Issue

Posted: Fri Jan 29, 2010 1:52 pm
by Steve
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.