MIAC based temperature controller
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
Hello there, hope everyone is fine.
Can you please recommend me a thermistor which I can use for my project?
Can you please recommend me a thermistor which I can use for my project?
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
Hello there,
Hope you are fine,
Can you please Advise me a reference of a thermistor which I can buy for my project.
Thank you.
Hope you are fine,
Can you please Advise me a reference of a thermistor which I can buy for my project.
Thank you.
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
Hello Enamul,
I've looked at the program you sent to me.
I have some queries.
In the PWM control 2 example can please explain to me what's the use of nldx(BYTE) 1 when you enable the PWM,Secondly the PRINT ASCII you put before the Delay the last one, what is its use??? and why you put a dealy.
Thank you.
I've looked at the program you sent to me.
I have some queries.
In the PWM control 2 example can please explain to me what's the use of nldx(BYTE) 1 when you enable the PWM,Secondly the PRINT ASCII you put before the Delay the last one, what is its use??? and why you put a dealy.
Thank you.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
nldx actually defines no of PWM channel and in this case it is channel 1. But you can change it to 2 you will second channel will work if you change in nldx in both macros..In the PWM control 2 example can please explain to me what's the use of nldx(BYTE) 1 when you enable the PWM,
This 2 space printascii is to remove any three digit adc value while printing 1 or 2 digit adc value..for example, you have adc value 129 printed in LCD and you decreased that to 89..if you remove that printascii macro you will see 899 in display instead of 89..so this is basically prints adc value + two blank space. so one digit like 7 + two space occupies three space so previous three digit will be erased..89+two space occupies 4 space so previous three space will be erased.Secondly the PRINT ASCII you put before the Delay the last one, what is its use??? and why you put a dealy.
Delay..
If you don't add delay you adc will struggle to read so fast and LCD will blink..to stabilize adc read and lcd display we need to put some delay
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
For the delay, I've removed it, but its the display of the PWM(0) which is blinking not the LCD display of the MIAC?
Thank Enamul
Thank Enamul
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
I am not quite clear whether you are talking about simulation or hardware..For the delay, I've removed it, but its the display of the PWM(0) which is blinking not the LCD display of the MIAC?
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
I am talking about real hardware..simulation works fine without delay but in real hardware you will need delay.
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
Hello Enamul,
I am having a look a the Code Entry program.
In the main program how did you create the macro with all its parameters. Can you tell me how to proceed.
I tried to create the macro, while editing the macro I have some problems, I could not find the GetCode.index variable?Are they automatically created?
I am having a look a the Code Entry program.
In the main program how did you create the macro with all its parameters. Can you tell me how to proceed.
I tried to create the macro, while editing the macro I have some problems, I could not find the GetCode.index variable?Are they automatically created?
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
Hello Enamul,
I'm looking at the Digital Voltmeterx4 program.
got some queries
what are the parameters you used in the macro showchannel. why you use them?
In the macro showchannel, just after the start you use Input ID showchannel.channel, why u didnot use channel directly or 1, 2, 3 or 4 for the ID???
Then you add a decision, why did you use showchannel.ADC value MOD 2?what is MOD 2
then if yes Showchannel.ADC value= showchannel.adcvalue+1....why you did that?
then you add a calculation can you please explain to me each of these lines
ShowChannel.ADCvalue = ShowChannel.ADCvalue / 2
ShowChannel.DecVolts = ShowChannel.ADCvalue MOD 10
ShowChannel.IntVolts = ShowChannel.ADCvalue / 10
ShowChannel.DisplayLine = ShowChannel.Channel - 1
Thank you
I'm looking at the Digital Voltmeterx4 program.
got some queries
what are the parameters you used in the macro showchannel. why you use them?
In the macro showchannel, just after the start you use Input ID showchannel.channel, why u didnot use channel directly or 1, 2, 3 or 4 for the ID???
Then you add a decision, why did you use showchannel.ADC value MOD 2?what is MOD 2
then if yes Showchannel.ADC value= showchannel.adcvalue+1....why you did that?
then you add a calculation can you please explain to me each of these lines
ShowChannel.ADCvalue = ShowChannel.ADCvalue / 2
ShowChannel.DecVolts = ShowChannel.ADCvalue MOD 10
ShowChannel.IntVolts = ShowChannel.ADCvalue / 10
ShowChannel.DisplayLine = ShowChannel.Channel - 1
Thank you
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
Hello Enamul,
Still in the Digital Volmeter program
after the calculation , you use a display cursor, and you use 5, showchannel.Displayline>...WHy did you use that?
Then you add a decision if showchannel.Intvolt<10...YES Print ascii " "(the space is to remove previous number written right)
after the decision you wrote
Print number showchannel.IntVolts
Display cursor 8, showchannel.Displayline
print number showchannel.decvolts
Can you please explain the above BOLD line
Thank you loaddssssssssssssssssssssss
Still in the Digital Volmeter program
after the calculation , you use a display cursor, and you use 5, showchannel.Displayline>...WHy did you use that?
Then you add a decision if showchannel.Intvolt<10...YES Print ascii " "(the space is to remove previous number written right)
after the decision you wrote
Print number showchannel.IntVolts
Display cursor 8, showchannel.Displayline
print number showchannel.decvolts
Can you please explain the above BOLD line
Thank you loaddssssssssssssssssssssss
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
You might have noticed that in the calculation box..DylanBalloo wrote:Hello Enamul,
Still in the Digital Volmeter program
after the calculation , you use a display cursor, and you use 5, showchannel.Displayline>...WHy did you use that?
Then you add a decision if showchannel.Intvolt<10...YES Print ascii " "(the space is to remove previous number written right)
after the decision you wrote
Print number showchannel.IntVolts
Display cursor 8, showchannel.Displayline
print number showchannel.decvolts
Can you please explain the above BOLD line
Thank you loaddssssssssssssssssssssss
so the line we want to print voltmeter result out of 4 lines (first line is 0, 2nd 1, 3rd 2 & 4th 3) is defined by ShowChannel.DisplayLine variable..which is depending on channel variable passed from main macro..ShowChannel.DisplayLine = ShowChannel.Channel - 1
This is to clear first digit of voltage >=10..when voltage goes below 10.Then you add a decision if showchannel.Intvolt<10...YES Print ascii " "
Print integer part of voltage valuePrint number showchannel.IntVolts
move cursor to print decimal place part of voltageDisplay cursor 8, showchannel.Displayline
Print decimal part of voltage valueprint number showchannel.decvolts
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
DylanBalloo wrote:Hello Enamul,
I'm looking at the Digital Voltmeterx4 program.
got some queries
what are the parameters you used in the macro showchannel. why you use them?
In the macro showchannel, just after the start you use Input ID showchannel.channel, why u didnot use channel directly or 1, 2, 3 or 4 for the ID???
Then you add a decision, why did you use showchannel.ADC value MOD 2?what is MOD 2
then if yes Showchannel.ADC value= showchannel.adcvalue+1....why you did that?
then you add a calculation can you please explain to me each of these lines
ShowChannel.ADCvalue = ShowChannel.ADCvalue / 2
ShowChannel.DecVolts = ShowChannel.ADCvalue MOD 10
ShowChannel.IntVolts = ShowChannel.ADCvalue / 10
ShowChannel.DisplayLine = ShowChannel.Channel - 1
Thank you
Showchannel has only one parameter and that is channel to re-use the code for 4 channels.what are the parameters you used in the macro showchannel. why you use them?
channel is a local variable cab't be used like global variable so have to use either showchannel.channel or .channel format. you can't use 1,2,3,4 as you are passing channel parameter from main macro.In the macro showchannel, just after the start you use Input ID showchannel.channel, why u didnot use channel directly or 1, 2, 3 or 4 for the ID???
just dividing adc value by 2.ShowChannel.ADCvalue = ShowChannel.ADCvalue / 2
for example adc value =128, above line will produce 64..this line will produce 4ShowChannel.DecVolts = ShowChannel.ADCvalue MOD 10
this line will give 6..so that voltage is 6.4VShowChannel.IntVolts = ShowChannel.ADCvalue / 10
channel=1 is passed for channel 1 but LCD line starts from 0 and finishes at 3 not from 1 to 4. so display line is channel -1.ShowChannel.DisplayLine = ShowChannel.Channel - 1
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
DylanBalloo wrote:Hello Enamul,
I am having a look a the Code Entry program.
In the main program how did you create the macro with all its parameters. Can you tell me how to proceed.
I tried to create the macro, while editing the macro I have some problems, I could not find the GetCode.index variable?Are they automatically created?
Select insert a macro icon and drag it to the main flowline..double-click a window will pop-up..In the bottom create new macro..int the top, put new macro name without space..click edit parameter in middle right..add different parameter name and type here...OK..you will see your parameter listed in the box below..click edit variable..in the local variable section..define any local variable that you want to use in the macro only..this also answers your following question..In the main program how did you create the macro with all its parameters. Can you tell me how to proceed.
If you want to return anything from the macro, select return variable type in the bottom..if not select no return variable..OK..your macro is ready to use..Now put your parameter and return value to call the macro..for return if select any that should be the variable you defined in the main macro..and also be careful about the variable type..like you want to return integer data but you have select an INT variable there...same is true for parametersI tried to create the macro, while editing the macro I have some problems, I could not find the GetCode.index variable?Are they automatically created?
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
Ok Enamul, Thank you.I'll look at it and come to you..
Thanks again
Thanks again
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
Hi Enamul,
In the Digital Voltmeterx4, you use a variable channel, and in the show channel macro you use a parameter channel. Are they the same??
What is the difference between parameter and local variable.What are their purpose?
can we just simply use variables??
Thank you..
In the Digital Voltmeterx4, you use a variable channel, and in the show channel macro you use a parameter channel. Are they the same??
What is the difference between parameter and local variable.What are their purpose?
can we just simply use variables??
Thank you..
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
Variable channel is used to pass parameter from main macro to showchannel macro. Parameter as I have told earlier is a way to pass data from calling macro to called macro. local variable is a variable only can be used in that macro. we can use variable to replace necessity of local variable but we can't replace necessity of parameter by anything. Local variable is beneficial than global as compiler can re-assign that RAM location for other local variable which ultimately make the RAM usage efficient.DylanBalloo wrote:Hi Enamul,
In the Digital Voltmeterx4, you use a variable channel, and in the show channel macro you use a parameter channel. Are they the same??
What is the difference between parameter and local variable.What are their purpose?
can we just simply use variables??
Thank you..
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
64/10 = 6 (only digit value no fraction is accepted if not floating point)DylanBalloo wrote:How does MOD 10 of 64 produce 4?????????????
64%10 = 4 (remaining is 4)....6*10=60 ...64-60 =4
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
Sorry enamul, i can't get this line clear 64%10 = 4 (remaining is 4)....6*10=60 ...64-60 =4
Can you please further help me..wat you mean by 64%10???
Can you please further help me..wat you mean by 64%10???
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
Actually "/" sign is means divide and will produce the result of division without remaining. But "%" sign means modulus. which will produce remaining in a division operation. So for this example,Can you please further help me..wat you mean by 64%10???
64/10 = 6
64%10 =4
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
For the output of the relay, can you please tell me if I can connect a 230V Ac supply to it, that connect it to switch on a fan??
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: MIAC based temperature controller
Which relay and Fan you are talking about..can you please tell me. And please be careful about 230V ac!!!For the output of the relay, can you please tell me if I can connect a 230V Ac supply to it, that connect it to switch on a fan??
-
- Flowcode V4 User
- Posts: 73
- Joined: Mon Sep 24, 2012 4:31 pm
- Been thanked: 1 time
- Contact:
Re: MIAC based temperature controller
For the relay output in the miac,that is Q1,Q2,Q3,Q4....regarding the fan, it is a normal home fan,which is rated at 220V and 50Hz