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
MIAC ANALOGUE INPUT - HELP
-
- Posts: 3
- Joined: Fri May 16, 2014 4:04 pm
- Has thanked: 1 time
- Contact:
-
- 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
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
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
-
- Posts: 3
- Joined: Fri May 16, 2014 4:04 pm
- Has thanked: 1 time
- Contact:
Re: MIAC ANALOGUE INPUT - HELP
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
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
-
- 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
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: Martin
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: Martin
Martin