Page 2 of 5

Re: MIAC based temperature controller

Posted: Sun Oct 28, 2012 8:30 am
by DylanBalloo
Hello there, hope everyone is fine.
Can you please recommend me a thermistor which I can use for my project?

Re: MIAC based temperature controller

Posted: Sun Oct 28, 2012 11:26 am
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.

Re: MIAC based temperature controller

Posted: Sun Oct 28, 2012 11:30 am
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.

Re: MIAC based temperature controller

Posted: Sun Oct 28, 2012 11:53 am
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

Re: MIAC based temperature controller

Posted: Sun Oct 28, 2012 1:34 pm
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

Re: MIAC based temperature controller

Posted: Mon Oct 29, 2012 10:18 pm
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..

Re: MIAC based temperature controller

Posted: Tue Oct 30, 2012 5:20 pm
by DylanBalloo
Sorry I mean for the simulation?

Re: MIAC based temperature controller

Posted: Tue Oct 30, 2012 5:48 pm
by Enamul
I am talking about real hardware..simulation works fine without delay but in real hardware you will need delay.

Re: MIAC based temperature controller

Posted: Wed Oct 31, 2012 8:02 am
by DylanBalloo
ok.thank you

Re: MIAC based temperature controller

Posted: Tue Nov 27, 2012 8:57 am
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?

Re: MIAC based temperature controller

Posted: Tue Nov 27, 2012 10:44 am
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

Re: MIAC based temperature controller

Posted: Tue Nov 27, 2012 10:59 am
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

Re: MIAC based temperature controller

Posted: Tue Nov 27, 2012 2:53 pm
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

Re: MIAC based temperature controller

Posted: Tue Nov 27, 2012 3:00 pm
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.

Re: MIAC based temperature controller

Posted: Tue Nov 27, 2012 3:15 pm
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

Re: MIAC based temperature controller

Posted: Wed Nov 28, 2012 4:09 pm
by DylanBalloo
Ok Enamul, Thank you.I'll look at it and come to you..
Thanks again

Re: MIAC based temperature controller

Posted: Wed Nov 28, 2012 4:43 pm
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..

Re: MIAC based temperature controller

Posted: Wed Nov 28, 2012 5:30 pm
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.

Re: MIAC based temperature controller

Posted: Wed Nov 28, 2012 5:51 pm
by DylanBalloo
How does MOD 10 of 64 produce 4?????????????

Re: MIAC based temperature controller

Posted: Wed Nov 28, 2012 5:59 pm
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

Re: MIAC based temperature controller

Posted: Sun Dec 02, 2012 6:29 am
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???

Re: MIAC based temperature controller

Posted: Sun Dec 02, 2012 11:33 am
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

Re: MIAC based temperature controller

Posted: Sun Dec 02, 2012 3:13 pm
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??

Re: MIAC based temperature controller

Posted: Sun Dec 02, 2012 3:53 pm
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!!!

Re: MIAC based temperature controller

Posted: Mon Dec 03, 2012 4:45 pm
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