MIAC ANALOGUE INPUT - HELP

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

Moderators: Benj, Mods

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

MIAC ANALOGUE INPUT - HELP

Post by sabretooth4 »

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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: MIAC ANALOGUE INPUT - HELP

Post by medelec35 »

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

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

Re: MIAC ANALOGUE INPUT - HELP

Post by sabretooth4 »

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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: MIAC ANALOGUE INPUT - HELP

Post by medelec35 »

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
(73.13 KiB) Downloaded 5218 times
Martin
Martin

Post Reply