Hello, I have 2 questions.
1: If it is possible to define more than 10 variables in a macro?
2: why can not establish a VNet I2C connection?
I work with Flowcode 4.3 and need for my project more than 30 macros and in some macros more than 10 variables.
Regards, Christina
Questions to variables and VNet
Moderator: Benj
- 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: Questions to variables and VNet
Hello Christina,
If you need to pass more then 10 parameters then you can package them into a string or you can use them as global.
1) packaging into a string. Create a string variable with the number of elements you require. Then using a calculation icon you can set the parameters by using code as follows.
strvar[0] = 2
strvar[1] = 56
...
strvar[19] = 23
You can then pass the string as the parameter and then use calculation icons in the macro to read back the values.
2) Using global variables. All Flowcode variables are global so you should be able to use your created variables anywhere in your program without resorting to so many parameters.
Vnet only currently supports RS232 and CAN communications. If you have a need for other busses to be available then please make a note of this in our Flowcode suggestions forum area. I2C is a master/slave bus only anyway and Flowcode does not currently support the slave operation so you would not be able to connect up two micros using this without resorting to using custom code anyway.
If you need to pass more then 10 parameters then you can package them into a string or you can use them as global.
1) packaging into a string. Create a string variable with the number of elements you require. Then using a calculation icon you can set the parameters by using code as follows.
strvar[0] = 2
strvar[1] = 56
...
strvar[19] = 23
You can then pass the string as the parameter and then use calculation icons in the macro to read back the values.
2) Using global variables. All Flowcode variables are global so you should be able to use your created variables anywhere in your program without resorting to so many parameters.
Vnet only currently supports RS232 and CAN communications. If you have a need for other busses to be available then please make a note of this in our Flowcode suggestions forum area. I2C is a master/slave bus only anyway and Flowcode does not currently support the slave operation so you would not be able to connect up two micros using this without resorting to using custom code anyway.
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: Questions to variables and VNet
Hello Benj,
Thanks for your quick response!
I already use global variables and arrays, but I wanted to leave the variables in the macros that are used there.
I2C VNet would have been nice but not absolutely necessary.
Regards
Christina
Thanks for your quick response!
I already use global variables and arrays, but I wanted to leave the variables in the macros that are used there.
I2C VNet would have been nice but not absolutely necessary.
Regards
Christina