MIAC ANALOGUE INPUT - HELP

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

Moderators: Benj, Mods

sabretooth4
Posts: 3
Joined: Fri May 16, 2014 4:04 pm
Has thanked: 1 time
Contact:

MIAC ANALOGUE INPUT - HELP

Postby sabretooth4 » Fri May 16, 2014 4:08 pm

Hello All,

I want to use the MIACs Analogue inputs to read a voltage.

Once the required voltage is achieved for the MIAC to turn a relay on

I don't know how to read the voltage through the Miac can anyone help please??

Thank you :D

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8420
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2402 times
Been thanked: 3437 times
Contact:

Re: MIAC ANALOGUE INPUT - HELP

Postby medelec35 » Sat May 17, 2014 11:29 am

Hi sabretooth4,
Welcome to the Matrix forums.
What Version of Flowcode are you using?

The easiest way is to readAsBytes.
If byte value is odd then result then add1 to result.
Divide result by 2
Then the result will be the result 10 times bigger than the measured voltage.

For example 1.if result ReadAsByte is = 9
9+1 = 10 since 9 is an odd number.
10/2 = 5
Therefore Voltage is = 0.5V

For example 2.if result ReadAsByte is = 210
210/2 = 105
Therefore Voltage is = 10.5V
You can use MOD is determine if odd or even value.

Example
If Byte MOD 2 then Byte is an odd number

You can print result by converting to string.
Then you can make it look more professional.

If you need further assistance, then I can help you create a flowchart.

Martin
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

sabretooth4
Posts: 3
Joined: Fri May 16, 2014 4:04 pm
Has thanked: 1 time
Contact:

Re: MIAC ANALOGUE INPUT - HELP

Postby sabretooth4 » Sun May 18, 2014 12:06 pm

Hello medelec35,

Thank you for replying and helping me out :)

I am using FC6, i am quite experienced in using Flowcode :) just had an issue as never had to use the analogue inputs.

But what you have said makes perfect sense :) and has helped alot.

Thank you very much :D :D

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8420
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2402 times
Been thanked: 3437 times
Contact:

Re: MIAC ANALOGUE INPUT - HELP

Postby medelec35 » Sun May 18, 2014 1:54 pm

Your welcome.

Just need to remember that to use the analogue component you don't need to add any analogue inputs as they are already built within the Miac component.
so all you need to do is:
Reading Analogue.png
Reading Analogue.png (73.13 KiB) Viewed 4818 times


Martin
These users thanked the author medelec35 for the post (total 3):
sabretooth4 (Mon May 19, 2014 8:57 am) • LeighM (Mon May 19, 2014 9:23 am) • KevinH (Fri Aug 08, 2014 11:26 am)
Rating: 15.79%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.