MIAC based temperature controller

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

Hello there, hope everyone is fine.
Can you please recommend me a thermistor which I can use for my project?

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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.

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

In the PWM control 2 example can please explain to me what's the use of nldx(BYTE) 1 when you enable the PWM,
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..
Secondly the PRINT ASCII you put before the Delay the last one, what is its use??? and why you put a dealy.
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.
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
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

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?
I am not quite clear whether you are talking about simulation or hardware..
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

Sorry I mean for the simulation?

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

I am talking about real hardware..simulation works fine without delay but in real hardware you will need delay.
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

ok.thank you

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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?

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

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
You might have noticed that in the calculation box..
ShowChannel.DisplayLine = ShowChannel.Channel - 1
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..
Then you add a decision if showchannel.Intvolt<10...YES Print ascii " "
This is to clear first digit of voltage >=10..when voltage goes below 10.
Print number showchannel.IntVolts
Print integer part of voltage value
Display cursor 8, showchannel.Displayline
move cursor to print decimal place part of voltage
print number showchannel.decvolts
Print decimal part of voltage value
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

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
what are the parameters you used in the macro showchannel. why you use them?
Showchannel has only one parameter and that is channel to re-use the code for 4 channels.
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???
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.
ShowChannel.ADCvalue = ShowChannel.ADCvalue / 2
just dividing adc value by 2.
ShowChannel.DecVolts = ShowChannel.ADCvalue MOD 10
for example adc value =128, above line will produce 64..this line will produce 4
ShowChannel.IntVolts = ShowChannel.ADCvalue / 10
this line will give 6..so that voltage is 6.4V
ShowChannel.DisplayLine = ShowChannel.Channel - 1
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.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

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?
In the main program how did you create the macro with all its parameters. Can you tell me how to proceed.
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..
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?
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 parameters
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

Ok Enamul, Thank you.I'll look at it and come to you..
Thanks again

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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..

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

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..
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.
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

How does MOD 10 of 64 produce 4?????????????

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

DylanBalloo wrote:How does MOD 10 of 64 produce 4?????????????
64/10 = 6 (only digit value no fraction is accepted if not floating point)
64%10 = 4 (remaining is 4)....6*10=60 ...64-60 =4
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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???

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

Can you please further help me..wat you mean by 64%10???
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,
64/10 = 6
64%10 =4
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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??

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MIAC based temperature controller

Post by Enamul »

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??
Which relay and Fan you are talking about..can you please tell me. And please be careful about 230V ac!!!
Enamul
University of Nottingham
enamul4mm@gmail.com

DylanBalloo
Flowcode V4 User
Posts: 73
Joined: Mon Sep 24, 2012 4:31 pm
Been thanked: 1 time
Contact:

Re: MIAC based temperature controller

Post by DylanBalloo »

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

Post Reply