MOD Operation selected after Minut

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

Moderators: Benj, Mods

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Tue Jul 10, 2018 1:54 pm

Hi medelec35
Thank you for the overview of the port for I1-I5
Again, I would like to thank you very much for the great help.

I print to a document so it's remembered another time.
Best Regard
Monie

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Tue Jul 10, 2018 2:43 pm

Hi medelec35
I can only get I1 and I2 to work in Practice!
The Flowcode Code you use to be able to simulate, I can get such a version to even simulate I1-I8 ??
Best Regard
Monie

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

Re: MOD Operation selected after Minut

Postby medelec35 » Tue Jul 10, 2018 3:18 pm

Hi Monie,
Monie Jacobsen wrote:I can only get I1 and I2 to work in Practice!

Looking at the datasheet on page 18:
Only I1 an I2 available.png
Only I1 an I2 available.png (63.04 KiB) Viewed 84 times

So for any logic input you can only use I1 & I2 that'a why you get the results you did.
Perhaps Matrix can confirm that you can't use I3 to I8 for logic inputs, only analog?
Monie Jacobsen wrote:The Flowcode Code you use to be able to simulate, I can get such a version to even simulate I1-I8 ??

I'm assuming you mean you can't get your own flowchart to simulate?
Just go to Simulation menu (Cog icon) and add Simulation External input:
Simulation External Input.png
Simulation External Input.png (53.3 KiB) Viewed 84 times
If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

Martin

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Tue Jul 10, 2018 4:15 pm

Hi medelec35
Thank you very much for your help.
I want to work with the project and thus learn more about Flowcode.
Best Regard
Monie

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Wed Jul 11, 2018 2:28 pm

Hello Everbardy
With pulses on I2, and selected to INT2 / REMAP-
and port number RB1 and read the frequency fine now.

But know as the picture below shows, "executar um loop" does not work!
By AZ = 182 and FloatFiktGrader = 182 then "executor um loop" must be premature and out of loop and finished.
And a new Tracking must first be possible when AZ and FloatFiktGrader are different again!!
Also when FloatFiktGrader is less than AZ
executar um loop.JPG
executar um loop.JPG (57.83 KiB) Viewed 70 times

Attached test Coder:
READ FREQUENCY_dsPIC Miac-003.fcfx
(21.34 KiB) Downloaded 2 times

Have tried with a lot of code changes but unsuccessfully!
Hope you will be helpful in solving the above problem.
Best Regard
Monie

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Thu Jul 12, 2018 10:12 am

Hello Everbardy
Is there anyone who will be helpful with the above / previous posts?
So I can get Tracking on / off to work!
Best Regard
Monie

User avatar
Steve
Matrix Staff
Posts: 2998
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 67 times
Been thanked: 301 times
Contact:

Re: MOD Operation selected after Minut

Postby Steve » Thu Jul 12, 2018 12:30 pm

I don't understand what you are wanting to do.

At the moment, your program has a loop which effectively says "execute the commands within this loop if az does not equal FloatFiktGrader". If they are equal, it will not execute the commands inside the loop. If they are not equal, it will get stuck within the loop and continually execute the commands forever because there variables will not change once inside the loop.

So, you definitely need to read one or both of the variables within the loop, otherwise there is no opportunity for the variables to change and the expression ("az = FloatFiktGrader")to become false - and therefore to exit the loop.

You also need to be clear of whether you want to loop "until" the statement is true or "while" the statement is true. And you also need to think about if you want to check the statement at the beginning or the end of the loop.

I hope this helps.

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Thu Jul 12, 2018 12:40 pm

Hi Steve
When az = FloatFiktGrader has the same value, exit the loop
Best Regard
Monie

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

Re: MOD Operation selected after Minut

Postby medelec35 » Thu Jul 12, 2018 2:23 pm

Hi Monie,
Since

Code: Select all

Fiktgrader
variable is only going to be an integer as its based on a pin I/P, then why convert to a float?
Also If the hardware is not working as intended,
Why don't you pass variable values to the Miac display for diagnostic purposes?
That way you can see for yourself what the possible cause is.
If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

Martin

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Thu Jul 12, 2018 2:54 pm

Hi medelec35
Rigtigt mange tak for din information;-)

Code: Select all

variable is only going to be an integer as its based on a pin I/P, then why convert to a float?

The file AZer format Float therefore convert Fiktgrader to a float.
To be able to unite them. (compare them)
And being able to calculate with these two file formats.
But I am very open to suggestions :D
Look here!
Attached last code:
READ FREQUENCY_dsPIC Miac-004.fcfx
(20.54 KiB) Not downloaded yet

To learn, I am very open to suggestions
Best Regard
Monie

User avatar
Steve
Matrix Staff
Posts: 2998
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 67 times
Been thanked: 301 times
Contact:

Re: MOD Operation selected after Minut

Postby Steve » Thu Jul 12, 2018 4:50 pm

Monie Jacobsen wrote:Hi Steve
When az = FloatFiktGrader has the same value, exit the loop

Ok, I understand.

First, here's an example logic of the loop:
1) just before the start of the loop, read az and Fiktgrader
2) the loop should be a "while" loop that has the condition "az <> Fiktgrader", and test this at the start of the loop.
3) perform what you need to in the loop
4) near the end of the loop, read az and/or Fiktgrader again - you only need to re-read the value that will have changed

Please note that comparing floating point values is not always easy in a microcontroller because, for example, 1.00000000000 does not equal 1.0000000001 although for the logic of your program you might expect these to be equivalent.

Comparing integers is a lot easier, and as one of the quantities is originally an integer then I would suggest you convert the other float value to an integer and then compare the two integers.

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Fri Jul 13, 2018 9:53 am

Hi Steve
Thank you very much for your help.
Have the correct codes according to your proposal...
Do you want to review the attached file and correct or make improvements suggestions?
Please see the file below:
Attached updated file:
READ FREQUENCY_dsPIC Miac-009.fcfx
(18.14 KiB) Downloaded 1 time
Best Regard
Monie

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Mon Jul 16, 2018 10:41 am

Hi Everbardy
Want to use "GPS Module NEO-6M with Flowcode v8 and dsPIC Miac...
Is there anyone who will help with any codes that GPS can run with?
Web-Link: https://www.hackster.io/ruchir1674/how- ... ino-8f90ad
or http://www.instructables.com/id/How-to- ... o-Arduino/
How do I find Analog input from I1-I8 to get in touch with "GPS Module NEO-6M
Connection.JPG
Connection.JPG (14.35 KiB) Viewed 11 times
Best Regard
Monie

Monie Jacobsen
Posts: 297
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 4 times
Been thanked: 34 times
Contact:

Re: MOD Operation selected after Minut

Postby Monie Jacobsen » Mon Jul 16, 2018 3:22 pm

Hi Everbardy
Is there anyone who will be helpful with the above.
The trouble is to find the Port number for reading the GPS signal. I can not find. :x
Best Regard
Monie